ifconfig eth0:0 192.168.1.123
NOTE: This creates a new virtual network interface based on original eth0 physical interface.
The only most important condition for creating the virtual network interface is the physical network interface, as in our case eth0 must exists.
ifconfig eth0
returns:
eth0 Link encap:Ethernet HWaddr 3c:97:0e:02:98:c8 inet addr:192.168.1.69 Bcast:192.168.1.255 Mask:255.255.255.0
ping 192.168.1.69
returns:
PING 192.168.1.69 (192.168.1.69) 56(84) bytes of data. 64 bytes from 192.168.1.69: icmp_seq=1 ttl=64 time=0.024 ms 64 bytes from 192.168.1.69: icmp_seq=2 ttl=64 time=0.030 ms 64 bytes from 192.168.1.69: icmp_seq=3 ttl=64 time=0.024 ms 64 bytes from 192.168.1.69: icmp_seq=4 ttl=64 time=0.026 ms 64 bytes from 192.168.1.69: icmp_seq=5 ttl=64 time=0.021 ms --- 192.168.1.69 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4090ms rtt min/avg/max/mdev = 0.021/0.025/0.030/0.003 ms
ifconfig eth0:0
returns:
eth0:0 Link encap:Ethernet HWaddr 3c:97:0e:02:98:c8 UP BROADCAST MULTICAST MTU:1500 Metric:1 Interrupt:20 Memory:f1600000-f1620000
ifconfig eth0:0 192.168.1.123
ifconfig eth0:0
returns:
eth0:0 Link encap:Ethernet HWaddr 3c:97:0e:02:98:c8 inet addr:192.168.1.123 Bcast:192.255.255.255 Mask:255.0.0.0
ping 192.168.1.123
returns:
PING 192.168.1.123 (192.168.1.123) 56(84) bytes of data. 64 bytes from 192.168.1.123: icmp_req=1 ttl=64 time=0.060 ms 64 bytes from 192.168.1.123: icmp_req=2 ttl=64 time=0.057 ms