Choose the option that best describes you.

Saturday, 03 February 2007

ip aliasing

IP aliases are incredibly useful for testing and troubleshooting (and virtual hosting too). The other day I needed to add some IP aliases on a FreeBSD machine. I administer FreeBSD servers at work but I am much more familiar with Linux, so I had to look up the syntax.

I found out how to add an alias:
ifconfig rl0 alias 10.0.0.5 netmask 255.255.255.0
...and remove an alias:
ifconfig rl0 -alias 10.0.0.5

This contrasts with the Linux ifconfig syntax for dealing with aliases:
ifconfig eth0:0 10.0.0.5 netmask 255.255.255.0
ifconfig eth0:0 down


Or what I'm usually using-- iproute2 on Linux: (I have really come to love iproute2)
ip addr eth0 add 10.0.0.5/24
ip addr eth0 del 10.0.0.5/24


* unrelated rant #1-- Why the hell are FreeBSD ethernet devices named according to the driver that supports the card? This annoys me, and I don't see the point. I never know what the device might be called unless I happened to have just installed the nic, which is usually not the case.

** unrelated rant #2-- Why the hell is windows so lacking when it comes to ip aliasing? AFAIK, you can configure IP aliases only if the primary address is static. If it is dynamic then you are out of luck.