M
M
maximen392019-04-21 01:52:46
iptables
maximen39, 2019-04-21 01:52:46

Make ipip tunnel between linux servers?

There are 2 linux (ubuntu) servers in different networks (have static ip).
On the first server (S1) there are two ip 94.23.xx(eth0) and 51.254.xx(eth0:0) with Internet access. On the second server (S2) there is a game server on port 29959 ip: 91.121.xx(eth0).
It is necessary to make it so that when connecting to 51.254.xx:29959, it connects to the game server on (S2), while the real user's ip is transmitted. I tried to do it through ipip, but the internal ip of the
interfaces S1 server is transmitted:

auto eth0
iface eth0 inet static
  address 94.23.x.x
  netmask 255.255.255.0
  broadcast 94.23.x.255
  gateway 94.23.x.254

auto eth0:0
iface eth0:0 inet static
  address 51.254.x.x
  netmask 255.255.255.255

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2019-04-21
@hempy80

On S1, you need to configure dst-nat forwarding to the address of the S2 tunnel interface.
On S2, in order to avoid unnecessary troubles, configure the game server in such a way that it listens to the tunnel interface too. Also, configure routing on S2 so that return packets from the game server go to the tunnel, and not through the default gateway. This is done through the marking of connections, In short, those are still dancing with a tambourine

K
ky0, 2019-04-21
@ky0

Forwarding can be configured using iptables, no tunnel is needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question