0

I followed this post to connect my Raspberry Pi (an ARM-based computer) to my PC via crossover cable to use wifi connection of my PC (openSUSE 11.4): (UPDATE: now I have openSUSE 12.1)

http://forums.opensuse.org/english/get-technical-help-here/network-internet/454678-how-create-network-bridge-2.html#post2295540

I can login via SSH to my Raspberry Pi, but once i'm logged,i can't ping or connect to any website (using curl), so don't have internet :S. I can only ping from my host PC to Raspberry, and inverse. When i try to ping from Raspberry Pi to google, it seems that only resolve the DNS:

PING www-cctld.l.google.com (74.125.227.151) 56(84) bytes of data. ^C --- www-cctld.l.google.com ping statistics --- 4 packets transmitted, 0 received, 100% packet loss, time 3005ms

This is my configuration of ifconfig of eth0 on my PC:

   eth0      Link encap:Ethernet  HWaddr 00:0A:E6:8D:0D:C8  
              inet addr:10.42.43.1  Bcast:10.42.43.255  Mask:255.255.255.0
              inet6 addr: fe80::20a:e6ff:fe8d:dc8/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:2788 errors:0 dropped:0 overruns:0 frame:0
              TX packets:8798 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:360479 (352.0 Kb)  TX bytes:527266 (514.9 Kb)
              Interrupt:11 Base address:0x8a00 

and this one on my device:

eth0      Link encap:Ethernet  HWaddr b8:27:eb:a6:1f:94  
          inet addr:10.42.43.55  Bcast:10.42.43.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6785 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2858 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:403164 (393.7 KiB)  TX bytes:401626 (392.2 KiB)

What i forgot to do? A firewall rule?

Mr_LinDowsMac
  • 295
  • 1
  • 10
  • 21
  • Is the RPi supposed to be on the same network as the wireless router (bridged)? Or is the Linux box supposed to be routing? Or is the Linux box supposed to be masquerading? To figure out why it's not working, one must first understand how it's supposed to work. – David Schwartz Aug 15 '12 at 09:50
  • My PC is connected via Wifi (wlan0) to the router/DSL modem, but it seems there's just a network between my PC and my RPi (because i'm using the crossover cable). My PC will share the connection to the RPi. Not sure if that answer your question. – Mr_LinDowsMac Aug 15 '12 at 09:59
  • Your question is off topic for Serverfault because it doesn't appear to relate to servers/networking or desktop infrastructure in a professional environment. It may be on topic for [raspberrypi](http://raspberrypi.stackexchange.com/) but please [search](http://raspberrypi.stackexchange.com//search) their site for similar questions that may already have the answer you're looking for. – user9517 Oct 08 '12 at 08:45

1 Answers1

1

You cannot bridge to a WiFi client connection. The PC will have to do masquerading if you want it to provide Internet access to the RPi.

David Schwartz
  • 31,449
  • 2
  • 55
  • 84
  • Yeah, i was figuring out that here: http://www.ibiblio.org/pub/linux/docs/HOWTO/other-formats/html_single/Masquerading-Simple-HOWTO.html ,i'm not familiar with iptables or masquerading or ip-forwarding, any help on this will be appreciated :) – Mr_LinDowsMac Aug 15 '12 at 09:51
  • Are you trying to create a separate private network between the PC and the RPi? If so, either the Linux box has to masquerade, or the wireless router has to know to forward packets bound for that private network to the PC with a specific IP route table entry. – David Schwartz Aug 15 '12 at 09:52
  • I don't have access to the wireless router, so i assume that has to masquerade – Mr_LinDowsMac Aug 15 '12 at 10:06
  • Yes. If you can't access the router, then you can't add a routing entry and you can't change the Wifi connection to something other than client. So you have to masquerade. If you set up masquerading, it should work. – David Schwartz Aug 15 '12 at 10:07
  • I make this working some time ago, unfortunetly i had to update my OS and all this configuration was gone. I don't know exactly what i did, but i make it work again yesterday. Now today, i trying to have internet in my RPi, and i don't have :( – Mr_LinDowsMac Oct 04 '12 at 05:15
  • I also noticed that everytime when I reboot my RPi, on my PC the file /proc/sys/net/ipv4/ip_forward back to '0' value again. – Mr_LinDowsMac Oct 04 '12 at 05:18
  • It sounds like you're just not configuring it correctly. Some distributions use `/etc/sysctl.conf`. – David Schwartz Oct 04 '12 at 05:20
  • I also activated IP_Forwarding with the /etc/sysconfig editor of Yast in OpenSUSE, let me try with the file you say. – Mr_LinDowsMac Oct 04 '12 at 05:28
  • I set "net.ipv4.ip_forward = 1 " in /etc/sysctl.conf and reboot my RPi. Same situation: When I try to make ping from my RPi to google, i just send packages but I can't receive. – Mr_LinDowsMac Oct 04 '12 at 05:34
  • You don't need to enable forwarding in the pi, it's not doing any forwarding. You need to enable masquerading in the PC (and also forwarding). The PC needs to masquerade for the pi. – David Schwartz Oct 04 '12 at 05:46
  • That's i want to do. I didn't configured anything on the RPi – Mr_LinDowsMac Oct 04 '12 at 05:59
  • I don't get it :( – Mr_LinDowsMac Oct 04 '12 at 06:35
  • @Iain Why you close the topic???, is a networking issue!!! – Mr_LinDowsMac Oct 08 '12 at 09:30