I am having network troubles on my relatively new Ubuntu Server 17.04 installation. The computer has two network ports (on the motherboard): one connected to a modem which gives WAN IPs and one connected to a router which gives LAN IPs.
The problem is that both interfaces get an IP, but the computer is only pingable/reachable via SSH from the LAN interface. Pinging the WAN IP gives timeouts. I would like to get the WAN interface working to use the computer as a router in the end.
What I tried:
- Switching to systemd-networkd, which seemed to solve the problem temporarily, but then it started giving self-assigned IPs to the interfaces. I reverted to using the basic /etc/network, and now I have IPs and no WAN connectivity. I have internet connectivity, but this seems to go via the LAN interface.
- Disabling the firewall (sudo ufw disable), having no effect
- Rebooting and ifdown/ifup the interface multiple times
- Disabling IPv6
EDIT:
I now notice a lot of DHCPREQUEST messages in my syslog, which might have something to do with the problem:
Aug 31 11:40:22 home dhclient[1450]: DHCPREQUEST of xx.xxx.13.139 on enp3s0 to xxx.xxx.132.120 port 67 (xid=0x1b73764)
Aug 31 11:47:31 home dhclient[1450]: message repeated 29 times: [ DHCPREQUEST of xx.xxx.13.139 on enp3s0 to xxx.xxx.132.120 port 67 (xid=0x1b73764)]
Aug 31 11:47:47 home dhclient[1450]: DHCPREQUEST of xx.xxx.13.139 on enp3s0 to xxx.xxx.132.120 port 67 (xid=0x1b73764)
ifconfig:
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet xx.xxx.13.139 netmask 255.255.224.0 broadcast xx.xxx.31.255
ether xx:xx:xx:xx:xx:xx txqueuelen 1000 (Ethernet)
RX packets 16438 bytes 988374 (988.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 52 bytes 7615 (7.6 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255
ether xx:xx:xx:xx:xx:xx txqueuelen 1000 (Ethernet)
RX packets 518 bytes 50724 (50.7 KB)
RX errors 0 dropped 1 overruns 0 frame 0
TX packets 116 bytes 15468 (15.4 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
RX packets 2 bytes 100 (100.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2 bytes 100 (100.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
route:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default gateway 0.0.0.0 UG 0 0 0 enp4s0
xx.xxx.0.0 0.0.0.0 255.255.224.0 U 0 0 0 enp3s0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 enp4s0
/etc/network/interfaces:
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# WAN
auto enp3s0
iface enp3s0 inet dhcp
# LAN
allow-hotplug enp4s0
iface enp4s0 inet static
address 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1