Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.


  Search this Thread
Old 08-09-2004, 08:23 PM   #1
LQ Newbie
Registered: Aug 2004
Posts: 15

Rep: Reputation: 0
Wireless - Wired bridge while still being usable? Other network questions too....


I'm kind of a newb, and I've been struggling to get my linux box to work exactly how I want.

Ignoring the reasons why, I need to set up a small network of computers that are far separated from my cable modem. I installed a wireless router, and I want to be able to use my linux box (in the process of becoming a myth TV box) as a bridge of sorts so that all other computers connected to the switch will have internet access. After much fumbling about, I got the wireless card and the 100bT card to work. This brings me to my questions. I've tried adding (what I thought were) the appropriate iptables lines, but they obviously weren't quite right. I also tried using brctl to bridge eth0 and wlan0, but this didn't work either. I couldn't access the internet from the computer, and my windows box on the switch couldn't reach the DHCP. Help would be much appreciated.

1) How do I set this computer up to still have internet access for itself, while also giving internet access to the other computers?

2) How do I modify the /etc/init.d/network so that it will startup my wireless card first, then start my ethernet card too? as it is, it tries to start eth0 first, fails becasue it can't reach the DHCP, then I have to manually start wlan0, then start eth0.


Dan the Newb
Old 08-09-2004, 08:43 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hi, and welcome to LQ!

I have moved his thread since it's is more suitable
in Linux-Networking wireless and to help your thread/question
get the exposure it deserves.

Old 08-09-2004, 10:13 PM   #3
Registered: Oct 2003
Distribution: Slackware
Posts: 388

Rep: Reputation: 30
Say what distro you are using.

If you linux box has an internet ip address bridging will not work. (unless your ISP has allocated you more than one ip address and your machines are using those ip's).

If there is a connection sharing box on the internet side of you linux box then bridging might work.

You need to configure the linux box to NAT the connection.
Read the old threads in the forum. We have covered this many times before.

we are not psychic, we don't know what iptables commands you have tried unless you tell us. Say exactly what you tried and what happened.
Old 08-11-2004, 09:07 PM   #4
LQ Newbie
Registered: Aug 2004
Posts: 15

Original Poster
Rep: Reputation: 0
First off, sorry.... this was my first post, didn't know exactly what to ask / information to give.

I use fedora core 2.

The cable modem is connected to the wireless access router, which is connecting to the linux box with no problems.

Here is what I have tried thus far:

first, I tried using brctl to just bridge the connections.

brctl addbr bridge
brctl addif wlan0
brctl addif eth0

ifconfig wlan0
ifconfig eth0
ifconfig bridge up

I tried this with iptables off, with the standard rules, and the with the rules flushed.
I also tried this both with 0 and with 1 in /proc/sys/net/ipv4/ip_forward
From what I could tell, some packets were definitely getting through, because tcpdumps from each interface had identical packets. All were from the mac address of my windows desktop, and were from, which I assume means they were DHCP requests. I coudn't pull an IP though. My laptop couldn't either.

Then I tried turning off bridgiing, and restarting wlan0 and eth0.

in IPtalbes I tried:

iptables -F

iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
iptables -A FORWARD -i eth0 -o wlan0 -d -j ACCEPT
iptables -A FORWARD -i wlan0 -o eth0 -d -j ACCEPT

That didn't seem to work. it doesn't look like the requests from the mac of my desktop are getting though. Still not pulling an IP. If I can, I'd like to be able to pull IPs from the router. Is that possible? do I need to setup a DHCP server on the linux box?


Dan (the newb)
Old 08-23-2004, 12:13 PM   #5
LQ Newbie
Registered: Aug 2004
Posts: 6

Rep: Reputation: 0
I'm having the same problem except that I'm trying to bridge 2 wired PCs instead of a wireless lan cos my switch that's connected to the adsl router ran out of ports. Not that I'm able to help but I'll be observing this thread eagerly and may post something if I get it up. Cheers!

Old 08-27-2004, 08:28 AM   #6
LQ Newbie
Registered: Mar 2003
Location: Middletown, CT, USA
Distribution: Mandrake, Xandros and Undead
Posts: 10

Rep: Reputation: 0
I'm confused about the other computers on the network (the ones you're trying to bridge) are they wired to the bridge, or wireless? If wireless, aren't they talking to the cablemodem over the wireless router?

To solve the internet connection for the bridge tho:

ifconfig bridge 192.168.x.1 up

will assign the bridge itself an IP address so that it can participate in the net.

Old 08-27-2004, 09:37 AM   #7
LQ Newbie
Registered: Aug 2004
Posts: 6

Rep: Reputation: 0
Hey etherag,
I've sorted my ethernet bridge and it works fine now with both my bridge machine and the other PC connected to it being able to pull IPs from my ADSL router.
I'm using Mandrake 10 and shorewall as my firewall. (there's a howto on the net on using shorewall and bridging).

Basically what I did was to configure my eth0 and eth1 not to start on boot and then I added a br0 (bridge device) which was to be booted up and uses DHCP to pull an IP from the router. In mandrake 10, the config files for eth0,eth1 and br0 would be in /etc/sysconfig/network-scripts . The scripts for eth0 and eth1 are already present if they have been started up before, you just need to add one for br0 in Mandrake. (Not too sure about FC2). After that, I just need to add a script in /etc/init.d to start the bridge each time I boot. The howto on shorewall and bridging provided a pretty good script that you can edit to suit your needs.

Hope this helps!



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
Howto bridge wireless and wired network interfaces? pohl886 Debian 11 07-19-2011 06:58 PM
join the two wired network with wireless alvi2 Linux - Wireless Networking 2 04-04-2005 12:02 PM
Wireless Access On Wired Network Terje Linux - Wireless Networking 1 02-03-2005 10:20 AM
do i have to bridge a wireless and wired connection on the same linux box ulto Linux - Wireless Networking 2 04-07-2004 12:37 PM
Wired/Wireless Bridge MMHein Linux - Wireless Networking 2 10-07-2003 01:44 AM > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 02:00 PM.

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