LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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-31-2005, 07:25 AM   #1
lucifercipher
LQ Newbie
 
Registered: Mar 2005
Location: Pakistan
Posts: 3

Rep: Reputation: 0
iptables and VPN connections


Hi,

Does someone have to set iptables to accept VPN connections or they are handled by kernel routing automatically?
 
Old 04-02-2005, 04:19 AM   #2
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 32
vpn's are run over layer 3 - in that case they most likley will need to pass through iptables!
(that's what i think!)
 
Old 04-05-2005, 10:43 AM   #3
fr_laz
Member
 
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384

Rep: Reputation: 32
Hi,

yes you definitely have to.

There's a trick since when you, as an exemple, tunnel port http 80, your Linux box will first see an ESP packet ; then your vpn software will decrypt traffic, and the Linux box will see an incomming http packet. Best way to see what's happening is to play a bit with ethereal.

Thus, so as to allow http incomming through vpn, you need both
Code:
iptables -A INPUT -i eth0 -p esp -j ACCEPT
iptables -A INPUT -i eth0 -p tcp -dport 80 -j ACCEPT
But the second line is quite uncool !! So here's the trick :
Code:
iptables -A INPUT -i eth0 -p esp -j ACCEPT
iptables -t mangle -I INPUT -p esp -j MARK --set-mark 1
iptables -I FORWARD -m mark --mark 1 -j ACCEPT
 
0 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Vpn Multiple connections rdwiljam Linux - Networking 0 09-29-2005 05:43 PM
Linux VPN Connections Limit lucifercipher Linux - Networking 1 04-03-2005 08:58 AM
Routing VPN Connections speed_viper Linux - Networking 1 03-29-2005 05:24 PM
Multiple simultaneous VPN connections? chamitha Linux - Networking 3 08-29-2002 01:28 AM
VPN Connections itguy Linux - Security 2 05-02-2002 04:10 PM


All times are GMT -5. The time now is 03:18 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration