On Monday 26 November 2007, Dan Farrell wrote:
> you don't have to list the broadcast or netmask, if they can be
> guessed from context. In the case of using a 192.168.x/24 network
> they can generally both be guessed properly, because that's a Class C
> private address .
>
> However, in the case of 10.0.0/24, this may not be true. that is
> defined as class A private address space, and the networking utilities
> would probably assume it was 10.0.0/8, a netmask of 255.0.0.0 and a
> broadcast of 10.255.255.255. That is what ifconfig does at least:
>
> pascal ~ # ifconfig eth0:1 10.0.0.1
> pascal ~ # ifconfig eth0:1
> eth0:1 Link encap:Ethernet HWaddr 00:50:70:56:2E:CA
> inet addr:10.0.0.1 Bcast:10.255.255.255 Mask:255.0.0.0
> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
> Interrupt:225 Base address:0xc000
That is what ifconfig does, if you don't specify a netmask:
[EMAIL PROTECTED] /x]# ifconfig eth0:1 10.0.0.1 netmask 255.255.255.0
[EMAIL PROTECTED] /x]# ifconfig eth0:1
eth0:1 Link encap:Ethernet HWaddr 00:11:2F:BB:F6:0D
inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:17
I don't know exactly how initscripts work, but I suppose that if the /24
is given in /etc/conf.d/net, then both the resulting iproute2 and
ifconfig command that bring the interface up will include the netmask
specification.
--
[EMAIL PROTECTED] mailing list