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"