Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2495  / 2 Years ago, thu, september 15, 2022, 10:24:18

I'm new to Linux, trying to get a Clonezilla server up.
I'm really bad at understanding how my network should be configured.
eth1 is the card for internet access, behind a proxy (192.168.41.5:80)
eth2 is the card for deploying, connected to a router.



When eth2 is running, I can't seem to connect to the internet as it automatically try to use eth2 for everything (Firefox, ping, apt-get). Why is that?



Running Ubuntu 13.4



eth1      Link encap:Ethernet  HWaddr 00:04:76:14:52:9a  
inet addr:192.168.12.2 Bcast:192.168.12.255 Mask:255.255.255.0
inet6 addr: fe80::204:76ff:fe14:529a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1821 errors:0 dropped:137 overruns:1 frame:0
TX packets:319 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:214123 (214.1 KB) TX bytes:54667 (54.6 KB)
Interrupt:16 Base address:0xa000

eth2 Link encap:Ethernet HWaddr 00:25:64:e7:2b:e3
inet addr:192.168.200.1 Bcast:192.168.200.255 Mask:255.255.255.0
inet6 addr: fe80::225:64ff:fee7:2be3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:1004 (1.0 KB)
Interrupt:16

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1115 errors:0 dropped:0 overruns:0 frame:0
TX packets:1115 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:85036 (85.0 KB) TX bytes:85036 (85.0 KB)


My etc/network/interfaces:



auto lo
iface lo inet loopback

auto eth1
iface eth1 inet static
address 192.168.12.2
netmask 255.255.255.0
gateway 192.168.12.213

auto eth2
iface eth2 inet static
address 192.168.200.1
netmask 255.255.255.0


Ps: I'm connected in ssh (what a great invention) into 192.168.12.2 and it works (even if I can't ping my proxy)
Ps2: Sorry if it's a stupid question, "Linux" was just a fancy word for me not so long ago.



Have a good day :)


More From » 13.04

 Answers
0

You should be able to use the command ifmetric to set the metrics for each interface. The lower the metric the more "preferred" it is.



It is not included by default, but you can add it with sudo apt-get install ifmetric.



Then use ifmetric interface value to set the metric.



So to make eth1 "preferred" set its metric to 0, or set eth2's metric to 2 or higher.



To give credit were it's due, I found the answer here:



------------------------------------------------------------------------------------------------

Also, from the Debian Documents pages:



5.6.2. The ifmetric package



The ifmetric package enables us to manipulate metrics of routes a posteriori even for DHCP.



The following sets the eth0 interface to be preferred over the wlan0 interface.




  1. Install the ifmetric package.

  2. Add an option line with "metric 0" just below the "iface eth0 inet dhcp" line.

  3. Add an option line with "metric 1" just below the "iface wlan0 inet dhcp" line.



The metric 0 means the highest priority route and is the default one. The larger metric value means lower priority routes. The IP address of the active interface with the lowest metric value becomes the originating one. See ifmetric(8).


[#28749] Saturday, September 17, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
musining

Total Points: 171
Total Questions: 124
Total Answers: 121

Location: Zambia
Member since Thu, Jun 25, 2020
4 Years ago
;