Академический Документы
Профессиональный Документы
Культура Документы
Configuration
We will assign two different IPs in addition to the one we have already assigned to our interface
ifcfg-eth0. To create IP alias, we are going to use our default network interface file & then will create
two copies of the file with names ifcfg-eth0:1 & ifcfg-eth0:2
$ cd /etc/sysconfig/network-scripts
$ cp ifcfg-eth0 ifcfg-eth0:1
$ cp ifcfg-eth0 ifcfg-eth0:2
Now, lets open primary network interface i.e. eth0, & see its content
$ vi ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
IPADDR=192.168.1.100
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
HWADDR=32:0A:21:54:ND:6D
We will now configure our other network interfaces, we only need to make changes for DEVICE &
IPADDR for aliasing
$ vi ifcfg-eth0:1
DEVICE=eth0:1
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
IPADDR=192.168.1.110
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
HWADDR=32:0A:21:54:ND:6D
$ vi ifcfg-eth0:2
DEVICE=eth0:2
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
IPADDR=192.168.1.120
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
HWADDR=32:0A:21:54:ND:6D
Visit LinuxTechLab
Save both files & restart the network service for changes to take effect.
$ ifconfig
This completes our tutorial, if you are having any issues/comments, please do mention them in the
comment box below.
If you think we have helped you or just want to support us, please consider these :-
Visit LinuxTechLab