Community discussions

MikroTik App
 
moham96
newbie
Topic Author
Posts: 33
Joined: Thu Dec 21, 2017 3:08 pm

route traffic to specific pppoe-client and don't hop to the next route

Mon Mar 21, 2022 2:04 pm

Hello,
I have multiple pppoe-clients running on my device, one of them is set as default and would provide internet connection to devices connected to LAN, the other clients have `add-default-route=no` and i have prerouting rules to mark the traffic from a specifc LAN segment to the corresponding pppoe-client but the problem is if the corresponding pppoe-client is disconnected the router is automatically routing the traffic through the default route which i don't want

the pppoe clients
/interface pppoe-client
add add-default-route=yes disabled=no interface=ether5 name=home-pppoe user=user123
add disabled=no interface=eth3 max-mtu=1460 name=pppoe1 user=user1234
add disabled=no interface=eth3 name=pppoe1 user=user12345
the routing tables
/routing table
add fib name=pppoe1
add fib name=pppoe2
mangle rules
/ip firewall mangle
add action=mark-routing chain=prerouting new-routing-mark=pppoe1 passthrough=yes src-address=192.168.10.0/24
add action=mark-routing chain=prerouting new-routing-mark=pppoe2 passthrough=yes src-address=192.168.20.0/2
route:
/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe1 pref-src="" routing-table=pppoe1 scope=30 suppress-hw-offload=no target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe2 pref-src="" routing-table=pppoe2 scope=30 suppress-hw-offload=no target-scope=10
I have an openwrt router connected to lan and has multiple interfaces setup with vlans so one interface has an ip from the default lan ips 192.168.88.0/24 and the others have an ip that matches the mangle rules 192.168.10.0/24 192.168.20.0/24, to test i'm using a simple `curl --interface $iface ifconfig.co` to see the public ip and i can see that when i curl using an interface that has it's corresponding pppoe client disconnected i see that the traffic is routed through the default pppoe client and i get it's public ip

note that all the pppoe clients use the same gateway (10.10.10.1) which might be of importance in this problem



Regards
 
moham96
newbie
Topic Author
Posts: 33
Joined: Thu Dec 21, 2017 3:08 pm

Re: route traffic to specific pppoe-client and don't hop to the next route

Sun Mar 27, 2022 2:35 pm

Any help?
 
User avatar
sindy
Forum Guru
Forum Guru
Posts: 11175
Joined: Mon Dec 04, 2017 9:19 pm

Re: route traffic to specific pppoe-client and don't hop to the next route  [SOLVED]

Sun Mar 27, 2022 10:01 pm

/routing/rule
add routing-mark=pppoe1 action=lookup-only-in-table table=pppoe1
add routing-mark=pppoe2 action=lookup-only-in-table table=pppoe2
 
moham96
newbie
Topic Author
Posts: 33
Joined: Thu Dec 21, 2017 3:08 pm

Re: route traffic to specific pppoe-client and don't hop to the next route

Mon Apr 11, 2022 11:20 pm

/routing/rule
add routing-mark=pppoe1 action=lookup-only-in-table table=pppoe1
add routing-mark=pppoe2 action=lookup-only-in-table table=pppoe2
That seems to work, thanks

Who is online

Users browsing this forum: lurumoney and 8 guests