Not long ago, in the lab, because the internal Lan had 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, and 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 by one. Recently, in the lab, because the internal lan has an IP address of 192.168.1.0, if you want to connect to the Internet, you need to change the IP address to the CIDR Block 172.16.20.0. The IP address range 192.168.1.0 can access the FTP address of the instructor and the IP address range 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.