Environment: for Ubuntu, assume that the Intranet IP address is 10.35.0.58, the Intranet gateway is 10.35.0.254, the Internet IP address is 222.76.250.4, and the Internet gateway is 222.76.250.1. the LAN must be connected to 10.35.0.X, 10.35.51.X, and 10.35.60.X. 1. when the server is configured as an Internet IP address and an Intranet IP address, only the gateway of the Internet IP address is set. Do not set the gateway of the Intranet IP address. the operation is as follows: sudo
Environment: Ubuntu System
Assume that the Intranet IP address is 10.35.0.58, the Intranet gateway is 10.35.0.254, the Internet IP address is listen, and the Internet gateway is 222.76.250.1. The lan must be connected to 10.35.0.X, 10.35.51.X, and 10.35.60.X.
1. When the server is configured as an Internet IP address and an Intranet IP address, only the gateway of the Internet IP address is set. Do not set the gateway of the Intranet IP address.
The procedure is as follows:
Sudo nano/etc/network/interfaces
Run the following command to open the network configuration file:
Auto eth0
Iface eth0 inet static
Address 10.35.0.58
Netmask 255.255.255.0
Iface eth1 inet static
Address 222.76.250.4
Netmask has been released successfully
Gateway 222.76.250.1
Auto eth1
Note:
We didn't set gateway for eth0 (internal network). After the modification is complete, we use Ctrl + O to save the modification, and then press Ctrl + X to exit the editor.
2. At this time, we restart the network. The command for restarting the network of Ubuntu is:
Sudo/etc/init. d/networking restart
3. Because no intranet gateway is set, we cannot connect to the server using tools such as SecureCRT. To solve this problem, we need to set the server route as follows:
Sudo route add-net 10.35.0.0/24 gw 10.35.0.254 dev eth0
Sudo route add-net 10.35.51.0/24 gw 10.35.0.254 dev eth0
Sudo route add-net 10.35.60.0/24 gw 10.35.0.254 dev eth0
The preceding commands are 10.35.0.X, 10.35.51.X, and 10.35.60.X respectively. If the Internet cannot be connected, try:
Sudo route add default gw 222.76.250.4 dev eth1