My pleasure as always. (and it's pretty much my reason to exist)
To understand why that happened, the DHCP in Gentoo uses that nomenclature by default. Set up eth0 and eth1 statically, add those udev rules and you'll be grooving.
https://wiki.gentoo.org/wiki/Handbook:A ... Networking
I find the Gentoo wikis go blahdee blahdaa blahdoo, but don't make it clear exactly what you want to do (and/or make what you want to do clear). So I'll summarize what I did.
Using OpenRC's Netifrc, I think, is the simplest, most old school method. I am assuming that you are using OpenRC and not systemd (It would depend on what stage3 tarball you chose). This is probably the same rc mechanism you're already using with OpenRC, only with DHCP.
Here's something pissing me off. I can't even find the exact wiki page I used to configure mine. Remember where I said the example was the exact settings for this box (192.168.0.2 etc.). Well I can't find that page again
This is actually more complete and probably more modern. It takes both syntax for subnet, either 255.255.255.0 or /24 syntax and I doubt you'd really need to specify broadcast (brd) for a simple network like a home class 3.
https://wiki.gentoo.org/wiki/Netifrc
I just have one NIC, but we can easily extend this shit to eth0 and eth1. However, that does mean that this dual config is untested by me. Logically, this is how it should work. I don't know what your eth1 network is (perhaps different IP network and route) but you will.
You're going to say things like this in /etc/conf.d/net
Code: Select all
config_eth0="192.168.0.2 netmask 255.255.255.0 brd 192.168.0.255"
routes_eth0="default via 192.168.0.1"
config_eth1="192.168.0.3 netmask 255.255.255.0 brd 192.168.0.255"
routes_eth1="default via 192.168.0.1"
That's what I used from an example, but more succinctly:
Code: Select all
config_eth0="192.168.0.2/24"
routes_eth0="default via 192.168.0.1"
config_eth1="192.168.0.3/24"
routes_eth1="default via 192.168.0.1"
I didn't specify DNS servers there, I just use a standard, old school, static /etc/resolv.conf (there's nothing to touch that on my setup) with NO bullshit but the nameservers in it.
Code: Select all
nameserver 208.67.222.222
nameserver 208.67.220.220
No comments, no search domains (I find those just cause internet lookup delays and why would I want to search my ISP's domain first?!?), just my OpenDNS servers. I could also just use my router's dnsmasq ("nameserver 192.168.0.1") but the router also gets the ISP's DNS servers from DHCP and while I have three configured in there (2 OpenDNS, 1 google) I don't ever want my lookups going through the ISP's nameservers (shouldn't, but a static resolv.conf on Linux means there will simply be no other nameservers to query). Why? Because they'll do things like redirect name lookup failures and shit. I don't trust ISPs' to return accurate,
honest current enough results. ISPs are notorious for ignoring TTL, too.
Anyway, with that done, it should be like this. Yes, this looks funny, but net.lo is the actual network init script that brings the interfaces up and you symlink to it
Code: Select all
cd /etc/init.d
ln -s net.lo net.eth0
ln -s net.lo net.eth1
rc-update add net.eth0 default
rc-update add net.eth1 default
That's if you want a simple, permanent static network config. They'll direct you to more complex shit first.
P.S. That is indeed what you'd be using by default on a non-systemd stage3. From the Netifrc wiki:
Basic examples
DHCP
Although it's not necessary to explicitly configure it, here's an example to make use of DHCP on an interface.
FILE /etc/conf.d/net Example DHCP configuration
# Note: DHCP is the default behavior if /etc/conf.d/net is empty or missing
config_eth0="dhcp"
So when you create your static netifrc configuration, you ARE configuring it. If you WANT to use dhcp and you want eth* nomenclature (which you must, if you added those udev rules), you're going to have to configure config_eth0 and 1 = "dhcp" as shown in /etc/conf.d/net. If you want to stick with DHCP it's as simple as THAT (and the init.d symlinks) and the udev rules
That was the perfect tidbit (in bold) to help understand this.