Setting up ip aliases in freebsd
Often times in a server environment your going to need to setup multiple ip addresses to the same ethernet card, it’s really a simple procedure, and the way that I generally do these things is create a file called /etc/rc.aliases and include the alias line in there:
If the IP is on the same netmask:
/sbin/ifconfig fxp0 alias 192.0.3.9 netmask 255.255.255.255
Otherwise, just specify the network address and netmask as usual:
/sbin/ifconfig fxp0 alias 172.16.0.223 netmask 255.255.255.0
once you’ve added each line, then add a line in the /etc/rc.local file
sh /etc/rc.aliases
This way when you want to edit the aliases on each server you have them all in one location.
soy said,
November 8, 2005 @ 2:33 pm
Hmm. It sounds like “assing multiple IP addresses” might hurt, though. (Editors Note: this has been fixed)