home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.protocols.tcp-ip      TCP and IP network protocols.      14,669 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 13,196 of 14,669   
   Pascal Hambourg to All   
   Re: Configuring the TCP/IP stack in real   
   17 Nov 09 17:54:02   
   
   XPost: comp.os.linux.networking   
   From: boite-a-spam@plouf.fr.eu.org   
      
   Jorgen Grahn a écrit :   
   > On Sun, 2009-11-15, Rob Warnock wrote:   
   >>   
   >>     ifconfig eth0 10.2.3.4 netmask 255.255.255.192   
   >>   
   >> then the broadcast address came up with 10.255.255.255, which is   
   >> *definitely* the wrong value!! That is, it looked only at the   
   >> Class A nature of 10.2.3.4 and ignored the netmask.   
   [...]   
   > But this looks correct, doesn't it?   
   >   
   >   tuva:/home/grahn# ifconfig eth0:1 10.2.3.4 netmask 255.255.255.192   
   >   tuva:/home/grahn# ifconfig eth0:1   
   >   eth0:1    Link encap:Ethernet  HWaddr 00:0d:93:60:7e:78   
   >             inet addr:10.2.3.4  Bcast:10.2.3.63  Mask:255.255.255.192   
   >             UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1   
   >             Interrupt:41 Base address:0xa400   
   >   
   >   tuva:/home/grahn# ifconfig --version   
   >   net-tools 1.60   
   >   ifconfig 1.42 (2001-04-13)   
      
   Don't just trust what ifconfig prints, check the actual broadcast routes   
   in the "local" routing table :   
      
   # ip route show table local type broadcast dev eth0   
   broadcast 10.2.3.63  proto kernel  scope link  src 10.2.3.4   
   broadcast 10.2.3.0  proto kernel  scope link  src 10.2.3.4   
   broadcast 10.255.255.255  proto kernel  scope link  src 10.2.3.4   
      
   Notes :   
   1) 10.2.3.0 is the old-style "all zeroes" subnet-directed broadcast   
   address still present for legacy purposes. It is correct with respect to   
   the netmask.   
      
   2) There are two "all ones" broadcast addresses. 10.2.3.63 is the   
   expected subnet-directed broadcast address and 10.255.255.255 is the now   
   deprecated all-subnets-directed broadcast address. The all-subnets   
   concept is meaningless in a classless environnment.   
      
   3) This is what I get with a Linux 2.4 recent version (2.4.36.6) or an   
   old 2.6 version (2.6.8). With a more recent Linux 2.6 version (2.6.20)   
   and the same ifconfig 1.42 from net-tools 1.60 version, 10.255.255.255   
   is not present. So I guess the fix was made in the Linux 2.6 kernel   
   between versions 2.6.9 and 2.6.20, not in ifconfig.   
      
   >   tuva:/home/grahn# ifconfig eth0:1 10.2.3.4/27   
   >   tuva:/home/grahn# ifconfig eth0:1   
   >   eth0:1    Link encap:Ethernet  HWaddr 00:0d:93:60:7e:78   
   >             inet addr:10.2.3.4  Bcast:10.2.3.31  Mask:255.255.255.224   
      
   Here things become strange. If the interface has no address and mask   
   yet, I get an error :   
      
   # ifconfig eth0 10.2.3.4/27   
   SIOCSIFNETMASK: Cannot assign requested address   
      
   # ifconfig eth0   
   eth0      Link encap:Ethernet  HWaddr 52:54:05:DE:25:90   
             inet addr:10.2.3.4  Bcast:10.255.255.255  Mask:255.0.0.0   
      
   It looks like ifconfig did not handle the CIDR notation properly and the   
   default classful mask was used.   
      
   If I run the same command again then there is no error, and the mask and   
   broadcast addresses are correct.   
      
   I personnally prefer the "ip" command from iproute over ifconfig and route.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca