Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 7704  / 2 Years ago, fri, april 22, 2022, 5:44:51

Does connecting to multiple networks with different subnet in Ubuntu actually require some extra steps to work correctly?



I have 2 network interfaces on my computer, one is wired nic and the other is wireless USB adapter. Both of them are connected to different routers on different subnet. Before you ask



$ ip -4 a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
inet 10.10.1.2/24 brd 10.10.1.255 scope global eth0
4: wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
inet 192.168.1.2/24 brd 192.168.1.255 scope global wlan1

$ ip -4 r
default via 10.10.1.1 dev eth0 proto static
10.10.1.0/24 dev eth0 proto kernel scope link src 10.10.1.2 metric 1
169.254.0.0/16 dev eth0 scope link metric 1000
192.168.1.0/24 dev wlan1 proto kernel scope link src 192.168.1.2 metric 2

$ netstat -rn output
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 10.10.1.1 0.0.0.0 UG 0 0 0 eth0
10.10.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan1


I can ping both of the gateway IP fine but binding a connection to the USB adapter network never work. So any idea how to fix this?


More From » networking

 Answers
3

FOUND THE SOLUTION!



Turns out that I need to add a new routing table for the additional nic and then add routing rules for it in the table. Read more for instructions in this link


[#37539] Friday, April 22, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
teromato

Total Points: 139
Total Questions: 102
Total Answers: 100

Location: Liechtenstein
Member since Mon, May 15, 2023
1 Year ago
;