Setup networking problem

Issues related to configuring your network
satimis
Posts: 151
Joined: 2006/11/14 14:24:08

Setup networking problem

Post by satimis » 2017/11/02 05:24:52

Hi all,

Host - Ubuntu 16.04 desktop
Guest - CentOS 7 GNOME desktop
Virtualizer - KVM
Only ONE network card

On running
# service network restart

Code: Select all

Restarting network (via systemctl):  Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.
                                                           [FAILED]
# systemctl status network.service

Code: Select all

● network.service - LSB: Bring up/down networking
   Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2017-11-02 13:11:56 HKT; 55s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 3172 ExecStop=/etc/rc.d/init.d/network stop (code=exited, status=0/SUCCESS)
  Process: 4696 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

Nov 02 13:11:56 centos7-gnome-pc1b00 network[4696]: RTNETLINK answers: File exists
Nov 02 13:11:56 centos7-gnome-pc1b00 network[4696]: RTNETLINK answers: File exists
Nov 02 13:11:56 centos7-gnome-pc1b00 network[4696]: RTNETLINK answers: File exists
Nov 02 13:11:56 centos7-gnome-pc1b00 network[4696]: RTNETLINK answers: File exists
Nov 02 13:11:56 centos7-gnome-pc1b00 network[4696]: RTNETLINK answers: File exists
Nov 02 13:11:56 centos7-gnome-pc1b00 network[4696]: RTNETLINK answers: File exists
Nov 02 13:11:56 centos7-gnome-pc1b00 systemd[1]: network.service: control process exited, code=exited status=1
Nov 02 13:11:56 centos7-gnome-pc1b00 systemd[1]: Failed to start LSB: Bring up/down networking.
Nov 02 13:11:56 centos7-gnome-pc1b00 systemd[1]: Unit network.service entered failed state.
Nov 02 13:11:56 centos7-gnome-pc1b00 systemd[1]: network.service failed.
# journalctl -xe >> journalctl.txt
The file is TOO large to be attached here.

Please help, advising which config file/files I have to check?

Thanks

Regards
satimis

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Setup networking problem

Post by jlehtone » 2017/11/02 08:24:09

Is this on the VM? (I.e. a CentOS guest config issue.)

Why do you restart the network.service?

satimis
Posts: 151
Joined: 2006/11/14 14:24:08

Re: Setup networking problem

Post by satimis » 2017/11/02 11:46:15

jlehtone wrote:Is this on the VM? (I.e. a CentOS guest config issue.)

Why do you restart the network.service?
Hi,

CentOS 7 is on VM

I was following below document;
CentOS / Redhat: KVM Bridged Network Configuration
https://www.cyberciti.biz/faq/rhel-linu ... h-libvirt/

which, I suppose, is not relevant to the setup of CentOS 7 on VM? But I'll run CentOS 7 as host for oVirt. I'm prepared to test nested virtualization.

Just started CentOS 7

$ ifconfig

Code: Select all

