I'm working on BeagleBone Green and have the latest Linux image on my BBG. For networking part, it worked fine until I tried to setup a static IP on /etc/network/interfaces
file. Here is what I have in my interfaces file.
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.51
netmask 255.255.255.0
gateway 192.168.1.1
My question is: I'm still able to connect to the network as my BBG got IP address from DHCP regardless of the settings on interfaces file. When I tried to restart networking service, here is what I got.
Job for networking.service failed because the control process exited with error code.
See "systemctl status networking.service" and "journalctl -xe" for details.
The following is the message from systemctl status networking.service
.
networking.service - Raise network interfaces
Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2019-07-17 18:51:28 CST; 1min 1s ago
Docs: man:interfaces(5)
Process: 2836 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
Process: 2831 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --exclude=lo)" ] && ud
Main PID: 2836 (code=exited, status=1/FAILURE)
Jul 17 18:51:28 BBG systemd[1]: Starting Raise network interfaces...
Jul 17 18:51:28 BBG ifup[2836]: RTNETLINK answers: File exists
Jul 17 18:51:28 BBG ifup[2836]: ifup: failed to bring up eth0
Jul 17 18:51:28 BBG systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Jul 17 18:51:28 BBG systemd[1]: Failed to start Raise network interfaces.
Jul 17 18:51:28 BBG systemd[1]: networking.service: Unit entered failed state.
Jul 17 18:51:28 BBG systemd[1]: networking.service: Failed with result 'exit-code'.
If I manually brought down eth0 by sudo ifdown eth0
, here is what I got.
ifdown: interface eth0 not configured
A reboot doesn't help. It still gets IP from DHCP. Any idea what's going on here? Thanks for your time.
In response to Panki's comment, here is the result of ip a
. In item 4, 192.160.1.106
is the IP address from DHCP, and 192.168.1.51
is the static IP I put in the interfaces file.
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
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: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN group default qlen 10
link/can
3: can1: <NOARP,ECHO> mtu 16 qdisc noop state DOWN group default qlen 10
link/can
4: eth0: <BROADCAST,MULTICAST,DYNAMIC,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 98:5d:ad:37:8e:aa brd ff:ff:ff:ff:ff:ff
inet 192.168.1.106/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet 192.168.1.51/24 brd 192.168.1.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet6 fe80::9a5d:adff:fe37:8eaa/64 scope link
valid_lft forever preferred_lft forever
5: usb0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 98:5d:ad:37:8e:ac brd ff:ff:ff:ff:ff:ff
6: usb1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether 98:5d:ad:37:8e:af brd ff:ff:ff:ff:ff:ff
inet 192.168.6.2/30 brd 192.168.6.3 scope global usb1
valid_lft forever preferred_lft forever
ip a
in your question? – Panki Jul 17 '19 at 11:24Make sure to disable all DHCP services, e.g. dhcpcd.
. Did you do that? – mnille Jul 17 '19 at 13:11ip a
to the original message. @mnille there is nodhcpcd.service
in my system. – Oliver Jul 18 '19 at 1:23