Skip to content

Instantly share code, notes, and snippets.

Created June 7, 2016 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/74c8f28b778688762d758840c55464c3 to your computer and use it in GitHub Desktop.
Save anonymous/74c8f28b778688762d758840c55464c3 to your computer and use it in GitHub Desktop.
On host /etc/network/interfaces
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
#Line below doesn't work, hangs the system on startup
#iface eth0 inet6 dhcp
auto usb0
allow-hotplug usb0
iface usb0 inet static
address 192.168.123.111
netmask 255.255.255.0
On Pi Zero /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
auto usb0
allow-hotplug usb0
iface usb0 inet static
address 192.168.123.111
netmask 255.255.255.0
gateway 192.168.123.156
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
$ sudo ip route show dev usb0
192.168.123.0/24 proto kernel scope link src 192.168.123.111
$ sudo ip a && sudo ip route
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:ac:6f:2e:69:3c brd ff:ff:ff:ff:ff:ff
inet 192.168.123.156/24 brd 192.168.123.255 scope global dynamic eth0
valid_lft 41932sec preferred_lft 41932sec
inet6 fe80::baac:6fff:fe2e:693c/64 scope link
valid_lft forever preferred_lft forever
5: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 12:2d:9e:ce:05:eb brd ff:ff:ff:ff:ff:ff
inet 192.168.123.111/24 brd 192.168.123.255 scope global usb0
valid_lft forever preferred_lft forever
default via 192.168.123.254 dev eth0
default via 192.168.123.254 dev eth0 proto static metric 1024
192.168.123.0/24 dev eth0 proto kernel scope link src 192.168.123.156
192.168.123.0/24 dev usb0 proto kernel scope link src 192.168.123.111
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment