B
B
big_Brat2011-03-03 17:54:51
VPN
big_Brat, 2011-03-03 17:54:51

Rules for iptables. Two VPNs over One External IP [SOLVED]

Need help writing rules for iptables (ubuntu 10.10).
Network structure:
Server - network eth1 192.168.0.1/24 and modem adsl ppp0 8.8.8.8 through it go to the Internet.

There are 2 PCs with addresses 192.168.0.2 and 192.168.0.3 on both networks. VPN is up.
The first PC 192.168.0.2 vnp connects to the Internet address 9.9.9.9 The
second PC 192.168.0.3 vnp connects to the Internet address 10.10.10.10

interface ppp0

Now it turns out that only one of the PCs can work, the second vnp is not tied.

TCPDUMP gives such information IP 192.168.0.3.500 > 10.10.10.10.500: isakmp: phase 1 I ident

and so it repeats

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lev Lybin, 2011-03-03
@lybin

echo 1 > /proc/sys/net/ipv4/ip_forward # /etc/sysctl.conf
$IPT -v -t mangle -A PREROUTING -i eth1 -s 192.168.0.1 -j MARK --set-mark 10
$IPT - v -t mangle -A PREROUTING -i eth1 -s 192.168.0.2 -j MARK --set-mark 10
$IPT -v -t mangle -A PREROUTING -i eth1 -s 192.168.0.3 -j MARK --set-mark 10
$IPT -v -t nat -A POSTROUTING -o ppp0 -m mark --mark 10 -j SNAT --to-source=8.8.8.8
will route everything, add restrictions and forward ports to client ports if necessary. Not this way?

L
Lev Lybin, 2011-03-03
@lybin

First of all, what immediately catches your eye is that 8.8.8.8 is Google's dns! So you already have some rules, would show then

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question