Adding additional IP's

As it turns out, I have been assigned 5 ip addresses for my machine, of which only one was originally assigned to the box. Not wanting to screw the machine up, I wanted to run it by here first on the process of adding the additional IP's.

Here is the current snippet from the /etc/rc.conf file:

Code:
ifconfig_re0="inet 64.150.176.124 netmask 255.255.255.0"

I would assume that to add an additional IP address I would only have to add an additional line such as:

Code:
ifconfig_re1="inet 64.150.176.xxx netmask 255.255.255.0"

If that is not correct, I would appreciate someone pointing me in the right direction.
 
dpalme said:
If that is not correct, I would appreciate someone pointing me in the right direction.

Code:
ifconfig_re0_alias0="inet 64.150.176.xxx netmask 255.255.255.255"
ifconfig_re0_alias1="inet 64.150.176.xxy netmask 255.255.255.255"

Note the netmask.
 
There is also a new syntax for adding a range of addresses to a single interface:

ipv4_addrs_em0="192.168.0.1-5/24"

This would assign the following addresses to em0:

192.168.0.1/24
192.168.0.2/32
192.168.0.3/32
192.168.0.4/32
192.168.0.5/32

The first address in the range gets the specified /24 netmask. All the other addresses get the non-conflicting /32 mask.
 
I should say that syntax is for rc.conf and is available in 7.x. I don't know when it was introduced so if you're using an older version it might not work.

(Can't edit our own posts on these forums?)
 
dpalme said:
If they are part of a different subnet, IE: 69.64.92 do I still make the subnet mask the same?
No, then you assign the first IP in the new subnet its normal netmask. Subsequent IPs in that same subnet will be /32 again.
 
Here is what I added to the /etc/rc.conf file:

Code:
ifconfig_re0="inet 64.150.176.124 netmask 255.255.255.0"
ifconfig_re0_alias0="inet 69.64.92.88 netmask 255.255.255.0"
ifconfig_re0_alias1="inet 69.64.92.89 netmask 255.255.255.255"
ipconfig_re0_alias2="inet 69.64.92.90 netmask 255.255.255.255"
ipconfig_re0_alias3="inet 69.64.92.91 netmask 255.255.255.255"
ipconfig_re0_alias4="inet 69.64.92.92 netmask 255.255.255.255"

the first aliased IP is reachable and works, the others I get no response from.
 
Check the output of "ifconfig re0" to confirm the interface's configuration.

Also try run tcpdump on re0 to ensure the ISP is definitely routing traffic to those addresses to you.
 
ifconfig only reports the primary IP along with the first two aliased. that is all.
Code:
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
	ether 00:16:17:91:6a:8c
	inet 64.150.176.124 netmask 0xffffff00 broadcast 64.150.176.255
	inet 69.64.92.88 netmask 0xffffff00 broadcast 69.64.92.255
	inet 69.64.92.89 netmask 0xffffffff broadcast 69.64.92.89
	media: Ethernet autoselect (100baseTX <full-duplex>)
	status: active
 
Over here, all three of those addresses are pingable. Go ahead and add the remaining aliases:

Code:
ifconfig re0 inet 69.64.92.90/32 alias
ifconfig re0 inet 69.64.92.91/32 alias
ifconfig re0 inet 69.64.92.92/32 alias
 
Ok this is weird, I deleted the aliases and added them back one at a time and they are now reachable. When I added them at the same time they were not.

Thanks for the help
 
Yeah you are right, I caught it and fixed it, and then you posted......

:) Nice find, although I never should have missed that. Stupid stupid mistake.

Thanks for the help though, it is greatly appreciated.

Douglas
 
Back
Top