Query all interface information
ifconfig -a
lo0: flags=2001000849
inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843
inet 192.168.1.1 netmask ffffff00 broadcast 192.168.1.255
ether 0:c:29:21:12:f5
Plumb all interfaces
bash-3.2# ifconfig -a plumb
ifconfig: SIOCSLIFNAME for ip: e1000g0: already exists
bash-3.2#
Query again and you will see newly added network interface
bash-3.2# ifconfig -a
lo0: flags=2001000849
inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843
inet 192.168.1.1 netmask ffffff00 broadcast 192.168.1.255
ether 0:c:29:21:12:f5
e1000g1: flags=1000842
inet 0.0.0.0 netmask 0
ether 0:c:29:21:12:ff
bash-3.2#
Configure new interface
bash-3.2# ifconfig e1000g1 10.10.10.1 netmask 255.255.255.0 up
bash-3.2# ifconfig -a
lo0: flags=2001000849
inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843
inet 192.168.1.1 netmask ffffff00 broadcast 192.168.1.255
ether 0:c:29:21:12:f5
e1000g1: flags=1000843
inet 10.10.10.1 netmask ffffff00 broadcast 10.10.10.255
ether 0:c:29:21:12:ff
==========================================================
Make changes permanent
bash-3.2# ls -ltr /etc/hostname*
-rw-r--r-- 1 root root 9 Jan 31 06:12 /etc/hostname.e1000g0
Create file for new interface e1000g1
bash-3.2# gedit /etc/hostname.e1000g1
bash-3.2# ls -ltr /etc/hostname*
-rw-r--r-- 1 root root 9 Jan 31 06:12 /etc/hostname.e1000g0
-rw-r--r-- 1 root root 14 Jan 31 06:46 /etc/hostname.e1000g1
reboot machine
bash-3.2# reboot
No comments:
Post a Comment