br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.8.6  netmask 255.255.255.0  broadcast 192.168.8.255
        inet6 fe80::60f5:83ff:fed1:a361  prefixlen 64  scopeid 0x20<link>
        ether 62:f5:83:d1:a3:61  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 54  bytes 5303 (5.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.8.4  netmask 255.255.255.0  broadcast 192.168.8.255
        inet6 fe80::f3fd:b018:710c:c91  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:ee:58:34  txqueuelen 1000  (Ethernet)
        RX packets 167  bytes 33462 (32.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 64  bytes 7574 (7.3 KiB)
        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
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 10  bytes 904 (904.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 10  bytes 904 (904.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:8b:64:ac  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
The static IP "br0 192.168.8.6" is correct.

Why "inet 192.168.8.4" appears on eth0 ?

Why virbr0 (NAT) is there?


$ ping yahoo.com

Code: Select all

ping: yahoo.com: Name or service not known
It can't ping Host - Ubuntu 16.04
$ ping 192.168.8.3

Code: Select all

PING 192.168.8.3 (192.168.8.3) 56(84) bytes of data.
From 192.168.8.6 icmp_seq=1 Destination Host Unreachable
From 192.168.8.6 icmp_seq=2 Destination Host Unreachable
....
Why it changes to 192.168.8.6 ?

nor gateway

$ ping 192.168.8.1

Code: Select all

PING 192.168.8.1 (192.168.8.1) 56(84) bytes of data.
From 192.168.8.6 icmp_seq=1 Destination Host Unreachable
From 192.168.8.6 icmp_seq=2 Destination Host Unreachable
Again why it changes to 192.168.8.6 ?

On Host Terminal
⟫ ifconfig

Code: Select all

br0       Link encap:Ethernet  HWaddr f0:79:59:65:2f:bb  
          inet addr:192.168.8.3  Bcast:192.168.8.255  Mask:255.255.255.0
          inet6 addr: fe80::f279:59ff:fe65:2fbb/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5163 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5092 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3302400 (3.3 MB)  TX bytes:1028640 (1.0 MB)

enp2s0    Link encap:Ethernet  HWaddr f0:79:59:65:2f:bb  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6469 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5217 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3460482 (3.4 MB)  TX bytes:1040176 (1.0 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:54325 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54325 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2135739980 (2.1 GB)  TX bytes:2135739980 (2.1 GB)

virbr0    Link encap:Ethernet  HWaddr 00:00:00:00:00:00  
          inet addr:192.168.100.1  Bcast:192.168.100.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

vnet0     Link encap:Ethernet  HWaddr fe:54:00:ee:58:34  
          inet6 addr: fe80::fc54:ff:feee:5834/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:113 errors:0 dropped:0 overruns:0 frame:0
          TX packets:294 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:10744 (10.7 KB)  TX bytes:42813 (42.8 KB)

$ cat /etc/sysconfig/network

Code: Select all

# Created by anaconda
NETWORKING=yes
HOSTNAME=centos7-gnome-pc1b00
GATEWAY=br0
$ cat /etc/sysconfig/network-scripts/ifcfg-eth0

Code: Select all

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth0
UUID=3a20e867-00f1-4cda-ab7b-e4ad71f33f5b
DEVICE=eth0
ONBOOT=yes
ETHTOOL_OPTS="autoneg off speed 100 duplex full"
BRIDGE=br0
HWADDR=b8:ac:6f:65:31:e5
NM_CONTROLLED=no
DNS1=8.8.8.8
DNS2=4.2.2.2
$ cat /etc/sysconfig/network-scripts/ifcfg-br0

Code: Select all

DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.8.6
NETMASK=255.255.255.0
DELAY=0
$ cat /etc/sysconfig/network-scripts/route-br0

Code: Select all

192.0.0.0/8 via 192,168.8.1 dev br0
Shall I change all eth0 as enp2s0 ?

Please help. Thanks in advance

Regards
satimis

tunk
Posts: 1204
Joined: 2017/02/22 15:08:17

Re: Setup networking problem

Post by tunk » 2017/11/02 12:40:55

How are the network scripts on your VM?
BTW: that link most likely is for CentOS 6 as it uses service and not systemctl.

satimis
Posts: 151
Joined: 2006/11/14 14:24:08

Re: Setup networking problem

Post by satimis » 2017/11/02 14:21:10

tunk wrote:How are the network scripts on your VM?
$ ls /etc/sysconfig/network-scripts/

Code: Select all

ifcfg-br0    ifdown-ib        ifup          ifup-ppp
ifcfg-br0-1  ifdown-ippp      ifup-aliases  ifup-routes
ifcfg-br0-2  ifdown-ipv6      ifup-bnep     ifup-sit
ifcfg-br0-3  ifdown-isdn      ifup-eth      ifup-Team
ifcfg-br0-4  ifdown-post      ifup-ib       ifup-TeamPort
ifcfg-br0-5  ifdown-ppp       ifup-ippp     ifup-tunnel
ifcfg-eth0   ifdown-routes    ifup-ipv6     ifup-wireless
ifcfg-lo     ifdown-sit       ifup-isdn     init.ipv6-global
ifdown       ifdown-Team      ifup-plip     network-functions
ifdown-bnep  ifdown-TeamPort  ifup-plusb    network-functions-ipv6
ifdown-eth   ifdown-tunnel    ifup-post     route-br0
# cat /etc/sysconfig/network-scripts/ifcfg-eth0

Code: Select all

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth0
UUID=3a20e867-00f1-4cda-ab7b-e4ad71f33f5b
DEVICE=eth0
ONBOOT=yes
ETHTOOL_OPTS="autoneg off speed 100 duplex full"
BRIDGE=br0
HWADDR=b8:ac:6f:65:31:e5
NM_CONTROLLED=no
DNS1=8.8.8.8
DNS2=4.2.2.2
BTW: that link most likely is for CentOS 6 as it uses service and not systemctl.
Noted and thanks

satimis

tunk
Posts: 1204
Joined: 2017/02/22 15:08:17

Re: Setup networking problem

Post by tunk » 2017/11/02 15:21:46

Shouldn't there be IPADDR and NETMASK settings in ifcfg-eth0?

satimis
Posts: 151
Joined: 2006/11/14 14:24:08

Re: Setup networking problem

Post by satimis » 2017/11/02 15:39:39

tunk wrote:Shouldn't there be IPADDR and NETMASK settings in ifcfg-eth0?
IPADDR=192.168.8.6 (of VM CentOS 7)
and
NETMASK=255.255.255.0

are on ifcfg-br0

# cat /etc/sysconfig/network-scripts/ifcfg-br0

Code: Select all

DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.8.6
NETMASK=255.255.255.0
DELAY=0
Whether remove them from ifcfg-br0 ?

Add them to ifcfg-eth0 ?

# cat /etc/sysconfig/network-scripts/ifcfg-eth0

Code: Select all

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth0
UUID=3a20e867-00f1-4cda-ab7b-e4ad71f33f5b
DEVICE=eth0
ONBOOT=yes
ETHTOOL_OPTS="autoneg off speed 100 duplex full"
BRIDGE=br0
HWADDR=b8:ac:6f:65:31:e5
NM_CONTROLLED=no
DNS1=8.8.8.8
DNS2=4.2.2.2

If YES where shall I add them? Thanks

Regards
satimis

satimis
Posts: 151
Joined: 2006/11/14 14:24:08

Networking problem - 2 IP addreses

Post by satimis » 2017/11/03 03:57:59

Hi all

After running following commands CentOS 7 can access Internet

# systemctl disable NetworkManager
# systemctl enable network
# systemctl restart network

# nmcli -p dev

Code: Select all

Error: NetworkManager is not running.
But there are 2 ip addresses

$ ip a

Code: Select all

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    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: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 52:54:00:ee:58:34 brd ff:ff:ff:ff:ff:ff
    inet 192.168.8.4/24 brd 192.168.8.255 scope global dynamic eth0
       valid_lft 191sec preferred_lft 191sec
    inet 192.168.8.6/24 brd 192.168.8.255 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:feee:5834/64 scope link 
       valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN qlen 1000
    link/ether 52:54:00:8b:64:ac brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN qlen 1000
    link/ether 52:54:00:8b:64:ac brd ff:ff:ff:ff:ff:ff

Code: Select all

inet 192.168.8.4/24 brd 192.168.8.255 scope global dynamic eth0
       valid_lft 191sec preferred_lft 191sec
How can it come ?

Code: Select all

inet 192.168.8.6/24 brd 192.168.8.255 scope global secondary eth0
192.168.8.6 is the static IP set on ifcfg-eth0

# cat /etc/sysconfig/network-scripts/ifcfg-eth0

Code: Select all

DEVICE=eth0
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
NM_CONTROLLED=yes
BROADCAST=192.168.8.255
NETWORK=192.168.8.0
NETMASK=255.255.255.0
IPADDR=192.168.8.6
GATEWAY=192.168.8.1
USERCTL=no
BRIDGE-enp2s0
# cat /etc/sysconfig/network-scripts/ifcfg-br0
An empty file

# cat /etc/sysconfig/network

Code: Select all

# Created by anaconda
NETWORKING=yes
HOSTNAME=centos7-gnome-pc1b00
GATEWAY=enp2s0
# ls /etc/sysconfig/network-scripts/

Code: Select all

ifcfg-br0                   ifdown-Team
ifcfg-br0-1                 ifdown-TeamPort
ifcfg-br0-2                 ifdown-tunnel
ifcfg-br0-3                 ifup
ifcfg-br0-4                 ifup-aliases
ifcfg-br0-5                 ifup-bnep
ifcfg-br0-6                 ifup-eth
ifcfg-br0-7                 ifup-ib
ifcfg-br0-8                 ifup-ippp
ifcfg-eth0                  ifup-ipv6
ifcfg-eth0-1                ifup-isdn
ifcfg-lo                    ifup-plusb
ifcfg-Wired_connection_1    ifup-post
ifcfg-Wired_connection_1-1  ifup-ppp
ifdown                      ifup-routes
ifdown-bnep                 ifup-sit
ifdown-eth                  ifup-Team
ifdown-ib                   ifup-TeamPort
ifdown-ippp                 ifup-tunnel
ifdown-ipv6                 ifup-wireless
ifdown-isdn                 init.ipv6-global
ifdown-post                 network-functions
ifdown-ppp                  network-functions-ipv6
ifdown-routes               route-br0
ifdown-sit
Host can ping both 192.168.8.4 and 192.168.8.6

Please advise how to stop ip address 192.168.8.4

Thanks

Regards
satimis

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Networking problem - 2 IP addreses

Post by jlehtone » 2017/11/03 07:18:18

This is clearly continuation/fork of viewtopic.php?f=50&t=64873
I will write more about config there.

On assumption that the current active config is transient and still there despite service restarts,
then a system reboot would be the next logical thing to do.

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Setup networking problem

Post by TrevorH » 2017/11/03 08:04:42

Merged the two threads.

Your problem is that your ifcfg-eth0 file has both BRIDGE=br0 and IPADDR=. You should move the IPADDR= to the bridge ifcfg file - don't do any ip configuration in the ifcfg-eth0 file, it should all be on the bridge. You also seem to have a plethora of ifcfg-br0* files as well as yet another one called ifcf-eth0-1. If you created those files as backups you should know that they are probably being used as they all start with ifcfg*. If you want to take backups either do so in a different directory entirely or call them something other than ifcfg-*.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply