Access hosts of different network segments at the same time
There are two CIDR blocks,
CIDR Block 1: 192.168.1.0/255.255.255.0. Gateway: 192.168.1.1 can be used on the Internet.
CIDR Block:. 19.139.0/255.255.255.0.0. Gateway: 20.19.139.250 can be used with the website of the higher authorities.
Two network topologies:
Topology 1:
One host and two NICs are connected to different networks.
Nic configuration: Note: If you want to access the Internet, you need to configure the gateway.
After configuring this, you can access CIDR Block 1 and access the internet.
Nic 2 configuration: do not need to configure the default gateway. Otherwise, you cannot access the Internet. The reason is that two default gateways are configured for the two NICs, and the default gateway configured later will overwrite the default gateway. The IP package follows the gateway configured in the second step. The Internet cannot be accessed.
In this case, you can ping the host in the same network segment and the gateway 201719.139.250. But cannot access the host of the superior Website: 201719.1.1
Add route:
Route add route 19.0.0 mask route 255.0.0 255.19.139.250
OK. Now you can access 201719.1.1 :)
Topology 2: one network card of a host is connected to two networks with different network segments through a switch.
One Nic is configured with multiple IP addresses.
Add route:
Route add 192.168.1.0 mask 255.255.255.0 192.168.1.1
Route add route 19.0.0 mask 255 .. route 0.0 255.19.139.250