On Fri, May 05, 2006 at 09:28:25AM +0200, Martin Man wrote:
<SNIP!>
> I've yesterday played with virtual interfaces and I have tried to simply
> 
> # ifconfig plumb bge0:1

I think you meant "bge0:1 plumb".

> # ifconfig bge0:1 192.168.1.1
> # ifconfig bge0 up
> 
> later on some strange things started to happen and some connect(2) 
> started to fail, and only today I have realized that my routing table 
> looks like this (snipped irrelevant entries)
> 
> # netstat -nr
> 
> Routing Table: IPv4
>   Destination           Gateway           Flags  Ref   Use   Interface
> -------------------- -------------------- ----- ----- ------ ---------
> 192.0.0.0            192.168.1.1          U         1     16  bge0:1

Add -v also (i.e. "netstat -rnv") to see the explicit contents of the
netmask.

> As you can see, netmask used to route to 192.168.1.0 network was picked 
> up automatically to be 255.0.0.0, which, being an A netmask seems 
> inappropriate for C network.
> 
> Is this a bug, or feature? I'd assume ifconfig can detect the default 
> netmask for A,B,C networks unlesse explicit netmask is specified.

I tried this same experiment on my machine, and it did the right thing (/24
prefix).  Do you have /etc/netmasks on your machine (or even NIS or LDAP
map)?  That can override default behaviors.

You can also specify the prefix length explicitly (e.g. 192.168.1.1/24), and
override even /etc/netmasks.

Dan
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to