Sunday, December 6, 2009

How to set up (create) an alias ip for an interface in FreeBSD

You can easily set up an alias ip alias for an interface using the command line utility ifconfig .

The bellow command shows how to set an alias ip to the interface rl0.
# ifconfig rl0 192.168.3.1 netmask 255.255.255.255 alias
Substitute rl0 with your desired inteface and 192.168.3.1 with your desires ip.
Now if you want this configuration to be "persistent across boot" then you will need to edit the file /etc/rc.conf to setup persistent ip aliasing option by appending a configuration line, so that next time FreeBSD comes up (after restart/shutdown) it will create alias for you:
Open the file
# vi /etc/rc.conf
Append the following line.
ifconfig_rl0_alias0="inet 192.168.3.1 netmask 255.255.255.255"
replace rl0 and 192.168.3.1 with your desired values.

0 comments:

Post a Comment

 

Labels

Labels