In the lab, because the internal lan has the IP address of the network segment 192.168.1.0, if you want to connect to the Internet, you need to change the IP address to the network segment 172.16.20.0. The network segment 192.168.1.0 can access the instructor's FTP, 172.16.20.0 can access the Internet. I need to use both CIDR blocks. It is very troublesome to set them. Therefore, bind the NIC to multiple IP addresses. In RHEL, there are two ways to bind multiple IP addresses. One is to manually add one IP address at a time, and the other is to add multiple IP addresses at a time.
In the lab, because the internal lan has the IP address of the network segment 192.168.1.0, if you want to connect to the Internet, you need to change the IP address to the network segment 172.16.20.0. The network segment 192.168.1.0 can access the instructor's FTP, 172.16.20.0 can access the Internet.
I need to use both CIDR blocks. It is very troublesome to set them. Therefore, bind the NIC to multiple IP addresses.
In RHEL, there are two ways to bind multiple IP addresses. One is to manually add one IP address at a time, and the other is to add multiple IP addresses at a time.
First, let's talk about the first one:
My habit is to explain everything:
[Root @ localhost network-scripts] # vi ifcfg-eth0: 0
Change the DEVICE to the eth0: 0 IP address.
In this way, you can use two IP addresses at the same time.
If you need more than two IP addresses, creating a ifcfg-eth0 one by one: x Files is troublesome. RHEL provides the batch addition method: