I have a new installation of YunoHost on a Raspberry Pi, and it’s ethernet connection is not plugged directly into the router (I don’t have much a choice), instead I’m going through two small unmanaged switches. The first couple days after installation, I was able to setup the network connection manually with:
# Check current configuration of Ethernet
# ifconfig eth1 down for stop the network card
ifconfig eth1 down
# ifconfig eth1 up for bringing up the network card
ifconfig eth1 up
# configure network with IP Address 192.168.2.20
ifconfig eth1 192.168.2.20
# configure network with IP Address 192.168.2.20 & netmask 255.255.255.0
ifconfig eth1 192.168.2.20 netmask 255.255.255.0
# Set default gateway 192.168.2.1
route add default gw 192.168.2.1
But now when I try
ifconfig 192.168.2.20, I get:
192.168.2.20: error fetching interface information: Device not found
I found other people online with the same error message, but none of it seemed relevant to my issue. Maybe I should just reinstall YunoHost and see if the problem persists?
hmm, I’m not getting that error anymore, but I’m still having trouble with getting the server up again. Now I can manually connect to the internet, and from the Pi I can ping websites and such, but I can’t seem to access the Pi outside my LAN.
To automatically bring up the network interface there should be an entry in /etc/network/interfaces that resembles the following snippet to setup the network interfaces as you described it.
iface eth0 inet static
Should you want it to acquire an IP address through dhcp it should look like
iface eth0 inet dhcp
More information on the format of this file can be found at Debian network configuration
It might be useful to verify that you are using the correct interface, since the Raspberry Pi only has 1 network interface I would expect it to be eth0 instead of eth1.
Hi. My RPI is OK with this
iface lo inet loopback
iface eth1 inet dhcp
And on my internet box, I set a dhcp static lease based on the mac address of the RPI, So, I get finally a static IP when the RPI is connected at home.
Thanks both of you, it looks like it’s working perfectly now. My
/etc/network/interfaces file was the same as yours xof, except instead of eth1, it referred to eth0, and for some reason I only have eth1 (at least according to ifconfig). After changing it to eth1 (which also makes it exactly like your interfaces file) dhcp works as expected.
The error I was getting before might have had to do with:
— Debian Reference Chapter 5. Network setup