I've been running my Pi on a WiFi dongle for quite some time with a static IP address set in /etc/hosts, and it seems happy, but in due course, I want to move it over to a wired connection, with a static IP address.
After a bit of googling, I found out that I need to edit my /etc/network/interfaces file, which I've now done :
auto lo
iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.1.105 netmask 255.255.255.0 gateway 192.168.1.254 network 192.168.1.0 broadcast 192.168.1.255
allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp
And that works fine on a wired connection.
However, when I unplug the network cable and plug the dongle back in (and reboot), it doesn't want to play (I can't ping it, and it can't ping outwards). A bit more reading suggested a further edit to the file to give :
auto lo
iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.1.105 netmask 255.255.255.0 gateway 192.168.1.254 network 192.168.1.0 broadcast 192.168.1.255
allow-hotplug wlan0 iface wlan0 inet static address 192.168.1.105 netmask 255.255.255.0 gateway 192.168.1.254 network 192.168.1.0 broadcast 192.168.1.255
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp
But It still doesn't work.
If the dongle is plugged in with the upper interfaces file in use, it flashes, but running ifconfig gives :
eth0 Link encap:Ethernet HWaddr b8:27:eb:49:2a:e5 inet addr:192.168.1.105 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:54 errors:0 dropped:1 overruns:0 frame:0 TX packets:126 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:4661 (4.5 KiB) TX bytes:8792 (8.5 KiB)
lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:36 errors:0 dropped:0 overruns:0 frame:0 TX packets:36 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:3168 (3.0 KiB) TX bytes:3168 (3.0 KiB)
wlan0 Link encap:Ethernet HWaddr 80:1f:02:82:aa:e0 inet addr:192.168.1.114 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:122 errors:0 dropped:127 overruns:0 frame:0 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:17909 (17.4 KiB) TX bytes:1176 (1.1 KiB)
Whereas when the lower one is in use, it doesn't flash. and ifconfig shows no errors.
So, how do I get it to work with the dongle again. With the Pi in its current location, WiFi is the preferred option (if only to reduce the amount of wiring running around the room).
Going back to the original interfaces file doesn't seem to be an option as I can't get it to work with that either.
TIA
Adrian