Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
26
rated 0 times [  26] [ 0]  / answers: 1 / hits: 28721  / 2 Years ago, wed, may 11, 2022, 6:09:08

I have a machine with three network interfaces running Ubuntu 12.04 LTS, 64-bit, kernel 3.5.0-49.



I am using all three interfaces. Two of them are connected to LANs (eth0 and eth1) and one is connected to the internet (eth2); but when I try to access the internet, it attempts to go through eth0 (error responses come from eth0's IP).



I know that it will work (from experience elsewhere) if I don't set a gateway address for eth0 or eth1, but I have to because for some reason the network manager GUI won't let me save connection settings if no gateway is specified (?).



How do I either a) set eth0 and eth1 to not have gateway addresses, or b) tell the system to use eth2 for internet access (that is, IPs not on eth0/eth1's subnets).



As for trying to unset eth0 and eth1's gateway addresses: Trying to bypass the network manager GUI, I checked in /etc/network/interfaces but Ubuntu doesn't seem to use it (it only has an entry for lo). I'm not really familiar with more modern ways of configuring interfaces though, and so I gave up there.


More From » networking

 Answers
3

It sounds like you're looking for a way to set the default gateway. You can see the current settings by running ip route. You probably want yours to look like something like this:



default via 192.168.0.1 dev eth0 ...
192.168.0.0/24 dev eth0 ...
192.168.1.0/24 dev eth1 ...
192.168.2.0/24 dev eth2 ...


These routes are automatically created by NetworkManager. Try checking Edit ▸ IPv4 Settings ▸ Routes ▸ Use this connection only for resources on its network on the two LAN connections to prevent them from becoming the default gateway.



You shouldn't need to work around NetorkManager.


[#24969] Thursday, May 12, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
umplegitimat

Total Points: 137
Total Questions: 126
Total Answers: 118

Location: Saint Pierre and Miquelon
Member since Sat, Aug 21, 2021
3 Years ago
umplegitimat questions
;