Answer the question
In order to leave comments, you need to log in
How to set up two external IPs in Ubuntu Server?
Hello. Yes, repeating the question, last time I could not get a clear answer, sorry :(.
There is a server with Ubuntu Server. There are three network cards on the server. The first two IPs are external, the third is internal. The point is that both external addresses are pinged from outside I prescribe a route for one external, sell ping for another, and so on in a circle :(. It turns out that either the first or the second works.
Thank you.
Answer the question
In order to leave comments, you need to log in
1. Open /etc/iproute2/rt_tables and add something like this:
190 net_ext_1
195 net_ext_2
/sbin/ip rule add from 10.10.1.10 lookup net_ext_1 pref 20000
/sbin/ip rule add from 10.11.2.10 lookup net_ext_2 pref 20000
/sbin/ip route add default via 10.10.1.1 table net_ext_1
/sbin/ip route add default via 10.11.2.1 table net_ext_2
The server is working correctly.
I turn on telepathy :)
You tell him
route add default gw xxxx
route add default gw yyyy metric 1
And only one gateway answers by default :)
And you were given an article on the simplest script for working two channels.
habrahabr.ru/post/54748
There, channel balancing was used through the weight
ip route add default scope global nexthop via $P1 dev $IF1 weight $W1 \
nexthop via $P2 dev $IF2 weight $W2 parameter
What exactly is not clear in this article? At one time, I also started with an analogue of the same.
I have now made a switch on providers on the same basis.
There is another option. Quite simple. Banal pingalka. When the signal does not pass through one channel, the script rewrites the main route and the signal goes through the second channel.
Of the minuses: Perversion, fault tolerance at a very low level, the ability to write elementary scripts on the shell is required. I'm not sure, but perhaps the RAM will still suffer seriously after a week of running the script. But again, I'm not sure.
On the other hand, it's easier to just run and poke yourself.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question