LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-23-2013, 03:47 PM   #1
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,859
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Connecting subnets with Raspberry Pi wireless access point


So, I am using a Raspberry PI Model B (256) with the latest raspbian image as a wireless bridge for an entertainment center with an ethernet port. The Pi connects to the LAN wirelessly and the eth0 port is "shared with other computers" via NetworkManager.

From ps aux | grep dnsmasq, I see that dnsmasq (apparently started by NetworkManager) provides an IP of 10.x.x.x to the entertainment center. The LAN has the usual 192.168.x.x IP space, provided via DHCP from a router.

So far so good, the entertainment center can get internet radio and connects to the internet. From the Pi, I can ping the entertainment center and anyone on the LAN.

But I cannot ping the entertainment center from anyone else on the LAN. What I would like is to drop the NAT on the Pi so that the entertainment center is visible to the entire LAN. Any ideas?

There are google results for achieving this result for various routers, but I'm not sure how to do it with the Pi/using debian and NetworkManager.
 
Old 07-27-2013, 03:14 AM   #2
Pyplate
LQ Newbie
 
Registered: Jun 2013
Location: Worcestershire, UK
Distribution: Ubuntu,lubuntu,raspbian
Posts: 17
Blog Entries: 30

Rep: Reputation: Disabled
Did you set up NAT on the Pi yourself? I don't think it's enabled by default.
 
Old 07-27-2013, 11:02 AM   #3
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,859

Original Poster
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Hey, thanks for responding!

I went to NetworkManager and enabled "shared with other computers" on eth0, which apparently starts dnsmasq. I presume that NAT is set up by default.

ps aux | grep dns gives the following:

Code:
nobody    3727  0.0  0.4   3208   780 ?        S    Jul20   0:00 /usr/sbin/dnsmasq --conf-file --no-hosts --keep-in-foreground --bind-interfaces --except-interface=lo --clear-on-reload --strict-order --listen-address=10.42.0.1 --dhcp-range=10.42.0.10,10.42.0.100,60m --dhcp-option=option:router,10.42.0.1 --dhcp-lease-max=50 --pid-file=/var/run/nm-dnsmasq-eth0.pid
wheras ifconfig is

Code:
eth0      Link encap:Ethernet  HWaddr b8:27:eb:de:71:3a  
          inet addr:10.42.0.1  Bcast:10.42.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:245479 errors:0 dropped:0 overruns:0 frame:0
          TX packets:245287 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:11472453 (10.9 MiB)  TX bytes:336961177 (321.3 MiB)

wlan0     Link encap:Ethernet  HWaddr 08:86:3b:f4:36:53  
          inet addr:192.168.1.19  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2519345 errors:0 dropped:2524602 overruns:0 frame:0
          TX packets:394934 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:838731227 (799.8 MiB)  TX bytes:49001496 (46.7 MiB)
So you see I ssh into the pi at 192.168.1.19, where I can ping everyone, including folks on 10.42.0.x and 192.168.1.x, however I can't ping 10.42.0.x from 192.168.1.199 (another computer)

I got the instructions at http://www.raspberrypi.org/phpBB3/vi...25268&p=270912

I tried setting up a bridge in the past on the pi (not on this install) but it didn't work consistently and didn't allow me to ssh in. Obviously I had something not right or my wifi adapter was incapable of bridging, so I used the suggestion above which seems to work great, except for the part where I don't know how to connect the subnets.
 
Old 07-27-2013, 05:56 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
You'll need to set the Pi up to be a router and configure the routing tables on your other machines to use 192.168.1.19 as their gateway to access the 10.42.0.0/24 subnet. If you Google around for Linux router or the like, the instructions are pretty easy to find (since you're not doing NAT, it will be easy -- basically just set net.ipv4.ip_forward = 1 in your sysctl variables, IIRC). Then you'll need to use the "route" command on your other machines, something like:

