How to configure a network bridge from script ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi guys,
I'm having trouble starting a network bridge from a script without restarting the server.

I am following this doc in order to configure a bridged network on a Fedora 23 Server host:

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Network_Bridging_Using_the_Command_Line_Interface.html#sec-Create_a_Network_Bridge


my config files look like this:

# cat /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
ONBOOT=yes
BOOTPROTO=dhcp
DELAY=0

# cat /etc/sysconfig/network-scripts/ifcfg-enp1s0f0
Generated by dracut initrd
NAME="enp1s0f0"
DEVICE="enp1s0f0"
ONBOOT=yes
NETBOOT=yes
UUID="58081eef-9d1f-48db-a565-65f45bd1c6e8"
IPV6INIT=yes
BOOTPROTO=none
TYPE=Ethernet
BRIDGE=br0


After that I do:

# systemctl restart network
Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.

# systemctl status network -l
● network.service - LSB: Bring up/down networking
   Loaded: loaded (/etc/rc.d/init.d/network)
Active: failed (Result: exit-code) since ср 2016-05-04 10:33:32 EDT; 2min 43s ago
     Docs: man:systemd-sysv-generator(8)
Process: 1412 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

май 04 10:33:32 amd-dinar-02.lab.bos.redhat.com network[1412]: [  OK  ]
май 04 10:33:32 amd-dinar-02.lab.bos.redhat.com network[1412]: Bringing up interface enp1s0f0: /etc/sysconfig/network-scripts/ifcfg-enp1s0f0: line 1: Generated: command not found
май 04 10:33:32 amd-dinar-02.lab.bos.redhat.com network[1412]: [  OK  ]
май 04 10:33:32 amd-dinar-02.lab.bos.redhat.com network[1412]: Bringing up interface enp1s0f1: Error: Connection activation failed: No suitable device found for this connection.
май 04 10:33:32 amd-dinar-02.lab.bos.redhat.com network[1412]: [FAILED]
май 04 10:33:32 amd-dinar-02.lab.bos.redhat.com network[1412]: Bringing up interface br0: [ OK ] май 04 10:33:32 amd-dinar-02.lab.bos.redhat.com systemd[1]: network.service: Control process exited, code=exited status=1 май 04 10:33:32 amd-dinar-02.lab.bos.redhat.com systemd[1]: Failed to start LSB: Bring up/down networking. май 04 10:33:32 amd-dinar-02.lab.bos.redhat.com systemd[1]: network.service: Unit entered failed state. май 04 10:33:32 amd-dinar-02.lab.bos.redhat.com systemd[1]: network.service: Failed with result 'exit-code'.


After the failure the network config looks like this:


# ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 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: enp1s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:00:1a:1a:94:70 brd ff:ff:ff:ff:ff:ff
    inet 10.16.42.33/21 brd 10.16.47.255 scope global dynamic enp1s0f0
       valid_lft 86204sec preferred_lft 86204sec
    inet6 2620:52:0:102f:200:1aff:fe1a:9470/64 scope global noprefixroute dynamic
       valid_lft 2591805sec preferred_lft 604605sec
    inet6 fe80::200:1aff:fe1a:9470/64 scope link
       valid_lft forever preferred_lft forever
3: enp1s0f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:00:1a:1a:94:71 brd ff:ff:ff:ff:ff:ff
4: br0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 16:db:ac:3b:24:d4 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::14db:acff:fe3b:24d4/64 scope link
       valid_lft forever preferred_lft forever


If I reboot the system the bridge appears to be up and running:

**after reboot**

# ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 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: enp1s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP group default qlen 1000
    link/ether 00:00:1a:1a:94:70 brd ff:ff:ff:ff:ff:ff
3: enp1s0f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:00:1a:1a:94:71 brd ff:ff:ff:ff:ff:ff
4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:00:1a:1a:94:70 brd ff:ff:ff:ff:ff:ff
    inet 10.16.42.33/21 brd 10.16.47.255 scope global dynamic br0
       valid_lft 86391sec preferred_lft 86391sec
    inet6 2620:52:0:102f:200:1aff:fe1a:9470/64 scope global mngtmpaddr dynamic
       valid_lft 2591988sec preferred_lft 604788sec
    inet6 fe80::b496:e5ff:fe89:49e3/64 scope link
       valid_lft forever preferred_lft forever



This is with systemd-222-14.fc23.x86_64 but I have no idea if it is systemd to blame, probably not. The system is used for automated tests and it can't be restarted after the network changes are done for them to take effect. It is also a deviation from the latest official docs I was able to find and may indicate a hidden bug.


Does anyone know what is going on here and how to resolve the problem ?


Thanks,
Alex

--
test mailing list
test@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe:
http://lists.fedoraproject.org/admin/lists/test@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora Desktop]     [Fedora SELinux]     [Photo Sharing]     [Yosemite Forum]     [KDE Users]

  Powered by Linux