Hi, I'm going to add an IP alias in FreeBSD, but am unsure how to add a second IP address.
[cmd=]ifconfig re0 ip netmask alias[/cmd]
But with the second IP address, is it
[cmd=]ifconfig re0 ip netmask alias2[/cmd]
?
$ ifconfig re0 192.168.0.1 netmask 255.255.0.0 alias
$ ifconfig re0 192.168.0.2 netmask 255.255.0.0 alias
idownes said:You can use ifconfig as
to add as many aliases as you want, but you'll need to add it to your /etc/rc.conf to make the aliases persist across a reboot as gkontos demonstrated.Code:$ ifconfig re0 192.168.0.1 netmask 255.255.0.0 $ ifconfig re0 192.168.0.2 netmask 255.255.0.0
ifconfig re0 alias <IP_ALIAS-1> netmask <MASK>
ifconfig re0 alias <IP_ALIAS-N> netmask <MASK>
ifconfig re0 -alias <IP_ALIAS_TO_REMOVE>
ipv4_addrs_re0="a.b.c.d/nn"
ipv4_addrs_re0="10.0.0.1/16 192.168.1.101/24 172.31.42.42/24"