Answer the question
In order to leave comments, you need to log in
Two providers, one server. How to set up correctly?
Hello. I'm new to linking but trying to solve a huge problem for myself and move to Win2003 on Ubuntu.
I had a task to set up two gateways from two providers. I managed to do this through iproute2.
Here's the script I'm using:
#!/bin/sh
IP1=195.182.142.73
IP2=37.230.206.62
P1=195.182.142.65
P2=37.230.206.32
IF1=eth0
IF2=eth1
# add a default gateway to each table.
ip route add default via $P1 table T1
ip route add default via $P2 table T2
# We say that by default we will go through the first provider.
ip route add default via $P1
ip rule add from $IP1 table T1
ip rule add from $IP2 table T2
Everything works, apache, mysql and ssh respond to different ip addresses.
I uploaded the Counter Strike 1.6 server, and then it started, it does not want to be available through two gateways. In the settings you can specify ip, tried everything. Specified 0.0.0.0, 127.0.0.1, does not want and that's it. Works only if you specify one of the external ones.
At the same time, lines indicating ports appear in netstat when the server starts:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1024/mysqld
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 934/sshd
tcp6 0 0 :::80 :::* LISTEN 1052/apache2
tcp6 0 0 :::22 :::* LISTEN 934/sshd
udp 0 0 0.0.0.0:26900 0.0.0.0:* 1862/hlds_linux
udp 0 0 0.0 .0.0:27015 0.0.0.0:* 1862/hlds_linux
please help me figure it out.
PS. It turned out to set it up on Mikrotik using package marking. But I do not want to use additional equipment and nat.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question