The company has a SUSELINUX server that requires two networks and one network segment is 192, which is used to go to the OP management platform system. One is B network, and the network segment is 202, which is used for Internet access. We all know that it is impossible for a computer to have two gateways, because the default gateway only...
The company has an suse linux server that requires two networks and one CIDR block is 192, which is used to go to the OP management platform system. One is B network, and the network segment is 202, which is used for Internet access. We all know that it is impossible for a computer to have two gateways, because the default gateway can only be one. If the Gateway and DNS are frequently switched to implement the Internet access and the OP management platform system, it will cause great inconvenience to the work, so I used a soft route to achieve dual-network card dual gateway to achieve simultaneous Internet access and OP management platform system.
The specific operations are as follows:
1. edit the Nic configuration file:
Open the Nic configuration file in the vi editor and perform the following configuration:
(1)/etc/sysconfig/network/ifcfg-eth-id-68: b5: 99: 76: 83: a2 #192 network segment connection OP management platform system
DEVICE = "eth0"
BOOTPROTO = "no"
IPADDR = "192.168.192.10"
NETMASK = "255.255.255.0"
ONBOOT = "yes"
(2)/etc/sysconfig/network/ifcfg-eth-id-68: b5: 99: 76: 83: a4 #202 network segment connection to the Internet
DEVICE = "eth1"
BOOTPROTO = "no"
IPADDR = "202.106.128.204"
NETMASK = "255.255.255.255.248"
GATEWAY = "202.106.128.206"
ONBOOT = "yes"
2. the Two gateways are 192.168.192.1 and 202.106.128.206, respectively.
Vi/etc/sysconfig/network/routes
Add a soft route:
192.168.192.0 192.168.192.1 255.255.255.0 eth0
Then wq is saved and exited.
Or directly enter the command
# Route add-net 192.168.192.0/24 gw 192.168.192.1 dev eth0
Always # rcnetwork restart (restart network service)
Then # netstat-rn to view the new route entries.
Now, you can access the Internet and the OP management platform!
Author: "dripping water and stone"