Ubuntu: Can't connect to local network using static IP - Ubuntu Server 16.04



Question:

I installed Ubuntu 16.04 on a HP server which has 2 NICs enp5s0f0 and enp5s0f1. I have both configured in /etc/network/interfaces since it's a server and has no graphical interface which could make problems if I do this. When I start the server I'm not able to find it on the network with nmap 10.0.0.0/24 -p and can't ping my gateway from the server. If I put the interfaces down and only enp5s0f1 up suddenly the ping is working. So I thought that the config or the network cable of interface 0 has some problems. I Checked the config file and switched LAN cables. I found no mistake in the config file. So my Question is what could be wrong with my Setup (network and software)

Note: networking worked fine till I started playing around with bridges so I don't think it's an Hardware issue. I removed all bridge config parts from the config file

The NIC names should be right - dmesg | grep eth

[   22.402049] igb 0000:05:00.0: added PHC on eth0  [   22.537417] igb 0000:05:00.0: eth0: (PCIe:2.5Gb/s:Width x4) xx:xx:xx:xx:xx.xx  [   22.606443] igb 0000:05:00.0: eth0: PBA No: Unknown  [   23.006031] igb 0000:05:00.1: added PHC on eth1  [   23.142435] igb 0000:05:00.1: eth1: (PCIe:2.5Gb/s:Width x4) xx:xx:xx:xx:xx.xx  [   23.211388] igb 0000:05:00.1: eth1: PBA No: Unknown  [   23.423252] igb 0000:05:00.0 enp5s0f0: renamed from eth0  [   23.513177] igb 0000:05:00.1 enp5s0f1: renamed from eth1  

cat /etc/network/interfaces

source /etc/network/interfaces.d/*    auto lo  iface lo inet loopback    auto enp5s0f0  iface enp5s0f0 inet static      address 10.0.0.241      netmask 255.255.255.0      gateway 10.0.0.205      dns-nameservers 10.0.0.205  auto enp5s0f1  iface enp5s0f1 inet static      address 10.0.0.242      netmask 255.255.255.0      gateway 10.0.0.205      dns-nameservers 10.0.0.205  

EDIT: I forgot to mention that the first interface is working with DHCP even if the second one is on static

EDIT2: also using a bridge to KVM it is possible to connect over enp5s0f0 with a static bridge IP


Solution:1

  • Both are in the same subnet 10.0.0.0/24, AFAIK, this is will not work.

    Change the second one to another subnet/network, example:

    source /etc/network/interfaces.d/*    auto lo  iface lo inet loopback    auto enp5s0f0  iface enp5s0f0 inet static      address 10.0.0.241      netmask 255.255.255.0      gateway 10.0.0.205      dns-nameservers 10.0.0.205    auto enp5s0f1  iface enp5s0f1 inet static      address 10.0.1.241      netmask 255.255.255.0  
  • This question multiple physical interfaces with IPs on the same subnet has nice answer why this happening.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »