LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-11-2010, 10:01 AM   #1
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Ubuntu 12.04 X86_64
Posts: 958

Rep: Reputation: 35
firewall with multiple possible interfaces


I would like a basic firewall on my netbook and first attempted this by using firestarter as i have no experience in writing IPTABLES rules from first principle and to be honest the syntax looks horrific!

the problem with firestarted is that when i selected WLAN0 to be the internet connected port everything worked fine until i connected to a VPN at which nothing would work (the only error i got was when pinging an IP address when i got sendmsg not permitted)

my normal setup is this....

normally im connected via WLAN0 to the internet. but one one particular network i must activate the VPN to use anything, this creates another interface tun0. both wlan0 and tun0 will be assigned an ip address but only the tun0 will do anything (the wlan0 one is configured by the network to just allow traffic to the vpn gateway and nothing else)


what i really need is some way of creating a basic firewall (drop all incomming except ports i specify) that lives on wlan0 unless tun0 is active in which case it moves to tun0

any ideas?
 
Old 03-12-2010, 07:58 AM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,452
Blog Entries: 11

Rep: Reputation: 182Reputation: 182
Depending on how you create the VPN i would just start a script that changes the iptable rules to use tun0 instead of wlan0.
Nother would be udev. But I doubt that I get triggers when creating a tun/tap device. But might be.

I would just create two scripts with firestarter. One for wlan0 and one for tun0. Either activate them manual or with the way described above.

Hope that helps
 
Old 03-12-2010, 08:18 AM   #3
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Ubuntu 12.04 X86_64
Posts: 958

Original Poster
Rep: Reputation: 35
i dont think firestarted lets me have 2 sets of scripts and i dont understand iptables enough to do it manually,

also i start the vpn service using network-manager-vpnc
 
Old 03-12-2010, 08:41 AM   #4
slackwaredanny
Member
 
Registered: Feb 2010
Location: Sweden
Distribution: Slackware
Posts: 88
Blog Entries: 3

Rep: Reputation: 20
AlienBoB has an Firewallgenerator for iptables thats awesome works like a charm on my netbook,but theres a lot of treads on this forum about it i guess.
But i would really like an slackwarefirewall gui based app like gufw whith out messing with slackbuilds and libs. so ay tips from any one?
 
  


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
multiple bonds = multiple primary interfaces? turbo_acura Linux - Server 1 02-17-2009 11:15 AM
Firewall : Multiple external interfaces rlore Linux - Security 2 06-28-2005 09:18 PM
Multiple WAN interfaces (FreeBSD Firewall) mxk *BSD 4 03-17-2005 11:21 AM
Red Hat 7.3 and multiple gateways on multiple interfaces bluefmc Linux - Networking 2 11-19-2004 05:01 PM
Iptables firewall in multiple lan interfaces Neelesh Linux - Security 3 07-31-2004 01:19 PM


All times are GMT -5. The time now is 09:45 PM.

Main Menu
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