Gentoo Archives: gentoo-dev

From: Kazutomo Yoshii <kazutomo@××××××××××××××××.com>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] nameif in gentoo init?
Date: Wed, 05 May 2004 08:33:28
Message-Id: 4098A6A9.30001@mountainviewdata.com
1 Hi,
2
3 Some of my machines have two more network interfaces.
4 So I just wanted to use nameif like rh.
5
6 Is it possible to add nameif support to Gentoo init?
7
8 eth0ext Link encap:Ethernet HWaddr 00:20:ED:17:02:A7
9 inet addr:192.168.1.80 Bcast:192.168.1.255 Mask:255.255.255.0
10 ....
11
12 eth1local Link encap:Ethernet HWaddr 00:D0:B7:22:1B:47
13 inet addr:192.168.1.79 Bcast:192.168.1.255 Mask:255.255.255.0
14 ....
15
16 I was not sure that gentoo has similar functionality.
17 So I just hacked my gentoo.
18 If there is another good way, please tell me.
19 I'm also not sure whether other service uses default
20 name(eth[0-9]) or not.
21
22
23 Here is my hack (quiet simple :->)
24
25 1. (very) small fix to /etc/init.d/modules
26 see modules.patch below
27
28 2. write /etc/mactab like
29
30 eth0extern 00:20:ED:17:02:A7
31 eth1local 00:D0:B7:22:1B:47
32
33 * I think that integrating to /etc/init.d/modules is more better
34
35 3. re-edit /etc/conf.d/net like
36 (removed old eth0 setting)
37
38 iface_eth0extern="192.168.1.80 broadcast 192.168.1.255 netmask 255.255.255.0"
39 iface_eth1local="192.168.1.79 broadcast 192.168.1.255 netmask 255.255.255.0"
40 gateway="eth0extern/192.168.1.111"
41
42 4. changed net.*
43
44 # rc-update del net.eth0
45 # cd /etc/init.d/
46 # mv net.eth0 net.eth0extern (*1)
47 # ln -s net.eth0extern net.ext1local
48 # rc-update add net.eth0extern
49 # rc-update add net.eth0local
50
51 *1 : I guess this is not good idea for gentoo.
52 next baselayout update writes net.eth0 again
53
54 5. rebooting
55
56 ---------------------------------------
57
58 [modules.patch] (for baselayout-1.8.11)
59
60 --- modules.orig 2004-05-05 00:52:29.129647256 -0700
61 +++ modules 2004-05-05 00:41:07.000000000 -0700
62 @@ -121,6 +121,14 @@
63 then
64 modprobe -a -t boot \* &>/dev/null
65 fi
66 +
67 + #
68 + # set network alias if /etc/mactab exists
69 + #
70 + if [ -f /etc/mactab ] ;
71 + then
72 + /sbin/nameif -s
73 + fi
74 }
75
76
77 --
78 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] nameif in gentoo init? Ciaran McCreesh <ciaranm@g.o>
Re: [gentoo-dev] nameif in gentoo init? Greg KH <gregkh@g.o>