My server has two wired nics setup. The motherboard nic is properly configured for internet access through dhcp using networkd. The other nic is a usb ethernet adapter which is also configured through networkd but without internet access.
The problem is that all net traffic prefers to travel through the usb nic.
Motherboard nic config:
[Match] Name=enp3s0 [Network] DHCP=true DNS=126.96.36.199
USB nic config:
[Match] Name=enp0s29f7u* [Network] DNS=188.8.131.52 Address=192.168.80.1/24 Gateway=192.168.80.1
How can I get traffic to prefer to go through the motherboard nic?
I've tried renaming the /etc/systemd/network/ files but this hasn't made a difference.
Last edited by awx (2014-07-22 05:09:37)
What, if anything, are you actually trying to use the usb device for? Is there any reason for it to have a route to the 192.168.80.1 gateway? Is the motherboard device also on the 192.168.80.1 subnet?
No, they are completely separate networks at the moment. The usb nic serves as a ad hoc DHCP/PXE network for system loading. It must be separate because there is another DHCP/PXE server (windows) on the real network.
Right now my PXE server is running but clients hang at pxelinux so I'll have some followup questions about how to properly configure dnsmasq.
PS- the 192.168.80.1 network only exists on that nic and any attached clients. there is no router or anything else attached. It is actually working- clients pull a dhcp address and start booting. It's just that my server can't connect to the internet because it's trying to send all of its traffic through this dead-end network. Eventually, I'd like this ad hoc network to be able to connect to the internet.
Last edited by awx (2014-07-21 04:41:46)
Ok, that makes sense. In that case, does it make sense to have a Gateway set for the usb device? I would think it would want an address on that network, but no outbound route.
What output do you get from 'ip addr' and 'ip route'?
Hi, you're right. I removed the gateway and dns entries and now it works. Thanks for putting me on the right track.
I think I'll probably move away from networkd in the long run because it doesn't seem flexible enough. I'm going to try to find out more about networkd bridges and see if they are appropriate for my needs.
Glad that helped. Please remember to mark the thread as solved.