[Solved] Two Networks

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
User avatar
JayBird707
Level 3
Level 3
Posts: 106
Joined: Sat Jan 30, 2016 9:56 pm

[Solved] Two Networks

Post by JayBird707 » Mon Aug 20, 2018 5:12 pm

I need some help setting up some routing on my Mint 19 XFCE install.

I have a Wireless Adapter and an Ethernet Adapter installed.

I want all traffic for network 192.168.2.0 to use Wifi on Wireless Adapter wlp0s26u1u1 192.168.2.108.

All other traffic including internet requests should use Ethernet Adapter eno1 192.168.1.105.

I think it has to be done using the route command but I'm not sure of how to write the commands.

Here my settings:

Code: Select all

Ethernet Adapter
eno1 192.168.1.105
 
Wireless Adapter
wlp0s26u1u1 192.168.2.108

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    100    0        0 eno1
0.0.0.0         192.168.2.1     0.0.0.0         UG    600    0        0 wlp0s26u1u1
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eno1
192.168.1.0     0.0.0.0         255.255.255.0   U     100    0        0 eno1
192.168.2.0     0.0.0.0         255.255.255.0   U     600    0        0 wlp0s26u1u1
192.168.15.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet1
192.168.29.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet8
Thanks in advance for any advice you can give.
Last edited by JayBird707 on Wed Aug 22, 2018 6:42 pm, edited 1 time in total.
Dell Studio 1737 Laptop: HP6300 SFF Desktop: HP8000 USFF Desktop all on Linux Mint!
Image

User avatar
JayBird707
Level 3
Level 3
Posts: 106
Joined: Sat Jan 30, 2016 9:56 pm

Two Networks

Post by JayBird707 » Mon Aug 20, 2018 6:42 pm

I think I got the commands down here is what I did.

Code: Select all

jeffrey@jeffrey-HP-Compaq-Pro-6300-SFF ~ $ sudo route del -net 0.0.0.0 gw 192.168.2.1 netmask 0.0.0.0 dev wlp0s26u1u1
jeffrey@jeffrey-HP-Compaq-Pro-6300-SFF ~ $ sudo route del -net 192.168.2.0 gw 0.0.0.0  netmask 255.255.255.0 dev wlp0s26u1u1
jeffrey@jeffrey-HP-Compaq-Pro-6300-SFF ~ $ sudo route add -net 192.168.2.0 gw 192.168.2.108 netmask 255.255.255.0 dev wlp0s26u1u1
Here is the new routing Table

Code: Select all

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    100    0        0 eno1
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eno1
192.168.1.0     0.0.0.0         255.255.255.0   U     100    0        0 eno1
192.168.2.0     0.0.0.0         255.255.255.0   U     600    0        0 wlp0s26u1u1
192.168.15.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet1
192.168.29.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet8
Now all I need is some help to figure out how to make the changes permanent.
Dell Studio 1737 Laptop: HP6300 SFF Desktop: HP8000 USFF Desktop all on Linux Mint!
Image

User avatar
JayBird707
Level 3
Level 3
Posts: 106
Joined: Sat Jan 30, 2016 9:56 pm

Re: Two Networks

Post by JayBird707 » Mon Aug 20, 2018 7:47 pm

I found this posting:

viewtopic.php?t=224152#p1181281

And it looks like I'm making headway to getting the settings to be persistent.

The Routing Table now looks like this:

Code: Select all

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    100    0        0 eno1
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eno1
192.168.1.0     0.0.0.0         255.255.255.0   U     100    0        0 eno1
192.168.2.0     0.0.0.0         255.255.255.0   U     600    0        0 wlp0s26u1u1
192.168.2.0     192.168.2.108   255.255.255.0   UG    600    0        0 wlp0s26u1u1
192.168.15.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet1
192.168.29.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet8
I just want to eliminate 192.168.2.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp0s26u1u1 but can't seem to figure out how to get rid of it.
Dell Studio 1737 Laptop: HP6300 SFF Desktop: HP8000 USFF Desktop all on Linux Mint!
Image

Laurent85
Level 15
Level 15
Posts: 5696
Joined: Tue May 26, 2015 10:11 am

Re: Two Networks

Post by Laurent85 » Wed Aug 22, 2018 1:59 pm

JayBird707 wrote:
Mon Aug 20, 2018 5:12 pm
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 100 0 0 eno1
0.0.0.0 192.168.2.1 0.0.0.0 UG 600 0 0 wlp0s26u1u1
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eno1
192.168.1.0 0.0.0.0 255.255.255.0 U 100 0 0 eno1
192.168.2.0 0.0.0.0 255.255.255.0 U 600 0 0 wlp0s26u1u1
192.168.15.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet1
192.168.29.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet8
[/code]
That routing table already routes network traffic as desired, no need to change anything. Network traffic 198.168.2.0/24 routed via wifi adapter. Default route 0.0.0.0 with metric 100 has precedence over metric 600, internet network traffic routed via ethernet adapter eno1.
Image

User avatar
JayBird707
Level 3
Level 3
Posts: 106
Joined: Sat Jan 30, 2016 9:56 pm

Re: Two Networks

Post by JayBird707 » Wed Aug 22, 2018 6:42 pm

Thanks for looking I really appreciate your help.
Dell Studio 1737 Laptop: HP6300 SFF Desktop: HP8000 USFF Desktop all on Linux Mint!
Image

User avatar
JayBird707
Level 3
Level 3
Posts: 106
Joined: Sat Jan 30, 2016 9:56 pm

Re: [Solved] Two Networks

Post by JayBird707 » Thu Aug 23, 2018 2:06 pm

I am rookie at this and am a little OCD so please bear with me.

If I want all 192.168.2. requests to go through wlp0s26u1u1 then why doesn't that entry in the table look like:

192.168.2.0 0.0.0.0 255.255.255.0 U 100 0 0 wlp0s26u1u1

Code: Select all

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    100    0        0 eno1
0.0.0.0         192.168.2.1     0.0.0.0         UG    600    0        0 wlp0s26u1u1
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eno1
192.168.1.0     0.0.0.0         255.255.255.0   U     100    0        0 eno1
192.168.2.0     0.0.0.0         255.255.255.0   U     600    0        0 wlp0s26u1u1
192.168.15.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet1
192.168.29.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet8
Dell Studio 1737 Laptop: HP6300 SFF Desktop: HP8000 USFF Desktop all on Linux Mint!
Image

Laurent85
Level 15
Level 15
Posts: 5696
Joined: Tue May 26, 2015 10:11 am

Re: [Solved] Two Networks

Post by Laurent85 » Thu Aug 23, 2018 3:25 pm

JayBird707 wrote:
Thu Aug 23, 2018 2:06 pm
If I want all 192.168.2. requests to go through wlp0s26u1u1 then why doesn't that entry in the table look like:

192.168.2.0 0.0.0.0 255.255.255.0 U 100 0 0 wlp0s26u1u1
It could but that would make no difference since only one route is available for network 192.168.2.0/24.
Image

Post Reply

Return to “Other networking topics”