Setup 2 or More IP address on One NIC
# ifconfig se0 inet 192.168.X.X netmask 255.255.255.255 alias
To have this IP alias loaded after reboot then edit and add the following line to /etc/rc.conf
Code:
Quote:
# ifconfig_se0_alias0=”inet 192.168.X.X netmask 255.255.255.255″
To remove the IP address:
Code:
Quote:
# ifconfig se0 inet 192.168.X.X -alias
Finally, Restart FreeBSD network service using network restart script:
# /etc/rc.d/netif restart && /etc/rc.d/routing restart
Display alias and real ip using ifconfig se0 command:
# ifconfig se0
here is the example rc.conf
hostname=”static.pearlin.info”
# default router interface
defaultrouter=”10.10.1.1″
ifconfig_em0=”inet 10.10.1.2 netmask 255.255.255.0″
ifconfig_em0_alias0=”inet 10.10.1.3 netmask 255.255.255.0″
ifconfig_em0_alias1=”inet 10.10.1.4 netmask 255.255.255.0″
ifconfig_em0_alias2=”inet 10.10.1.5 netmask 255.255.255.0
Finally, restart network service using network restart script:
# /etc/rc.d/netif restart && /etc/rc.d/routing restart