The exploitation of intersatellite links (ISLs) makes the LEO satellite constellation based Internet service widely favored due to its advantages of low-latency and high-speed communications. However, considering the time-varying network topology, limited on-board resources, and high node failure probability, the design of link assignment has become one of the key challenges for the future megaconstellation. To solve this problem, we adopt the idea of modified finite state automaton (FSA) to model the LEO satellite network and use nondominated sorting genetic algorithm (NSGA-II) to optimize the minimum residual capacity and the maximum transmission delay. The simulation results show that our method is more invulnerable and flexible, which is fit for megaconstellations. This work can provide comprehensive guidance on intersatellite link assignment for future megaconstellations.