two public ip addresses on one interface

Chuck Swiger cswiger at mac.com
Fri May 25 20:17:40 UTC 2007


On May 25, 2007, at 12:34 PM, Andrei Manescu wrote:
> If I want to put two public IP addresses, with different  
> subnetmasks (my ISP is changing some subnets and for two months I  
> will be able to use two public ip addresses) on the same interface  
> (xl0) my rc.conf shuld look like this:
>
> ifconfig_xl0="inet 84.125.210.108  netmask 255.255.252.0"
> ifconfig_xl0_alias0="inet 81.66.10.36 netmask  
> 255.255.255.255" (this ip address has mask /24 )

If your aliases are part of the same subnet as the "primary" or first  
configured IP, then you want to use the all-1's netmask.  In your  
case, however, the second IP is part of a completely different  
subnet, and you can (and should) use a /24 netmask....

-- 
-Chuck



More information about the freebsd-net mailing list