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 04-10-2010, 02:47 PM   #1
chrysolidocarpu
LQ Newbie
 
Registered: Jun 2009
Location: Netherlands
Distribution: Debian
Posts: 4

Rep: Reputation: 0
Debian Iptables 3 nic bridge


Hey all,
I'm a noob with a networking Question. the question in essence is "how do i do this with iptables?"

the situation is as follows;
I have a server running debian with a 2.6 kernel. 3 nics, eth0, eth1 and ath0.

eth0 has a static ip of 10.0.0.150
eth1 has a static ip of 192.168.16.1
ath0 has a static ip of 192.168.1.1

eth0 is connected to a router (ip 10.0.0.138) which maintains an internet connection
ath0 is a wireless card running in AP mode.
eth1 and ath0 have a dhcpd server running on it so clients that connect to it get an ip.

how do i transparently bridge ath0 and eth1 to form one network, and how do i allow computers connected to both the ath0 and eth1 to connect tot he internet through eth0. I'd love to have eth0 also act as a firewall not allowing connections comming from the internet but allowing everything to come from the internal lan (ath0/eth1)

can anyone give me a few pointers? I'm not really good at networking and i'm kinda stumped on how iptables works (yes i did read the manual).

thanks in advance.

Last edited by chrysolidocarpu; 04-10-2010 at 03:00 PM.
 
Old 04-10-2010, 04:34 PM   #2
TimothyEBaldwin
Member
 
Registered: Mar 2009
Posts: 249

Rep: Reputation: 27
For a start you don't use iptables on your Debian system, except if you want it to be a firewall. You can't have different IP address or subnets for ath0 and eth1 if you bridge them.

Install bridge-utils.
Read the manpage bridge-utils-interfaces.
Disable eth1 and ath0 using "ifdown eth1 ath0"
Configure the bridge in /etc/network/interfaces, deleting the configuration for eth1 and ath0.
Bring up the bridge using "ifup br0" or similar.
Edit /etc/sysctl.conf to enable IP forwarding.
For immediate effect: "echo 1 > /proc/sys/net/ipv4/ip_forward"
Set up the DHCP server for the bridge.

Add a route table entry to the other router.

As for firewalling, is your other router sufficient? What is your IPv6 policy?

For IPv4 the following should work:
Code:
iptables -N block
iptables -A block -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A block -i eth0 -j REJECT
iptables -I INPUT -j block
iptables -I FORWARD -j block
 
  


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
prtconf -pv shows nic as a Bridge device ? Fredsnet Solaris / OpenSolaris 6 12-24-2010 02:39 PM
bridge-utils / dnsmasq / iptables / debian => internet sharing problems cocchiararo Linux - Networking 5 09-17-2009 07:27 PM
bridge 2 NIC rrs_matrix Linux - Networking 1 10-20-2005 05:24 AM
NIC Configuration and bridge problem Fonk Red Hat 0 05-24-2004 02:09 AM
NIC Configuration and bridge problem Fonk Linux - Networking 2 05-21-2004 02:36 AM

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

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