Your server needs to have a single default gateway. A network adapter configured with DHCP automatically assigns a default gateway to the DHCP server, but a network adapter configured with a static IP address needs to manually configure the default gateway. This can be done with a simple command. In this example, the default route uses a newly installed http://www.aliyun.com/zixun/aggregation/32544.html "> wireless network card Wlan0, and most PCs use standard Ethernet card eth0.
[Root@bigboy tmp]# route add default GW 192.168.1.1 Wlan0
In this example, make sure that the IP address is 192.168.1.1 routing/firewall and wlan0 device in a network!
When you are done, you need to update your/etc/sysconfig/network file to reflect this change. This file will configure your default gateway every time Linux starts.
networking=yeshostname=bigboygateway=192.168.1.1
Note: In a Debian based system, the default gateway is a fixed definition in the file/etc/network/interfaces. See the "Debian/ubuntu Network Configuration" section later in this chapter for more details.
Some people may not want to modify a particular network file, but simply add the route add command to the/etc/rc.d/rc.local script file, which is automatically executed each time it starts.
You can also define a default gateway in the NIC configuration file in the/etc/sysconfig/network-scripts directory, but this is risky if you have multiple network adapters that can cause multiple default gateways to be defined. This can cause connectivity problems. If one of the default gateways does not have a route to the destination, all the packages will be lost. and firewalls block packets with irregular serial numbers and unknown sources, which can also hinder your data flow.