Skip to contentSkip to conversation

ipsec nat and iptables

DISCUSSION Info DataCenter1.com 2 participants 2 messages Aug 25, 2005 – Aug 26, 2005

lore
Share & tools
lore
#0 lore raw

Hello

I'm trying to setup a network to network vpn using native ipsec support on Centos 4.1

Network A
eth0= conected to internet
eth1= conected to private lan 192.168.1.1

Network B
eth0 conected to Internet
eth1= conected to private lan 192.168.2.1

Quoted 1 line

From server A I'm able to ping 192.168.2.1 and viceversa but computers in the private lan can't see the other side

I'm using pre-shared keys also I set nat_transversal in racoon

Also I set my servers like iptables router iptables -A INPUT -m state --state INVALID -j DROP iptables -A FORWARD -m state --state INVALID -j DROP iptables -A OUTPUT -m state --state INVALID -j DROP

iptables -A FORWARD -i eth1 -o eth0
iptables -A FORWARD -i eth0 -o eth1

iptables -P INPUT DROP
iptables -P FORWARD DROP

iptables -A INPUT -i eth0 -j ACCEPT
iptables -A INPUT -i ethY -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

#1 lore raw
Quoted 10 lines · On Thursday 2005-August-25 10:27, Info DataCenter1.com wrote:

Network A
eth0= conected to internet
eth1= conected to private lan 192.168.1.1

Network B
eth0 conected to Internet
eth1= conected to private lan 192.168.2.1

Quoted 2 lines

From server A I'm able to ping 192.168.2.1 and viceversa but computers in the private lan can't see the other side

snip

Quoted 2 lines

iptables -A FORWARD -i eth1 -o eth0 iptables -A FORWARD -i eth0 -o eth1

These rules do nothing.

Quoted 1 line

iptables -P FORWARD DROP

And then your policy drops that traffic.

Signature · 2 lines
    mail to this address is discarded unless "/dev/rob0"
    or "not-spam" is in Subject: header