Bridge two local networks

Posted on 2004-10-10
Last Modified: 2010-08-05
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...

Question by:andrewjb
  • 6
  • 4

Expert Comment

ID: 12272669
Just visit and you will figure out everything you want to know

LVL 12

Author Comment

ID: 12273058
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???


Expert Comment

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

LVL 12

Author Comment

ID: 12275032
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?


Expert Comment

ID: 12275205
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

LVL 12

Author Comment

ID: 12277730
Right. ip_forwarding is enabled. I'm having trouble working out the appropriate ip route commands to use.. Any ideas?

Accepted Solution

reketnet earned 500 total points
ID: 12278586
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.

LVL 12

Author Comment

ID: 12279085
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 :-) ??
LVL 12

Author Comment

ID: 12279110

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

Author Comment

ID: 12279746
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...


Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
OpenVPN running on Ubuntu 14.4 x64 5 93
linux / python expert needed 3 93
Unix / Linux grid computing 5 157
is my large folder zipped corrupted 4 66
I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question