Nishadh KA

LAN based Internet problem and th Raspberry Pi and solution

2014-07-02


  1. LAN based internet for Raspberry pi (RPi) is not on the go, the netsat, network interfaces has to be edited, and also based on the gateway of server it has to be changed
  2. The current case used server was TP-LINK MR3420, it is a single small board computer based 3G modem, wireless device, its gateway address is 192.168.0.254. A 3G dongle connected with device and LAN from this device connected to RPi.
  3. The Ip address addition on SD card has to be 192.168.0.100, and it is from other LAN connection to this wireless device having a similar address and gives automatically by the wireless device.
  4. Even with this, no internet was pinging, a possible cause would be DHCP was removed, and static gets invoked
  5. for example, the netstat -nr will show up only the

    Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
    192.168.0.0     *         255.255.255.0   U         0 0          0 eth0
    

    without UG flag from, that means no gateway, no way to access the internet.

  6. the solution is to add following entries in pi@raspberrypi ~ $ cat /etc/network/interfaces

    auto lo
    
    iface lo inet loopback
    iface eth0 inet static
    address 192.168.0.100
    netmask 255.255.255.0
    gateway 192.168.1.1
    
    
    allow-hotplug wlan0
    iface wlan0 inet manual
    wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
    iface default inet dhcp
    

    and in

    pi@raspberrypi ~ $ cat /etc/resolv.conf
    
    DNS 218.248.240.179
    nameserver 218.248.240.179
    

    and invoke

    sudo /sbin/route add -net 0.0.0.0 gw 192.168.0.254 eth0
    sudo /sbin/route add -net 0.0.0.0 gw 192.168.1.1 eth0
    
  7. it makes three lines in netstat table with these gateway address, after this the google was getting pinged

Reference

  1. http://raspberrypi.stackexchange.com/questions/7624/setting-a-static-eth0-ip
  2. http://raspberrypi.stackexchange.com/questions/7146/static-local-ip-gateway-config-on-startup-issues
  3. http://www.soslug.org/wiki/getting_your_raspberry_pi_to_run_on_a_static_ip_with_internet
  4. http://www.penguintutor.com/linux/raspberrypi-webserver
  5. http://pihw.wordpress.com/guides/direct-network-connection/
  6. http://www.penguintutor.com/linux/raspberrypi-headless