I. Single-nic network can be pinged but cannot be ssh solved
After route add default gw 10.0.116.62 is complete, the Intranet can be accessed.
After the restart, the gateway becomes invalid. Solution: Create a script file starting with "S" under "/etc/rc2.d", such as "S96gateway", add "route add default 10.0.116.62", and then add "chmod + xS96gateway, reboot.
2. Two NICs:
For security purposes, especially in the dmz region, the dual-nic Intranet segment is used for internal data exchange. The Internet segment provides web Services, however, after both NICs are connected to the network, it is found that the server cannot be accessed through the office LAN ssh Through the Internet ip address, but the two different ip addresses can be pinged, after carefully checking the routing information, we found that the connection failure was discovered because there was only one Default Gateway when the dual Nic was enabled. This situation is relatively complicated, so no default gateway is set for both NICs. :) this situation occurs when neither of the two network segments connected to linux is a single network segment! The two connected CIDR blocks can also access different CIDR blocks. in this case, no matter which side the gateway is set, the network segment connected to the other network segment cannot be used normally. this is what I want to express most today. in this case, if you want to connect to multiple network segments, you must first set the correct ip address on the correct Nic, and the rest of the work will be handed over to route. use the route command to set the gateway that can access the Internet or want to access the Internet over there to the default gateway, which solves a network segment. the other segment and all the network segments connected to it require a route.
Example
1) Add the Default Gateway:
Route add default gw 10.0.116.62 eth0
2) Add a route:
Route add-net 192.168.115.0/24 gw 192.168.1.254 eth1
# When adding a route, specify the next hop and only the gateway connected to the Local Machine