D
D
Denis Sechin2017-09-04 15:15:20
linux
Denis Sechin, 2017-09-04 15:15:20

ubuntu gateway problem with two links?

There is a gateway on ubuntu 16, it has 2 links to different IP providers statically configured, 1 main second reserve, I need this gateway to be available from two external IPs at once, I write the following directives:


ip rule del from all to 192.168.88.1 lookup ISP2 ip
rule del from 192.168.88.50 lookup ISP2 rule add to 192.168.88.1 lookup ISP2 ip rule add from 10.49.1.5 lookup ISP1 ip rule add to 10.49.1.254 lookup ISP1 ip route flush cache ip route flush table ISP2 ip route flush table ISP1 ip route add 10.49.1.0/24 dev enp1s0 .200 proto kernel scope link src 10.49.1.5 table ISP1 ip route add default via 10.49.1.254 dev enp1s0.200 table ISP1
ip route add 192.168.88.0/24 dev enp1s0.300 proto kernel scope link src 192.168.88.50 table ISP2
ip route add default via 192.168.88.1 dev enp1s0.300 table ISP2
#192.168.88.1 gateway don't pay attention that gray ip
#10.49 .1.254 gateway ignore gray ip

But after restarting the script in route -n, there is no second default gateway, if I write metric 10 in /etc/network/interfaces for enp1s0.300, then the second route appears, as a result, ssh access to these external IPs is lost from the gateway's local network , how can I understand that the traffic that came through enp1s0.200 will go through it? and why the second route does not appear? Thank you

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question