Bridge two local networks

I've two local (Windows) networks. One wireless, including internet ADSL access using NAT. The other wired.

Is the following possible?...

I've a linux box (Fedora2) with an ethernet card and a wireless card. I've finally got the wireless to talk to the current wireless network.

I'd like to

1)  Have the linux box share various  directories via SAMBA to both windows networks
2) Have the linux box serve a printer to both windows networks.
3) Act as a (bridge ? or router? ) to let the wireless network see the internet
4) Act as a bridge/router to let the two windows networks see each other i.e. so I can share files between the two windows networks.

I'm presuming I can manage to sort out (1) and (2) (or there will be more Qs later!)

Can I do (3) and/or (4), and if so, could you start by pointing me in the right direction, please.

Additional Qs can be opened if this spawns too many other issues...

LVL 12
Who is Participating?
reketnetConnect With a Mentor Commented:
route add -net  "wireless network here like""  netmask dev "here the wireless inteface, example wlan0"
route add -net "wired network like" netmask dev "examples eth0"
now you can add the default gw so every packet not destined for your network goes there
route add default gw

You should make the linux default gw for the wired network so packets not destined for go there.
Try this  and post here what happened.

Just visit and you will figure out everything you want to know

andrewjbAuthor Commented:
Hmm.. Had seen that before but didn't think it appropriate, but I've now given it a try.
Installs and sets up fine. The server can ping machine on both networks, and both networks can ping the server.
But I can't ping from one network (wired) to the other (wireless).

I think it could be down to the problem mentioned in the bridge. FAQ - some (most?) wireless cards don't support spoofing of the MAC address. Which means I'm not going to get this to work.

So, any other ideas? Either how to get the bridge to work, or can I just set it up as a router somehow? (If that's the right terminology)

e.g. if I set up wired to be 192.168.1.* and wireless to be 192.168.2.* can I get the linux to route .2.* to .1.* and vice-versa? And how to I set the machines? Does the default gateway just get set to be the linux box, which has _its_ default gateway set to be the ADSL box or something?

(At the moment, wireless network has the ADSL connection on So other machines on that network have IP of 192.168.1.* and gateway of, which all seems to work. I'd presume that the .1.* says the same, and the .2.* gets pointer to the new linux router (.2.50 for example) which somehow routes and default gateways over to the .1.199???

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Try searching the archives for the model of you wireless card, may be there is  a solution.

andrewjbAuthor Commented:
I can't find one for the "Cannot spoof MAC address" problem - looks like it's a firmware issue.

How about going the router setup route?

I think your ip_forwarding is enable so your linux can forward packets from one network to another. Check cat /proc/sys/net/ipv4/ip_forward if 0 it is turn off , if 1 it is on.
Then you can manipulate you route by route command , man route to see what you can do using route. You can enable advanced routing in your kernel and manipulate your routing using "ip route" command. Read this one

andrewjbAuthor Commented:
Right. ip_forwarding is enabled. I'm having trouble working out the appropriate ip route commands to use.. Any ideas?
andrewjbAuthor Commented:
Right. I believe that's what I've done. I've also, I think, turned off any other firewall on the linux box (so my ipchains are empty..)

From the linux box I can 'ping' things on both sides (wired and wireless). From the wired side I can ping _either_ of the addresses of the linux box. But I can't ping through to something on the wireless side. (and vice versa).

It looks like the routing isn't happening... What's next :-) ??
andrewjbAuthor Commented:

Current info. (The wired network is 192.168.151.*, wireless is

Gateway on the wireless side, to teh internet is

The linux router is .55 on both sides.

Details from 'route' :

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface   *        U     0      0        0 eth0   *        U     0      0        0 wlan0     *          U     0      0        0 wlan0
default         UG    0      0        0 wlan0

Is that it? Or do I need something to connect the two sides together? Or is the ip_forward flag supposed to do that?

??Any log files anywhere to see if I'm even spotting the incoming requests?
andrewjbAuthor Commented:
OK. Think I've got the bugger going.

Answer was:

1) Enable ip_forwarding (as mentioned above)
2) Set the routing as above

then, machines on:

1) Wired side need to use gateway of (wired side of the linux router)

2) Wireless side need to use:
   a) route for 192.168.151.* via (wireless side of router)
and b) gateway of (onto the internet)

I hit problems because the wireless AP and the ADSL modem both needed these gateway and routing settings, and I hadn't thought about that.
(The AP had a web interface to do it. The ADSL modem didn't support enough in it's web interface so I had to telnet in..)

Anyway, seems to work for the minute. Will leave this Q open for a day or three in case it breaks again...

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.