Dear Forum,
this is my first topic, as I can not really find any solution for my problem.
I searched 3 days but do not find anything.
Following constellation:
All my traffic and inter- VLAN routing and ISP connection is done by a hexS router.
The ISP is connected to port 5 via PPPoE on VLAN 10 (DSL Modem of a local ISP).
Port 1 is maintaining ALL internal VLANs and connected to a VLAN aware switch.
Most of the VLANs are used to isolate devices to each other and are using the hexS’s IP as Gateway to go into internet via the local ISP and to other networks as wished via firewall rules.
All of this is working really really fine and fast ![]()
In VLAN 1 there is another special router (serving another internet connection). For example the Mikrotik has IP 192.168.0.254 and the other router has 192.168.0.253 and is Ubuntu 22.04 based.
The devices in the 192.168.0.0/24 network are using the mikrotik as the default gateway as they must reach services in the other device VLANs (10.0.0.x/24) served and firewalled by the mikrotik.
Via a packet mangle I can define which devices in the 192.168.0.0/24 use the PPPoE connection of the mikrotik or the other linux router 192.168.0.253 for getting into internet. All devices in 192.168.0.0/24 should use the linux router outer one IP address should use the mikrotik’s ISP).
So I defined 2 mangle rules, the first is marking src 192.168.0.0/24 dst:all OUTER THE PRIVATE IPs (a list with local IPs) with routing mark LinuxGW and the 2nd rule remarks src 192.168.0.1/32 dst:all OUTER THE PRIVATE IPs with MikrotikGW.
Additionally I created 2 static routes to 0.0.0.0/24 with mark LinuxGW via 192.168.0.253 and 0.0.0.0/0 with mark MikrotikGW via the PPPoE Gateway.
Suprisingly this works like a charm!!! The machines in 192.168.1.0/24 network are using the linux router for internet and I get 99% of the speed desired by the Linux router!!!
I can reach the services in the 10.1.x.y VLANs as the mikrotik is the first gateway and not mangling packets to private IP address.
Now the problem:
I also want this in a VLAN subnet.
For example VLAN 100, IP range 10.1.1.0/24
I create a 3rd mangling rule to mark even all packets coming from src: 10.1.1.0/24 with LinuxGW.
The Linux machine also knows how to reach 10.1.1.0/24 via 192.168.0.254 and masqerades all packets with it’s public IP even from 192.168.0.0/24 and 10.1.1.0/24.
I can ping the test machine from the linux GW and vice versa.
The strange thing: it is workig but extremely extremely slow.
Test for example:
Windows machine 10.1.1.1 Gateway the Mikrotik routers 10.1.1.254 IP and DNS is done by google for test purposes (8.8.8.![]()
Ping to internet: normal 10-20ms
ping to Linux Router 1ms
Ping from Linux Router 1ms
so far so good.
When I try to surf it struggles and I can not really open a web page (it takes 10-20 seconds to display google and more complex sites even not loading or taking minutes to load).
When I start a download: 5-15 Kilobyte per second. When I look at any networking graphs it seems that packets are coming in every 5-10 seconds.
What is my IP: the public IP of the Linux router (so the rule seems to work).
When I disable the mangle rule:
Google comes in 1 second
Ping to internet: normal 10-20ms
Start Download: 10 Megabyte per second (as my ISP is giving me 98 Mbit /s).
Public IP: the IP of the mikrotik’s PPPoE Interface.
What I tested:
Untag the 100 VLAN on port 4 and connecting a laptop, to close out that all traffic goes over port 1 and the switch failing
swapped the switch with a complete different model and brand
enabled a masqerading within the microtik that it tells the linux router the packets are coming from 192.168.20.254 instead of 10.1.1.1
played around with the options of the mangle rules
Thinkings:
it may be that the back routing is not working properly. As the Linux router and the clients in the 192.168.0.0/24 subnet are in the same subnet the answer from the internet via the linux Router are not passing the mikrotik, they are passing directly from the Linux to the client, while the packets to the 10.1.1.1 mus pass the mikrotik.
If there is a routing fault or a mangling fault it should not work completely (even no ping and so on)
I think there is a bug or a small piece of the puzzle is forgotten by me.
Hardware and Versions:
Routerboard hexS with Router OS 7.8
Vlan aware HP Aruba switch 1930 series
Vlan aware FS switch 3400 series
Linux Router: Ubuntu 22.04 with a flat iptables constellation and forwarding enabled.
Hope anyone can help and read and understand so far ![]()
Thx
Dirk
