L
L
Lite_robot2015-11-30 16:08:03
linux
Lite_robot, 2015-11-30 16:08:03

Iproute2: how to fix routing so that traffic to a certain subnet always goes through a certain router?

Hello Toaster. It is required to organize the forwarding of traffic through a specific router. Implemented via ip route add 8.8.8.8 via 88.12.34.1 ; Traffic starts to go along this route, but sometimes for some reason leaves through the default gateway. How to make traffic to 8.8.8.8 always leave and only always through 88.12.34.1?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg Tsilyurik, 2015-11-30
@Lite_robot

Traffic starts to go along this route, but sometimes for some reason leaves through the default gateway.

What does "sometimes for some reason it goes away" mean? An IP network is a deterministic system, not ... "sometimes" ;-)
This cannot happen if your interface 88.12.34.1 is up. Or somewhere along the route of this route there are problems (this may also depend on which dynamic, territorial routing system you are included in). See traceroute for how the route is going.

A
alegzz, 2015-11-30
@alegzz

ip rule add help
ip route add default via 88.12.34.1 table <same as when adding rules>
it is important that the rule number is less than that of main. something like this. in theory, with such a rule in the table main will not even look

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question