Code:
route add -net 10.42.0.0 netmask 255.255.255.0 gw 192.168.1.19
This assumes your other machines are running Linux. The command is slightly different under Windows as per this Microsoft documentation page. If you want to add the route permanently, there are ways to do it (they vary by distro, but you can always just put the route command in your /etc/rc.local script.
 
Old 07-27-2013, 07:20 PM   #5
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,859

Original Poster
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Well OK, I'll try again.. the problem is, there are so many different instructions of so many different eras, most using iptables or outdated and not using NetworkManager. I'm kind of a network idiot, and have tried googling and trying a dozen different "solutions" so far without success using iptables... the thing is, most instructions assume the machine will be the router for the network and handling the internet connection, but I have a router that does that job and provides DHCP already. So I was hoping someone had a simple answer to this. [/end of whining]

BTW, I did try adding the route to my main desktop, and it certainly sends the appropriate path to 192.168.1.19 when I try to ping 10.42.0.x, so I tried adding echo "1"> /proc/sys/net/ipv4/ip_forward to my pi, but that didn't help get rid of Destination Port Unreachable. I didn't think it would, as I'm not using iptables. What I'd really like to do is make the 10.42.0.x machine, which is an entertainment center, visible on the network so my iphone's (on 192.168.1.x) app which controls it can see it. So the solution can't involve changing the route on every machine, as that will be impossible on the iphone. The solution has to involve just the pi.

Last edited by mostlyharmless; 07-27-2013 at 07:21 PM.
 
Old 08-03-2013, 12:43 PM   #6
MikeDeltaBrown
Member
 
Registered: Apr 2013
Location: Arlington, WA
Distribution: Slackware
Posts: 96

Rep: Reputation: 10
I don't see the need for the Pi to be in between the entertainment center and the rest of your network. Just plug your entertainment center into your switch and plug your Pi into your switch. This will solve half of your problem; the rest of your network will have access to the entertainment center since everything will be in the same broadcast domain.

The second half of the problem is to provide a wireless access point. You could use a commercial AP in bridged mode, your modem/gateway may already have wireless enabled, or you could setup your Pi to be an access point.

'"shared with other computers" via NetworkManager' is starting dnsmasq and configuring NAT. You don't want that for a bridge. The most common mistake I see when people try to setup bridging on Linux is they configure the individual interfaces (eth0, wlan0, or ???) which you should not do. If you must enter something in NetworkManager use all zeros for address/netmask for the physical interfaces (0.0.0.0/0.0.0.0). Create the bridge and include the 2 interfaces. Then configure the bridge interface (ie. br0) to get an address, either via dhcp or statically. I can't help you with the details of NetworkManager as I don't use it, but the fundamental info here should get you started in the right direction.
 
Old 08-04-2013, 11:21 AM   #7
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Manjaro, might try Slackware again
Posts: 1,859

Original Poster
Blog Entries: 14

Rep: Reputation: 284Reputation: 284Reputation: 284
Thanks for pitching in. However, I'm not sure I explained the problem correctly. The entertainment center is nowhere near the switch, in fact, there is no switch, nor is the router (which could act as a switch) accessible by or relocatable to the entertainment center. The only reason the pi is connected to the entertainment center is to provide a connection to the network, via the only route available, wireless. I'm trying to get the pi to behave like a wireless extender; ie make an existing wireless network available to a wired connection.

I could just buy a wireless extender with a built in switch (eg an Amped wireless extender SR30000), but I have the pi already there; it should be able to do the job... and it is much cheaper.

A wireless access point, which makes a wired network available to wireless devices, is unnecessary; I have a wireless router which already covers the area sufficiently.

The bridge idea using bridge utils and br0 is a good idea; I previously followed the tutorial in LinuxPro that was published a few months ago, but it did not work (i.e. no connection) and gorked up ssh access to the pi also, making diagnosis of the problem difficult. I'm not sure why; I have tried other "simple" tutorials on bridges and none of them work as advertised... perhaps there's an incompatibility with my wireless adapter. That is why I finally used NetworkManager: it actually worked.. except that as you point out, it configures NAT, which I don't want.

If anyone has successfully used a bridge on a pi, and has a link to the instructions on how they did it, let me know. I am running raspbian with xbmc.

[EDIT: I added a static path to 10.42.0.0 to my router; so I can ping the 10.42 network; still no joy on pinging the entertainment center though.]

Last edited by mostlyharmless; 08-04-2013 at 11:25 AM.
 
Old 08-04-2013, 07:32 PM   #8
911InsideJob
Member
 
Registered: Jul 2013
Distribution: Mint KDE
Posts: 74

Rep: Reputation: Disabled
I'm not familiar with all your hardware but if you're looking for a cheap hardware bridge check out "wireless game adapters." I boolshiat you not. My Netgear setup is via simple web interface, then you just plug into the entertainment center and it'll connect wireless to your PI or AP or whatever device is running your wireless LAN. Works great with IP printers too.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem connecting to access point wes_jin Linux - Newbie 1 06-16-2006 08:04 PM
connecting to more than one access point mohama Linux - Wireless Networking 1 12-05-2005 10:51 PM
Connecting to a wireless access point automatically on startup timelord726 SUSE / openSUSE 2 09-30-2005 08:52 PM
Help connecting to wireless access point djh00ligan Linux - Wireless Networking 1 08-18-2005 03:08 PM
Wireless card not connecting to Access Point looks configured though embalmedlenin Linux - Wireless Networking 6 08-13-2005 08:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration