Gentoo Archives: gentoo-user

From: Etaoin Shrdlu <shrdlu@×××××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: static IP, gateway and netmask setting
Date: Wed, 28 Nov 2007 21:06:21
Message-Id: 200711282156.15052.shrdlu@unlimitedmail.org
In Reply to: Re: [gentoo-user] Re: static IP, gateway and netmask setting by Dan Farrell
1 On Wednesday 28 November 2007, Dan Farrell wrote:
2
3 > How the net init script works (there's really only one, generally
4 > net.* is linked to net.lo for update simplicity)
5
6 That script only calls functions defined elsewhere. The hard (and
7 module-dependent) work is done by the files located
8 in /lib/rcscripts/net. In particular, /lib/rcscripts/net/iproute2.sh
9 and /lib/rcscripts/net/ifconfig.sh define all the various *_up(),
10 *_down(), *_add_address(), etc. functions that are invoked by net.lo.
11
12 > /etc/conf.d/net.example holds examples for just
13 > about every imaginable configuration, but from my net, iproute2 looks
14 > something like:
15 >
16 > modules=("iproute2");
17 > config_eth0=( "192.168.1.87/24 brd 192.168.1.255");
18 > routes_eth0=( "default via 192.168.1.1" );
19 > config_eth1=( "192.168.1.88/24 brd 192.168.1.255" );
20 >
21 > but as you can see, that still doesn't set up a netmask but uses the
22 > default.
23
24 What I see is that you are explicitly specifying the netmask. The /24 in
25 your lines specifies the netmask. Even if you didn't, in your case
26 things would probably still work, because iproute2 would probably use a
27 class C netmask, which is also /24. But nonetheless you are not
28 using "the default" (whatever this means), but are instead explicitly
29 specifying a netmask.
30
31 > I agree that in both cases the default would be /8 for a
32 > 10.xxx network, but as you can see the config syntax is different for
33 > iproute2 and ifconfig.
34
35 As I understand it, the syntax is exactly the same. What is different are
36 the commands that are run behind the scenes to configure the interfaces,
37 and these depend on the module you choose (iproute2 or ifconfig). In
38 other words, if you substituted modules=("iproute2") with
39 modules=("ifconfig") in your etc/conf.d/net, everything would still work
40 as expected.
41 The lack of a netmask specification will result in the tool used for the
42 configuration (ifconfig or iproute2) doing whatever is appropriate for
43 it: usually, this would just mean "use the default classful netmask",
44 --
45 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Re: static IP, gateway and netmask setting Dan Farrell <dan@×××××××××.cx>