Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 3903  / 1 Year ago, tue, february 14, 2023, 12:09:18

I have a Ubuntu 10.04 LTS Server which has two Ethernet ports eth0 and eth1.




  • eth0 is connected to ISP1 with network 192.168.3.0/24 with server static address 192.168.3. 5


  • eth1 is connected to ISP2 with network 192.168.5.0/24 with server static address 192.168.5.10




When eth1 is connected, there is no internet connection from eth0. The internal network is accessible, eg, ssh , ping from other computers in 192.168.3.0/24 network.



When eth1 is disabled or disconnected, eth0 works just fine.



How can I ensure that both the Ethernet ports get internet connections?



netstat configs eth1 disabled



Kernel IP routing table

Destination Gateway Genmask Flags MSS Window irtt Iface

192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

0.0.0.0 192.168.3.1 0.0.0.0 UG 0 0 0 eth0


Netstat config eth1 enabled



Kernel IP routing table

Destination Gateway Genmask Flags MSS Window irtt Iface

192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

192.168.5.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1

0.0.0.0 192.168.5.254 0.0.0.0 UG 0 0 0 eth1

0.0.0.0 192.168.3.1 0.0.0.0 UG 0 0 0 eth0


Edit



I have also checked /etc/resolv.conf



There, I have manually added the nameserver for both the gateways.



ip addr show



1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
link/ether 11:bb:3e:15:3e:0e brd ff:ff:ff:ff:ff:ff
inet 192.168.3.100/24 brd 192.168.3.255 scope global eth0
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 100
link/ether aa:2a:ae:5f:59:e8 brd ff:ff:ff:ff:ff:ff
inet 192.168.5.100/24 brd 192.168.5.255 scope global eth1
valid_lft forever preferred_lft forever

More From » 10.04

 Answers
3

I made a possible running example based on the basic implementation (of Split access) taken from here.



Create two additional routing tables, say T1 and T2.



ip route add 192.168.3.0/24 dev eth0 src 192.168.3.5 table T1
ip route add default via 192.168.3.0/24 table T1
ip route add 192.168.5.0/24 dev eth1 src 192.168.5.10 table T2
ip route add default via 192.168.5.0/24 table T2


Set up the main routing table:



ip route add 192.168.3.0/24 dev eth0 src 192.168.3.5
ip route add 192.168.5.0/24 dev eth1 src 192.168.5.10


Add your preference for default route:



ip route add default via 192.168.3.5


Set up the routing rules, choose what routing table to route with.



ip rule add from 192.168.3.5 table T1
ip rule add from 192.168.5.10 table T2


More info here.


[#36447] Thursday, February 16, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ellter

Total Points: 311
Total Questions: 111
Total Answers: 117

Location: Lithuania
Member since Thu, Jul 14, 2022
2 Years ago
;