3

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

  • You shouldn't have two gateway statements. – user508889 Apr 30 '16 at 19:25
  • Why this? I tried without a gateway for the first interface, but no difference – Fritz May 1 '16 at 6:43
2
  • 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.

  • 1
    not tried this yet cause with a KVM bridge it is working for now. There is no solution to put both NICs in the same subnet except for bonding? – Fritz May 5 '16 at 16:18
  • @Fritz, AFAIK, yes (even bonding it means you theoretically just used single interface for same subnet). Here is a nice question for someone tried to setup two interface on the same subnet, serverfault.com/questions/336021/… . – user.dz May 5 '16 at 17:31
  • @Fritz, This has a nice accepted answer about this topic, serverfault.com/questions/415304/… – user.dz May 5 '16 at 17:38
  • 1
    I accepted the answer ;) your link made it clear to me why this is happening. but bridging one interface should make no problems (even if there is only 1 interface in this bridge)? – Fritz May 6 '16 at 19:24
  • @Ravan yep i'm there – user.dz May 27 '16 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.