Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 03-11-2010, 10:01 AM   #1
Registered: Oct 2005
Distribution: Ubuntu 12.04 X86_64
Posts: 960

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
Senior Member
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
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
Registered: Oct 2005
Distribution: Ubuntu 12.04 X86_64
Posts: 960

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
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?


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 > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:55 AM.

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