D
D
DarhuBer2018-09-11 13:22:00
FreeBSD
DarhuBer, 2018-09-11 13:22:00

How to switch one gateway to work through another (FreeBSD)?

There are 2 FreeBSD network routers (with separate internet channels) serving different user subnets (192.168.50.254 and 192.168.70.254). Locally they see each other. In the event of an Internet crash on the 50.254 gateway, how can I force it to temporarily go to the Internet through the 70.254 gateway?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
LordNicky, 2018-09-11
@DarhuBer

Good day!
Recently published an article on a given topic. I suspect that you will be interested to read .
And on this topic, in my program this function is performed by this module .
In general, you just need to change the defaultrouter to 192.168.70.254. those. these 2 commands:

setfib $RTABLE_0 sudo route del default;
setfib $RTABLE_0 sudo route add default 192.168.70.254;

where $RTABLE_0 is the number of your routing table if the default table is used, i.e. 0-way, then it can be even easier under root:
route del default;
route add default 192.168.70.254;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question