Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 May 1999 10:57:03 -0600 (MDT)
From:      "Aaron D. Gifford" <agifford@infowest.com>
To:        freebsd-isp@freebsd.org
Subject:   Re: Re: ifconfig alias number 2
Message-ID:  <19990521165703.87C5D20F43@infowest.com>

next in thread | raw e-mail | index | archive | help
Riger Marquis wrote:
>> >         I am trying to add an ip alias on my fbsd 3.1 box (ifconfig de0
>> > inet 216.61.218.6 netmask 255.255.255.0 alias)  
>> 
>> Wrong netmask use 255.255.255.255
>
>Why would you use a different netmask on your secondary interfaces (/32
>vs. /24), assuming they're all on the same subnet?  
>
>Is this just a workaround to avoid having to set the route explicitly?

If the interface is already configured with an IP (not an alias IP) for
the interface, a route already exists for the /24 subnet via this IP so
adding aliases should use the /32 netmask.

Examples:

# Primary IP for interface:
# (This adds 10.60.24.0/24 as a directly connected network)
ifconfig if0 inet 10.60.24.12 netmask 255.255.255.0
# Alias IP for interface:
# (use the all-ones netmask because the system already knows
# this network is directly connected)
ifconfig if0 inet 10.60.24.13 netmask 255.255.255.255 alias
# Alias IP for a separate logical network on the same physical interface:
# (DON'T use the all-ones netmask because we want the system to know
# that this network is directly connected)
ifconfig if0 inet 10.60.44.50 netmask 255.255.255.0 alias
# And anoter alias IP:
# (Again use the all-ones netmask)
ifconfig if0 inet 10.60.44.51 netmask 255.255.255.255 alias

Aaron out.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990521165703.87C5D20F43>