- eth0 NIC IP 192.168.1.5
- eth0:0 first NIC alias: 192.168.1.6
Set eth0:0 bằng dòng lệnh với quyền user root
Mã:
# ifconfig eth0:0 192.168.1.6 up
2. Trên linux/ ubuntu
Mã:
# vi /etc/network/interfaces auto eth0:1 iface eth0:1 inet static name Ethernet alias LAN card address 192.168.1.6 netmask 255.255.255.0 broadcast 192.168.1.255 network 192.168.1.0
Mã:
# /etc/init.d/networking restart
Mã:
# cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0
Mã:
# vi /etc/sysconfig/network-scripts/ifcfg-eth0:0 DEVICE=eth0:0 IPADDR=192.168.1.6 NETMASK=255.255.255.0 NETWORK=192.168.1.0 ONBOOT=yes NAME=eth0:0
Mã:
# service network restart
Mã:
# vi /etc/sysconfig/network-scripts/ifcfg-eth0-range0 IPADDR_START=202.54.112.120 IPADDR_END=202.54.112.140 CLONENUM_START=0 NETMASK=255.255.255.0