Raspberry: Difference between revisions

From 太極
Jump to navigation Jump to search
Line 15: Line 15:
* [http://mindplusplus.wordpress.com/2012/07/31/a-month-with-raspbian/ A month with raspbian] How to change date/time.
* [http://mindplusplus.wordpress.com/2012/07/31/a-month-with-raspbian/ A month with raspbian] How to change date/time.
* My [https://www.youtube.com/watch?v=xWJZRK4W13Q&feature=youtube_gdata_player youtube video] demostrating GPIO function.
* My [https://www.youtube.com/watch?v=xWJZRK4W13Q&feature=youtube_gdata_player youtube video] demostrating GPIO function.
* [http://m.linuxjournal.com/content/n900-slice-raspberry-pi?page=0,1 N900 as a remote display
* [http://m.linuxjournal.com/content/n900-slice-raspberry-pi?page=0,1 N900 as a remote display]


= Get internet from sharing the internet from another machine =
= Get internet from sharing the internet from another machine =

Revision as of 08:33, 7 March 2013

Raspberry Pi

Miscellaneous

Get internet from sharing the internet from another machine

  • https://wiki.archlinux.org/index.php/Internet_Share
  • static iP. Set up host eth0 IP and then set up RPi IP:
    • In Windows, allow Internet sharing. An IP of 192.168.0.2 will be automatically assigned to the Laptop's network card. Make static IP of 192.168.0.2 in Rasp Pi. Enter subnet mask and gateway (192.168.0.1). Also make an entry in /etc/resolv.conf with nameserver=192.168.0.1. Reboot and Rasp Pi will get Net all right.
    • In Linux, An IP of 10.42.0.37 will be assigned to eth0 card. Make static IP of 10.42.0.37 in Rasp Pi. Enter subset mask and gateway (10.42.0.1). Also make an entry in /etc/resolv.conf with nameserver=10.42.0.1. Reboot and Rasp Pi will get Net all right.
    • Other thoughts:
sudo nano /etc/network/interfaces

iface eth0 inet static
address 192.168.100.1
netmask 255.255.255.0
network 192.168.100.0
broadcast 192.168.100.255
gateway 192.168.100.254

The gateway is important and in most cases will always point to your firewalls, switch or routers IP address.

In my current setting, the host machine's eth0 has IP 10.42.0.1 (inet addr). The RPi has IP 10.42.0.37 and gateway 10.42.0.1.

$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 wlan0
10.42.0.0       0.0.0.0         255.255.255.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 wlan0
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 wlan0

And /etc/resolv.conf may be worth to be changed too. /etc/hostname and /etc/hosts are unnecessary.

An example of /etc/resolv.conf (set up linux DNS) shown from my RPi is

nameserver 10.42.0.1

But maybe another choice is nameserver 8.8.8.8.