Friday, July 20, 2007

How to setup 2 IP address on One NIC

command as follows:
# ifconfig lnc0 192.168.1.5 netmask 255.255.255.255 alias

B) You can setup this alias in /etc/rc.conf file by appending following text, so that next time FreeBSD comes up (after restart/shutdown) it will create alias for you:
ifconfig_lnc0_alias0=”192.168.1.5 netmask 255.255.255.255″

C)Restart FreeBSD network service using following script:
# /etc/netstart

D) Display alias and real ip using ifconfig lnc0 command:
# ifconfig lnc0
lnc0: flags=8843 mtu 1500
inet6 fe80::20c:29ff:fe01:ddbd%lnc0 prefixlen 64 scopeid 0×1
inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255
inet 192.168.1.5 netmask 0xffff


Read ifconfig man page.