<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - [networkd]: changing the ip in a .network unit and restarting the networkd service should configure the interface"
href="https://bugs.freedesktop.org/show_bug.cgi?id=77020">77020</a>
</td>
</tr>
<tr>
<th>Assignee</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Summary</th>
<td>[networkd]: changing the ip in a .network unit and restarting the networkd service should configure the interface
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux (All)
</td>
</tr>
<tr>
<th>Reporter</th>
<td>brian.harrington@coreos.com
</td>
</tr>
<tr>
<th>Hardware</th>
<td>x86-64 (AMD64)
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Component</th>
<td>general
</td>
</tr>
<tr>
<th>Product</th>
<td>systemd
</td>
</tr></table>
<p>
<div>
<pre>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@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@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@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@leviathan-alticon-net ~]$ ssh <a href="mailto:core@192.168.122.75">core@192.168.122.75</a>
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@localhost ~ $ sudo sed -i 's/75/80/g'
/etc/systemd/network/10-static.network
# Display the change to confirm
core@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@localhost ~ $ sudo systemctl restart systemd-networkd.service
# Display that the change was not applied
core@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@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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>