Gentoo Archives: gentoo-user

From: Walter Dnes <waltdnes@××××××××.org>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: [SOLVED] What happened to my 2nd eth0?
Date: Mon, 23 Feb 2015 08:39:53
Message-Id: 20150223083942.GA5629@waltdnes.org
In Reply to: Re: [gentoo-user] What happened to my 2nd eth0? by Mick
1 On Sun, Feb 22, 2015 at 09:01:47AM +0000, Mick wrote
2 > On Sunday 22 Feb 2015 04:52:34 Walter Dnes wrote:
3 > > My DSL router modem is at 192.168.123.254. I have an HDHomerun
4 > > network TV tuner that insists on coming up somewhere in the 169.254.X.Y
5 > > block. Up until upgrading from 32 to 64 bits, I was able to see a 2nd
6 > > eth0 (i.e. eth0:1) using the following /etc/conf.d/net setup...
7 > >
8 > > config_eth0="
9 > > 192.168.123.251/29 broadcast 192.168.123.255
10 > > 169.254.1.1/16 broadcast 169.254.255.255"
11 >
12 > Is there a reason you need to define a broadcast if you are using CIDR
13 > notation?
14
15 I've always done it that way. At one time I had a router that could
16 be made to send logs to a specified IP address. By setting their
17 broadcast addresses to 192.168.123.255, and having the router log to
18 that address, I could make both of my machines pick up the remote logs
19 from the router.
20
21 > > routes_eth0="
22 > > default via 192.168.123.254 metric 20
23 > > 192.168.123.248/29 via 192.168.123.254 metric 0
24 >
25 > Isn't the above redundant if you have defined an identical default route?
26 >
27 > > 169.254.0.0/16 via 169.254.1.1 metric 0"
28
29 Another item that stopped working a while ago...
30
31 I have a dialup connection for emergency backup use. Before the
32 format of the /etc/conf.d/net file changed, I could simultaneously...
33
34 * have eth0 as default route with "expensive metric" 20
35 * have ppp0 take over when dialup is active, with a "cheaper metric"
36 * still be able to have my 2 machines talk to each other over eth0, even
37 while the dialup connection ppp0 is active
38 * have eth0 take over again as default route when ppp0 drops
39
40 > Unless you have set up:
41 >
42 > modules="!iproute2"
43 >
44 > netifrc will not use ifconfig.
45
46 I've noticed iproute2 showing up recently in emerge. ***YES IT
47 WORKS***. Thank you very much. I am now getting OTA TV to my desktop
48 again. Slight modification. Using that search string in Google, I
49 found http://www.michaeldolan.com/Tutorials/Downloads/conf.d/net
50
51 My revised /etc/conf.d/net script is
52
53 modules=( "!iproute2" )
54 config_eth0="
55 192.168.123.251/29 broadcast 192.168.123.255
56 169.254.1.1/16 broadcast 169.254.255.255"
57 routes_eth0="
58 default via 192.168.123.254 metric 20
59 192.168.123.248/29 via 192.168.123.254 metric 0
60 169.254.0.0/16 via 169.254.1.1 metric 0"
61
62 edit... I finally found the documentation (see below). I still have to
63 fix up the "metric" and "broadcast" parameters. For now, I'm happy to
64 have the TV signal coming to my desktop.
65
66 ...and "ifconfig" returns...
67
68 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
69 inet 192.168.123.251 netmask 255.255.255.248 broadcast 192.168.123.255
70 ether 00:1d:09:96:6c:1c txqueuelen 1000 (Ethernet)
71 RX packets 1049019 bytes 1501104544 (1.3 GiB)
72 RX errors 0 dropped 5 overruns 0 frame 0
73 TX packets 569447 bytes 45295143 (43.1 MiB)
74 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
75 device interrupt 20 memory 0xfdfc0000-fdfe0000
76
77 eth0:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
78 inet 169.254.1.1 netmask 255.255.0.0 broadcast 169.254.255.255
79 ether 00:1d:09:96:6c:1c txqueuelen 1000 (Ethernet)
80 device interrupt 20 memory 0xfdfc0000-fdfe0000
81
82 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
83 inet 127.0.0.1 netmask 255.0.0.0
84 loop txqueuelen 0 (Local Loopback)
85 RX packets 8 bytes 480 (480.0 B)
86 RX errors 0 dropped 0 overruns 0 frame 0
87 TX packets 8 bytes 480 (480.0 B)
88 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
89
90 I would have appreciated a news item telling me that /etc/conf.d/net
91 was going to change default behaviour, before it happened and caused
92 breakage on my system. Or did it happen, and I missed it?
93
94 > CONFIG_IP_MULTIPLE_TABLES=y
95
96 I do not have that option available it in my current kernel, or in the
97 backup from before I switched from 32-bit to 64-bit mode. Not that it
98 matters, now that I have things working.
99
100
101 Given that iproute2 is now the default, I assume that ifconfig will be
102 dropped sometime down the road. Documentation "could be better". At
103 the top of /etc/conf.d/net I see...
104 # This blank configuration will automatically use DHCP for any net.*
105 # scripts in /etc/init.d. To create a more complete configuration,
106 # please review /etc/conf.d/net.example and save your configuration
107 # in /etc/conf.d/net (this file :]!).
108
109 # Actually /usr/share/doc/openrc-<version>/net.example is where to look
110 # for example setup.
111
112 Guess what... neither of those example files exist. It's actually
113 /usr/share/doc/netifrc-<version>/net.example.bz2 (Where would I be
114 without Google?) Also using Google, I found
115 http://www.policyrouting.org/iproute2.doc.html which is quite complex.
116 Looks like it's time to play around with the "ip" command and try to
117 duplicate my current setup. Does anyone have a multi-route setup
118 similar to mine configured with iproute2? The net.example file says
119
120 # If you need more than one address, you can use something like this
121 # NOTE: ifconfig creates an aliased device for each extra IPv4 address
122 # (eth0:1, eth0:2, etc)
123 # iproute2 does not do this as there is no need to
124 # WARNING: You cannot mix multiple addresses on a line with other parameters!
125 #config_eth0="192.168.0.2/24 192.168.0.3/24 192.168.0.4/24"
126 # However, that only works with CIDR addresses, so you can't use
127 # netmask.
128
129 What exactly do they mean by...
130 "iproute2 does not do this as there is no need to"
131
132 --
133 Walter Dnes <waltdnes@××××××××.org>
134 I don't run "desktop environments"; I run useful applications

Replies

Subject Author
Re: [gentoo-user] Re: [SOLVED] What happened to my 2nd eth0? Mick <michaelkintzios@×××××.com>