I am a novice when it comes to all things networking. I have a MOXA-UC-8112 gateway that I am trying to connect to the network. The gateway embeds a debian 9. The eth0 interface for the LAN works fine. I am now trying to connect the eth1 interface to the WAN.
Here is my configuration file /etc/network/interfaces:
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto eth0 eth1 lo
iface lo inet loopback
iface eth0 inet static
address 172.AAA.AAA.AAA
network 172.BBB.BBB.BBB
netmask 255.CCC.CCC.CCC
gateway 172.DDD.DDD.DDD
iface eth1 inet static
address 176.AAA.AAA.AAA
network 176.BBB.BBB.BBB
netmask 255.EEE.EEE.EEE
gateway 176.DDD.DDD.DDD
Here is the output of ip route:
default via 172.DDD.DDD.DDDdev eth0 onlink
172.BBB.BBB.BBB/CC dev eth0 proto kernel scope link src 172.AAA.AAA.AAA
176.BBB.BBB.BBB/EE dev eth1 proto kernel scope link src 176.AAA.AAA.AAA
After configuring these two interfaces, I try to restart the networking service. And this is when the RTNETLINK error messages arrives.
Mar 21 09:02:27 XXXX ifup[1981]: RTNETLINK answers: File exists
Mar 21 09:02:27 XXXX ifup[1981]: ifup: failed to bring up eth1
Mar 21 09:02:27 XXXX systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Mar 21 09:02:27 XXXX systemd[1]: Failed to start Raise network interfaces.
This error occurs when using ifup :
ifup -v eth1
ifup: reading directory /etc/network/interfaces.d
ifup: configuring interface eth1=eth1 (inet)
/bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/ethtool
run-parts: executing /etc/network/if-pre-up.d/ifenslave
+ [ inet = meta ]
+ IF_BOND_SLAVES=
+ [ ]
+ [ ]
+ [ -z ]
+ exit
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
/bin/ip addr add 176.AAA.AAA.AAA/255.EEE.EEE.EEE broadcast 176.XXX.XXX.XXX dev eth1 label eth1
RTNETLINK answers: File exists
ifup: failed to bring up eth1
Another error occurs when using ifdown :
ifdown -v eth1
ifdown: reading directory /etc/network/interfaces.d
ifdown: interface eth1 not configured
I've tried it all: sudo ip addr flush dev eth1, sudo ifdown eth1 && sudo ifup eth1, nano /run/network/ifstate reboot ...