I am setting up a web server on my raspberry pi. I want to connect it to my router via ethernet (static ip) but if the ethernet is disconnected I want it to automatically start using the wifi (static ip).
The eth0 static ip definition works but my wifi static ip definition does not. My router ends of confused with the wifi ip and either doesn't give an ip address at all or uses dhcp.
I have researched the /etc/network/interfaces but I haven't found a thorough tutorial and I'm left with other specific questions in addition to my main objective.
Here is my current /etc/network/interfaces file.
source-directory /etc/network/interfaces.d
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.66
netmask 255.255.255.0
network 192.168.1.64
broadcast 192.168.1.253
gateway 192.168.1.254
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface home inet static
address 192.168.1.68
netmask 255.255.255.0
network 192.168.1.64
broadcast 192.168.1.253
gateway 192.168.1.254
iface default inet dhcp
Here is my /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=CA
network={
ssid="r0uter"
psk="Xxxxxxxx"
key_mgmt=WPA-PSK
id_str="home"
}
**Why is my router using DHCP on my server's wlan0 instead of using my static ip definition?
What is the purpose of iface lo inet loopback? And what would happen if I left it out?
What is the purpose of auto eth0 or auto lo or auto wlan0?
What is the purpose of allow-hotplug wlan0 and what would happen if I left it out?**
Thanks for any help.

