LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-27-2008, 11:21 AM   #1
Thakowbbery
Member
 
Registered: Mar 2005
Posts: 138

Rep: Reputation: 17
OpenSwan VPN only works in one direction


Noon,

Both ends of the VPN are configured as follows:

- Suse 10.1 - Openswan 2.4.4
- Debian 4.0 - Openswan 2.4.6

The Suse end has a VPN with other 2 places, and the VPN for those places works fine (both of them are also Suse 10.1 with Openswan 2.4).

The VPN between the Suse and Debian only works in one direction (the Suse side can access anything on the Debian side, but not the opposite).

The connection config in both ipsec.conf is as follow:

Quote:
Debian (right):
conn X
left=x.x.x.x
leftsubnet=192.168.0.0/23
leftnexthop=%defaultroute
leftrsasigkey=xxxxx...
right=y.y.y.y
rightsubnet=192.168.7.0/24
rightnexthop=%defaultroute
rightrsasigkey=yyyyy...
auto=start

Suse (left):
conn X
left=x.x.x.x
leftsubnet=192.168.0.0/23
leftnexthop=%defaultroute
leftrsasigkey=xxxxx...
right=y.y.y.y
rightsubnet=192.168.7.0/24
rightnexthop=%defaultroute
rightrsasigkey=yyyyy...
auto=add
ipsec verify for both ends:

Quote:
Debian:
Checking your system to see if IPsec got installed and started correctly:
Version check and ipsec on-path [OK]
Linux Openswan U2.4.6/K2.6.18-5-486 (netkey)
Checking for IPsec support in kernel [OK]
NETKEY detected, testing for disabled ICMP send_redirects [OK]
NETKEY detected, testing for disabled ICMP accept_redirects [OK]
Checking for RSA private key (/etc/ipsec.secrets) [OK]
Checking that pluto is running [OK]
Two or more interfaces found, checking IP forwarding [OK]
Checking NAT and MASQUERADEing
Checking for 'ip' command [OK]
Checking for 'iptables' command [OK]
Opportunistic Encryption Support [DISABLED]

Suse:
Checking your system to see if IPsec got installed and started correctly:
Version check and ipsec on-path [OK]
Linux Openswan U2.4.4/K2.6.16.21-0.25-smp (netkey)
Checking for IPsec support in kernel [OK]
Checking for RSA private key (/etc/ipsec.secrets) [OK]
Checking that pluto is running [OK]
Two or more interfaces found, checking IP forwarding [OK]
Checking NAT and MASQUERADEing
Checking for 'ip' command [OK]
Checking for 'iptables' command [OK]
Checking for 'curl' command for CRL fetching [OK]
Checking for 'setkey' command for NETKEY IPsec stack support [OK]
Opportunistic Encryption Support [DISABLED]
The VPN has been established (the proof being that the left end can access everything in the right end, and if I kill IPSec daemon, the connection is killed) and everything seens just fine.
Already removed openswan and installed it again in Debian, and got the same result, even with a different key.

Please, I need help with that, urgent.

Thank you very much
 
Old 03-27-2008, 12:06 PM   #2
Thakowbbery
Member
 
Registered: Mar 2005
Posts: 138

Original Poster
Rep: Reputation: 17
Some test that didnīt work:

Changed all policies in iptables to ACCEPT (INPUT, OUTPUT, FORWARD) = didnīt work
Mass SNAT (iptables -t nat POSTROUTING -A -s 192.168.7.0/24 -j SNAT --to y.y.y.y) = didnīt work also
Both above at the same time = didnīt work

Created some logs in iptables and checked tcpdump.
Apparently, when thereīs a connection attempt from inside network 192.168.7.0/24 to 192.168.0.0/23, thereīs no ESP traffic in my VPN. When I do the opposite (192.168.0.0/23 --> 192.168.7.0/24), there is.
 
Old 03-27-2008, 01:15 PM   #3
Thakowbbery
Member
 
Registered: Mar 2005
Posts: 138

Original Poster
Rep: Reputation: 17
Well
Once again, I discovered it just a few minutes after posting here XD
Man, this forum is magical, hauehauehaueh

The last person who took care of the Debian firewall had a massive SNAT rule (-s internal_network -j SNAT --to external_IP).
That was not allowing the traffic from inside the network to enter the VPN. Instead, it was trying to go directly to the internet.
So, I did the following:

iptables -t nat -I POSTROUTING -s 192.168.7.0/24 -d 192.168.0.0/23 -j ACCEPT

That way the connections would not be "nated" and now theyīre going right into the VPN.
Full connection
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem:VPN wireless connection with OpenSwan on Slackware 12.0 Salgeras Linux - Wireless Networking 2 10-05-2007 02:46 AM
Openswan Vpn satish Linux - Networking 0 04-11-2007 07:47 AM
Openswan/Cisco PIX: NATting a VPN Tunnel SnotRocket Linux - Networking 1 01-28-2007 09:13 PM
Authorizing Openswan VPN connection logo Linux - Networking 1 03-05-2005 04:46 AM
Creating a Linux<-WinXP VPN with OpenSwan logo Linux - Security 4 02-07-2005 09:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration