How do I bind additional IPs to a Freebsd server?

To bind IPs to your FreeBSD server:

Open /etc/rc.conf with your editor:

# vi /etc/rc.conf

You should see a line which looks like this:

ifconfig_fxp0=”inet 66.96.xx.10 netmask 255.255.255.255″

where 66.96.xx.10 is the main ip address of your server.

Directly under it add this
ifconfig_fxp0_alias0=”inet 66.96.xx.11 netmask 255.255.255.255″

Change 66.96.xx.11 to whatever your additional IP is.

If you have more then one additional IPs increase the number after alias for each ip
example:

ifconfig_fxp0_alias0=”inet 66.96.xx.11 netmask 255.255.255.255″
ifconfig_fxp0_alias1=”inet 66.96.xx.12 netmask 255.255.255.255″
ifconfig_fxp0_alias2=”inet 66.96.xx.13 netmask 255.255.255.255″
ifconfig_fxp0_alias3=”inet 66.96.xx.14 netmask 255.255.255.255″
ifconfig_fxp0_alias4=”inet 66.96.xx.15 netmask 255.255.255.255″
ifconfig_fxp0_alias5=”inet 66.96.xx.16 netmask 255.255.255.255″
ifconfig_fxp0_alias6=”inet 66.96.xx.17 netmask 255.255.255.255″
ifconfig_fxp0_alias7=”inet 66.96.xx.18 netmask 255.255.255.255″

etc…

Save the file and run /etc/netstart

#/etc/netstart

Thats it!

Share on Twitter
Share on Facebook