Via http://ipucu.enderunix.org/view.php?id=369&lang=en
To have multiple IP addresses on 1 NIC, you need to make aliases.
1 | pfexec bash |
Enable an alias:1
2ifconfig $MYNIC plumb
echo "$MYIP $MYHOST $MYHOST.local" >> /etc/hosts
Save nic settings in file:1
2
3HOSTNIC=/etc/hostname.$MYNIC
echo "$MYIP" > $HOSTNIC
echo "netmask $MYSUBMASK broadcast + up" >> $HOSTNIC
Manually set IP:1
ifconfig $MYNIC $MYIP netmask $MYSUBMASK up
Add new route:1
route add $MYNET $MYIP -interface -ifp $MYNIC
Check that your IP is set:1
ifconfig -a $MYNIC