[systemd-bugs] [Bug 77020] New: [networkd]: changing the ip in a .network unit and restarting the networkd service should configure the interface

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Apr 3 10:47:30 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=77020

          Priority: medium
            Bug ID: 77020
          Assignee: systemd-bugs at lists.freedesktop.org
           Summary: [networkd]: changing the ip in a .network unit and
                    restarting the networkd service should configure the
                    interface
        QA Contact: systemd-bugs at lists.freedesktop.org
          Severity: normal
    Classification: Unclassified
                OS: Linux (All)
          Reporter: brian.harrington at coreos.com
          Hardware: x86-64 (AMD64)
            Status: NEW
           Version: unspecified
         Component: general
           Product: systemd

Below you can see the process of setting and then changing an IP address
through a systemd network unit.  At the moment the IP address can be set, but
changing the address subsequently does not work.  This wasn't the expected
behavior.  Is this the desired workflow?  If so this should be documented.   


# Display automatically configured DHCP address:
core at localhost /etc/systemd/network $ ifconfig ens3
ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.122.101  netmask 255.255.255.0  broadcast 192.168.122.255
        inet6 fe80::5054:ff:fe95:b19f  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:95:b1:9f  txqueuelen 1000  (Ethernet)
        RX packets 1147  bytes 104127 (101.6 KiB)
        RX errors 0  dropped 102  overruns 0  frame 0
        TX packets 641  bytes 97180 (94.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

# Change configuration of the network and set a static IP:
core at localhost /etc/systemd/network $ cat
/etc/systemd/network/10-static.network 
[Match]
Name=ens3

[Network]
Address=192.168.122.75/24
Gateway=192.168.122.1

# Apply the changes to the interface
core at localhost /etc/systemd/network $ sudo systemctl restart
systemd-networkd.service

# Lose the connection because the IP changed
Connection to 192.168.122.101 closed.
[bharrington at leviathan-alticon-net ~]$ ssh core at 192.168.122.75
Warning: Permanently added '192.168.122.75' (RSA) to the list of known hosts.
Warning: Permanently added '192.168.122.75' (RSA) to the list of known hosts.
   ______                ____  _____
  / ____/___  ________  / __ \/ ___/
 / /   / __ \/ ___/ _ \/ / / /\__ \
/ /___/ /_/ / /  /  __/ /_/ /___/ /
\____/\____/_/   \___/\____//____/

# Change the IP in the systemd unit
core at localhost ~ $ sudo sed -i 's/75/80/g'
/etc/systemd/network/10-static.network 

# Display the change to confirm
core at localhost ~ $ cat /etc/systemd/network/10-static.network
[Match]
Name=ens3

[Network]
Address=192.168.122.80/24
Gateway=192.168.122.1

# Apply the change
core at localhost ~ $ sudo systemctl restart systemd-networkd.service

# Display that the change was not applied
core at localhost ~ $ ifconfig ens3
ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.122.75  netmask 255.255.255.0  broadcast 192.168.122.255
        inet6 fe80::5054:ff:fe95:b19f  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:95:b1:9f  txqueuelen 1000  (Ethernet)
        RX packets 1540  bytes 143430 (140.0 KiB)
        RX errors 0  dropped 136  overruns 0  frame 0
        TX packets 872  bytes 129409 (126.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

# Show the logs to display the HUP of networkd
core at localhost ~ $ journalctl -xn -u systemd-networkd.service
-- Logs begin at Thu 2014-04-03 17:36:24 UTC, end at Thu 2014-04-03 17:40:49
UTC. --
Apr 03 17:40:02 localhost systemd-networkd[2984]: lo: carrier on
Apr 03 17:40:02 localhost systemd-networkd[2984]: ens3: link configured
Apr 03 17:40:49 localhost systemd[1]: Stopping Network Service...
Apr 03 17:40:49 localhost systemd[1]: Starting Network Service...
Apr 03 17:40:49 localhost systemd-networkd[3001]: ens3: link is up
Apr 03 17:40:49 localhost systemd-networkd[3001]: ens3: carrier on
Apr 03 17:40:49 localhost systemd-networkd[3001]: lo: link is up
Apr 03 17:40:49 localhost systemd-networkd[3001]: lo: carrier on
Apr 03 17:40:49 localhost systemd-networkd[3001]: ens3: link configured
Apr 03 17:40:49 localhost systemd[1]: Started Network Service.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20140403/390f4206/attachment.html>


More information about the systemd-bugs mailing list