LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Wireless Networking (https://www.linuxquestions.org/questions/linux-wireless-networking-41/)
-   -   Wireless - Wired bridge while still being usable? Other network questions too.... (https://www.linuxquestions.org/questions/linux-wireless-networking-41/wireless-wired-bridge-while-still-being-usable-other-network-questions-too-215570/)

etherag 08-09-2004 08:23 PM

Wireless - Wired bridge while still being usable? Other network questions too....
 
Hi,

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.


Thanks,

Dan the Newb

Tinkster 08-09-2004 08:43 PM

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.


Cheers,
Tink

zaphodiv 08-09-2004 10:13 PM

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.

etherag 08-11-2004 09:07 PM

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 0.0.0.0
ifconfig eth0 0.0.0.0
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 0.0.0.0.bootpc, 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 192.168.0.0/16 -j ACCEPT
iptables -A FORWARD -i wlan0 -o eth0 -d 192.168.0.0/16 -j ACCEPT

That didn't seem to work. it doesn't look like the 0.0.0.0.bootpc 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?

Thanks,

Dan (the newb)

leongtyngwey 08-23-2004 12:13 PM

etherag,
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!

Yogi

MatthewSabin 08-27-2004 08:28 AM

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 255.255.255.0 up

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

--Matthew

leongtyngwey 08-27-2004 09:37 AM

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!


Yogi


All times are GMT -5. The time now is 09:28 AM.