Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
ip_and_network [2014/10/26 19:53] admin created |
ip_and_network [2019/02/17 19:21] (current) admin [Static IP Address] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ---- | + | ===== IP and Network configuration |
| - | **IP and Network configuration** | + | |
| - | ---- | + | |
| - | **Set the SSH connection** | + | ==== Enable |
| - | + | In Raspian Jessie it should be activated allready. If not enable | |
| - | For activating | + | |
| $ sudo raspi-config | $ sudo raspi-config | ||
| - | In 8. Advanced Options you can activate SSH | + | In 8. Advanced Options you can activate SSH. |
| ---- | ---- | ||
| - | **Fix IP Address** | + | ==== Static |
| + | Look up your gateway: | ||
| + | $ netstat -r -n | ||
| + | Find you IP address: | ||
| $ ifconfig | $ ifconfig | ||
| - | Give the Raspberry Pi an IP address. Open the interfaces file: | + | or: |
| + | $ ip addr | ||
| + | Give the Raspberry Pi a static | ||
| $ sudo nano / | $ sudo nano / | ||
| - | Add these lines after " | + | Add these lines: |
| + | # Ethernet | ||
| + | iface eth0 inet dhcp | ||
| + | allow-hotplug eth0 | ||
| + | auto eth0:1 | ||
| + | iface eth0:1 inet static | ||
| + | address 192.168.0.199 | ||
| + | netmask 255.255.255.0 | ||
| + | gateway 192.168.0.1 | ||
| + | Or: | ||
| + | # Ethernet | ||
| + | allow-hotplug eth0 | ||
| + | iface eth0 inet static | ||
| + | address 192.168.0.199 | ||
| + | netmask 255.255.255.0 | ||
| + | gateway 192.168.0.1 | ||
| + | dns-nameservers 192.168.0.1 | ||
| + | |||
| + | Save and quit, ctl+o, Return, ctl+x.\\ | ||
| - | auto eth0:1 | + | Disable the DHCP-Client:\\ |
| - | iface eth0:1 inet static | + | In Raspbian Wheezy: |
| - | address 192.168.0.111 | + | $ sudo service dhcpcd stop |
| - | netmask 255.255.255.0 | + | $ sudo update-rc.d -f dhcpcd remove |
| + | |||
| + | In Raspbian Jessie: | ||
| + | $ sudo service dhcpcd stop | ||
| + | $ sudo systemctl disable dhcpcd | ||
| - | Restart ethernet | + | Restart ethernet: |
| - | $ sudo ifdown eth0 | + | $ sudo ifdown eth0:1 |
| - | $ sudo ifup eth0 | + | $ sudo ifup eth0:1 |
| + | |||
| + | Or/and reboot: | ||
| + | $ sudo reboot | ||
| + | |||
| + | ==== Login over SSH ==== | ||
| + | One can login from your computer with: | ||
| + | $ ssh pi@192.168.0.199 | ||
| + | or with XWindows support: | ||
| + | $ ssh -XY pi@192.168.0.111 | ||
| + | PW: raspberry\\ | ||
| + | Or install an VNC server: [[vnc|VNC]] | ||
| ---- | ---- | ||
| - | **Login over SSH**\\ | ||
| - | One can login with: | + | ==== Miscellaneous ==== |
| - | $ ssh duino-pi@192.168.0.111 | + | If the host key verification failed, one can remove the old key with:\\ |
| - | or with XWindows | + | $ ssh-keygen -R 192.168.0.123 |
| - | | + | And with\\ |
| - | PW: raspberry\\ | + | ~. |
| + | one can terminate a broken | ||
| + | ---- | ||