Solved

Bridge two local networks

Posted on 2004-10-10
10
361 Views
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...

Andrew.
0
Comment
Question by:andrewjb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 1

Expert Comment

by:reketnet
ID: 12272669
Just visit http://bridge.sourceforge.net/ and you will figure out everything you want to know


Regards,
0
 
LVL 12

Author Comment

by:andrewjb
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 192.168.1.199 So other machines on that network have IP of 192.168.1.* and gateway of 192.168.1.199, 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???

Hmm..
0
 
LVL 1

Expert Comment

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

Regards,
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Author Comment

by:andrewjb
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?

0
 
LVL 1

Expert Comment

by:reketnet
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 http://linux-ip.net/html/

regards,
0
 
LVL 12

Author Comment

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

Accepted Solution

by:
reketnet earned 500 total points
ID: 12278586
route add -net  "wireless network here like 192.168.1.0""  netmask 255.255.255.0 dev "here the wireless inteface, example wlan0"
route add -net "wired network like 192.168.2.0" netmask 255.255.255.0 dev "examples eth0"
now you can add the default gw so every packet not destined for your network goes there
route add default gw 192.168.1.199

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

regards
0
 
LVL 12

Author Comment

by:andrewjb
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 :-) ??
0
 
LVL 12

Author Comment

by:andrewjb
ID: 12279110

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

Gateway on the wireless side, to teh internet is 192.168.150.199

The linux router is .55 on both sides.



Details from 'route' :

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.151.0   *               255.255.255.0   U     0      0        0 eth0
192.168.150.0   *               255.255.255.0   U     0      0        0 wlan0
169.254.0.0     *               255.255.0.0     U     0      0        0 wlan0
default         192.168.150.199 0.0.0.0         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?
0
 
LVL 12

Author Comment

by:andrewjb
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 192.168.151.55 (wired side of the linux router)

2) Wireless side need to use:
   a) route for 192.168.151.* via 192.168.150.55 (wireless side of router)
and b) gateway of 192.168.150.199 (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...


0

Featured Post

Containers and Docker for Everyone

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

Question has a verified solution.

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

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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

705 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