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