Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Networking / Routing issue. (Read 418 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Networking / Routing issue.

Heyo,

I have a little problem with configuring a Linux networking correctly.

I have 2 interfaces:
 - eth3, which is a interface with public IP;
 - usb0, which is a interface with faster internet traffic.

I configured the routing table to target the default gateway on usb0. Although, public IP stopped working after that (still I can ping a router from the eth3).

How can I make my public IP work while using a different interface for downloading stuff?

Re: Networking / Routing issue.

Reply #1
Also the technical part of pings:
Code: [Select]
[20:59:19][root@xaviama][Artix | xaviama.dank-me.me]
(/)# ping -I eth3 app.element.io
PING  (104.22.48.198) from 192.168.0.150 eth3: 56(84) bytes of data.
From xaviama.dank-me.me (192.168.0.150) icmp_seq=1 Destination Host Unreachable
From xaviama.dank-me.me (192.168.0.150) icmp_seq=2 Destination Host Unreachable
From xaviama.dank-me.me (192.168.0.150) icmp_seq=3 Destination Host Unreachable
^C
---  ping statistics ---
6 packets transmitted, 0 received, +3 errors, 100% packet loss, time 5077ms
pipe 4

[20:59:37][root@xaviama][Artix | xaviama.dank-me.me]
(/)# ping -I usb0 app.element.io
PING  (104.22.49.198) from 192.168.42.16 usb0: 56(84) bytes of data.
64 bytes from 104.22.49.198 (104.22.49.198): icmp_seq=1 ttl=55 time=336 ms
64 bytes from 104.22.49.198 (104.22.49.198): icmp_seq=2 ttl=55 time=515 ms
64 bytes from 104.22.49.198 (104.22.49.198): icmp_seq=3 ttl=55 time=390 ms
64 bytes from 104.22.49.198 (104.22.49.198): icmp_seq=4 ttl=55 time=330 ms
^C
---  ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3002ms
rtt min/avg/max/mdev = 329.588/392.568/515.172/74.513 ms

Address `192.168.0.150` is for public IP.

Re: Networking / Routing issue.

Reply #2
What do you mean by 'Public IP'?

192.168.0.150 is part of the 192.168.0.0/16 private address range.

Re: Networking / Routing issue.

Reply #3
a router from `192.168.0.0/24` is pointing at `192.168.0.150` through DMZ.

Router has `192.168.0.1` address.

Re: Networking / Routing issue.

Reply #4
192.168.0.150 remains a private IP.

You'll maybe have to explain better what you are trying to achieve ?

Re: Networking / Routing issue.

Reply #5
I have a little problem with configuring a Linux networking correctly.

http://wanip.info/
https://en.wikipedia.org/wiki/Link_aggregation
https://wiki.gentoo.org/wiki/Handbook:X86/Full/Networking
"Wer alles kann, macht nichts richtig"

Artix USE="runit openrc slim openbox lxde gtk2 qt4 qt5 qt6 conky
-gtk3 -gtk4 -adwaita{cursors,themes,icons} -gnome3 -kde -plasma -wayland "

Re: Networking / Routing issue.

Reply #6
Heyo,

I have a little problem with configuring a Linux networking correctly.

I have 2 interfaces:
 - eth3, which is a interface with public IP;
 - usb0, which is a interface with faster internet traffic.

I configured the routing table to target the default gateway on usb0. Although, public IP stopped working after that (still I can ping a router from the eth3).

How can I make my public IP work while using a different interface for downloading stuff?
You didn't post the most important information: your routing table (route -n).
Search for 'advanced linux networking', you can have multiple default gateways on different NICs.

Re: Networking / Routing issue.

Reply #7
Let's say I have 2 networks.

2 Gateways - one which offers public IP & second what offers faster bandwidth.
What I'm trying to achieve is to use faster bandwidth for downloading stuff & make public IP reachable.

.. actually after experimenting with `ip route`, I made a setup:
Code: [Select]
echo '1 public' >> /etc/iproute2/rt_tables
ip route add 192.168.0.0/24 dev eth3 src 192.168.0.150 table public
ip route add default via 192.168.0.1 dev eth3 table public
ip rule add from 192.168.0.1/24 table public
ip rule add to 192.168.0.1/24 table public

Re: Networking / Routing issue.

Reply #8
Also if you like:
Code: [Select]
route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.42.129  0.0.0.0         UG    0      0        0 usb0
127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth3
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 cni-podman0
192.168.3.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.4.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.5.0     0.0.0.0         255.255.255.0   U     0      0        0 eth2
192.168.6.0     0.0.0.0         255.255.255.0   U     0      0        0 eth4
192.168.42.0    0.0.0.0         255.255.255.0   U     0      0        0 usb0
ip route show table public
default via 192.168.0.1 dev eth3
192.168.0.0/24 dev eth3 scope link src 192.168.0.150