LinuxQuestions.org
Visit Jeremy's Blog.
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-31-2005, 06: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, 03:19 AM   #2
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
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, 09: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



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

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

All times are GMT -5. The time now is 07:17 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