Learnincurve Posted June 12, 2017 Posted June 12, 2017 Hi, I'm running armbian 5.27 xenial / kernel 4.9.12-mvebu on a Clearfog base, where eth0 should have a static address and eth1 gets its config. from DHCP. The system has three possible interfaces (including the empty SFP port - eth2). By default both Ethernet ports eth0 and eth1 came up with DHCP, however, I couldn't find any config covering both of them. nmtui had a config for eth1 and eth2 (if I remember correctly), while the /etc/network/interfaces file only had a config for eth0. I have now tried to configure eth0 with a static config, both by adding it in nmtui (which didn't seem to have any effect) and then by manually editing /etc/network/interfaces. Here are my current configs: Quote /etc/network/interfaces: # Internal Ethernet allow-hotplug eth0 #no-auto-down eth0 iface eth0 inet static address 172.16.0.100 netmask 255.255.255.0 gateway 172.16.0.100 #dns-nameservers 8.8.8.8 8.8.4.4 # hwaddress ether # if you want to set MAC manually # pre-up /sbin/ifconfig eth0 mtu 3838 # setting MTU for DHCP, static just: mtu 3838 #Make sure this is never used for default route post-up ip route del default eth0 # Wireless adapter #1 # Armbian ships with network-manager installed by default. To save you time # and hassles consider using 'sudo nmtui' instead of configuring Wi-Fi settings # manually. The below lines are only meant as an example how configuration could # be done in an anachronistic way: # #allow-hotplug wlan0 #iface wlan0 inet dhcp #address 192.168.0.100 #netmask 255.255.255.0 #gateway 192.168.0.1 #dns-nameservers 8.8.8.8 8.8.4.4 # wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf # Disable power saving on compatible chipsets (prevents SSH/connection dropouts over WiFi) #wireless-mode Managed #wireless-power off # Local loopback auto lo iface lo inet loopback /etc/network/interfaces (END) nmtui (eth1): Quote │ │ Profile name LAN Ethernet____________________________ │ │ Device 00:50:43:84:25:2F (eth1)________________ │ │ │ │ ═ ETHERNET <Show> │ │ │ │ ═ IPv4 CONFIGURATION <Automatic> <Show> │ │ ═ IPv6 CONFIGURATION <Automatic> <Show> │ │ │ │ [X] Automatically connect │ │ [X] Available to all users │ │ │ │ <Cancel> <OK> │ │ nmtui (eth0): Quote ┌───────────────────────────┤ Edit Connection ├───────────────────────────┐ │ │ │ Profile name Internal Ethernet_______________________ │ │ Device eth0 (00:50:43:25:FB:84)________________ │ │ │ │ ═ ETHERNET <Show> │ │ │ │ ╤ IPv4 CONFIGURATION <Manual> <Hide> │ │ │ Addresses 172.16.0.100/32__________ <Remove> │ │ │ <Add...> │ │ │ Gateway 172.16.0.100_____________ │ │ │ DNS servers <Add...> │ │ │ Search domains <Add...> │ │ │ │ │ │ Routing (No custom routes) <Edit...> │ │ │ [X] Never use this network for default route │ │ │ │ │ │ [ ] Require IPv4 addressing for this connection │ │ └ │ │ │ │ ═ IPv6 CONFIGURATION <Automatic> <Show> │ │ │ │ [X] Automatically connect │ │ [X] Available to all users │ │ │ │ <Cancel> <OK> Both eth0 and eth1 now come up when I start the system, but I also get a default route for each of them, despite attempting in both config methods to not use eth0 for the default route. After connecting I can then go in and manually do a route del default eth0, which gives me the routing table that I want. I suspect that eth0 is being set first, from /etc/network/interfaces, but that something is reassigning it later and giving it a default route. To keep things stupid and simple, how can I remove all config methods except one, then use that to configure eth0 with a static address and route to 172.16.0.0/24 only eth1 as a dhcp interface Many thanks for your help. BR. --Marius--
Learnincurve Posted June 13, 2017 Author Posted June 13, 2017 SOLVED: I simply disregarded nmtui and edited /etc/network/interfaces as follows: # LAN Interface allow-hotplug eth1 #no-auto-down eth1 iface eth1 inet dhcp # Internal Ethernet allow-hotplug eth0 #no-auto-down eth0 iface eth0 inet static address 172.16.0.100 netmask 255.255.255.0 #gateway 172.16.0.100 #dns-nameservers 8.8.8.8 8.8.4.4 # hwaddress ether # if you want to set MAC manually # pre-up /sbin/ifconfig eth0 mtu 3838 # setting MTU for DHCP, static just: mtu 3838 #Make sure this is never used for default route post-up ip route del default eth0 # Local loopback auto lo iface lo inet loopback Both interfaces come up and only eth1 is defined in the default route. I would like to remove network manager to avoid any pollution of the network configuration. Please advise if this can be done without breaking anything.
tkaiser Posted June 13, 2017 Posted June 13, 2017 8 minutes ago, Learnincurve said: I would like to remove network manager to avoid any pollution of the network configuration. Everything that's new or just different is evil, right? I know many network admins fail horribly with network-manager since they are only used to the primitive config mechanisms from last century and are not willing to get in touch with more advanced concepts like profiles and stuff like that. But this fear is already addressed. If interfaces are defined the anachronistic way NM won't touch them. In other words: you're save already What you did above in the first post (mixing old and new way) is of course asking for trouble, so either do everything the anachronistic way or remove all interfaces from /etc/network/interfaces[.d] and configure stuff with nmtui or nmcli (the more advanced stuff can be handled more easily with the latter)
Learnincurve Posted June 13, 2017 Author Posted June 13, 2017 I'm ready to embrace evil at any time, was just a little confused as both methods seemed to be partially used by default (but of course, both were examples, right?). Anyway, now that I know that the good-old anachronisms override the new and untrustworthy, I'm happy and will do a new, dark-side-only test tomorrow
Recommended Posts