Recently, I decided to experiment with the containers in RouterOS and faced a problem.
When I create a virtual ethernet interface VETH, I specify the address and gateway for it.
The problem is that if I change the IP address for the VETH intarface, it won't change inside the container.
The container is stays available at the old address.
The address in the container will change on condition that you create a new VETH interface and specify it in the containet settings.
Also, the address in the container changes without creating a new VETH interface if you restart the router.
I've chacked this on versions RouterOS stable 7.5 and 7.6.
Tell me, please, is this a bug or a feature?
Code: Select all
[admin@R1] > /interface/veth/print where name=veth2
Flags: X - disabled; R - running
0 R name="veth2" address=10.10.4.3/24 gateway=10.10.4.1
[admin@R1] > /container/shell 1
root@wireguard:/# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
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@if24: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether ca:31:17:da:98:1d brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 10.10.4.3/24 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::c831:17ff:feda:981d/64 scope link
valid_lft forever preferred_lft forever
[admin@R1] > /container/stop 1
[admin@R1] > /interface/veth/set veth2 address=10.10.4.10/24
[admin@R1] > /interface/veth/print where name=veth2
Flags: X - disabled; R - running
0 R name="veth2" address=10.10.4.10/24 gateway=10.10.4.1
[admin@R1] > /container/start 1
[admin@R1] > /container/shell 1
root@wireguard:/# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
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@if24: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether ca:31:17:da:98:1d brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 10.10.4.3/24 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::c831:17ff:feda:981d/64 scope link
valid_lft forever preferred_lft forever