-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
rhel-9.5
-
No
-
Moderate
-
rhel-sst-network-management
-
ssg_networking
-
None
-
False
-
-
None
-
None
-
-
None
-
None
-
None
What were you trying to do that didn't work?
I want to change ip address in kernel mode, but it is appended to the current ip state, not changed.
Please provide the package NVR for which bug is seen:
nmstate-2.2.33-1.el9.x86_64
How reproducible:
100%
Steps to reproduce
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq && chmod +x /usr/local/bin/yq systemctl stop NetworkManager ip link add eth1 type veth peer eth1_p ip link set eth1 up ip link set eht1_p up cat << EOF > kernel.yaml interfaces: - name: eth1 type: ethernet state: up ipv4: address: - ip: 192.0.2.1 prefix-length: 24 dhcp: false enabled: true ipv6: address: - ip: 2001:db8:1::1 prefix-length: 64 dhcp: false enabled: true autoconf: false EOF nmstatectl apply kernel.yaml -k yq '.interfaces.0.ipv4.address.0.ip = "192.0.2.2"' kernel.yaml > kernel2.yaml yq -i '.interfaces.0.ipv6.address.0.ip = "2001:db8:1::2"' kernel2.yaml nmstatectl apply kernel.yaml -k ip addr show eth1 nmstatectl show eth1 -k
Expected results
Each ip stack has only one address(except ipv6 link local address):
ipv4 192.0.2.2
ipv6 2001:db8:1::2
Actual results
4: eth1@eth1_p: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 02:b1:c6:d9:5b:6a brd ff:ff:ff:ff:ff:ff
inet 192.0.2.1/24 brd 192.0.2.255 scope global eth1
valid_lft forever preferred_lft forever
inet 192.0.2.2/24 brd 192.0.2.255 scope global secondary eth1
valid_lft forever preferred_lft forever
inet6 2001:db8:1::2/64 scope global
valid_lft forever preferred_lft forever
inet6 2001:db8:1::1/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::b1:c6ff:fed9:5b6a/64 scope link
valid_lft forever preferred_lft forever
- is triggered by
-
RHEL-37665 [RFE] Support route and DNS in nmstate kernel mode
- Closed