LAN based Internet problem and th Raspberry Pi and solution
2014-07-02
- 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
- 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.
- 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.
- Even with this, no internet was pinging, a possible cause would be DHCP was removed, and static gets invoked
for example, the
netstat -nr
will show up only theDestination 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.
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
it makes three lines in netstat table with these gateway address, after this the google was getting pinged
Reference
- http://raspberrypi.stackexchange.com/questions/7624/setting-a-static-eth0-ip
- http://raspberrypi.stackexchange.com/questions/7146/static-local-ip-gateway-config-on-startup-issues
- http://www.soslug.org/wiki/getting_your_raspberry_pi_to_run_on_a_static_ip_with_internet
- http://www.penguintutor.com/linux/raspberrypi-webserver
- http://pihw.wordpress.com/guides/direct-network-connection/
- http://www.penguintutor.com/linux/raspberrypi-headless