Solved

Bridge two local networks

Posted on 2004-10-10
10
348 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Only Allow Access to an HTTPS webpage via Squid Proxy 7 364
Help with Ubuntu 14.04 LTS 10 139
linux 2 110
Linux Networking : What is of bond interface & when it will be useful 18 123
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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