Community discussions

MikroTik App
 
Yabovbel
just joined
Topic Author
Posts: 1
Joined: Thu Aug 13, 2020 5:58 pm

The IP address of the container does not change

Wed Oct 19, 2022 10:28 pm

Hello,
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?
[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
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3253
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: The IP address of the container does not change

Mon Mar 06, 2023 2:14 am

I thought it was just me. But this looks "broken" IMO in v7.8. I have to re-pull the image for it pick up a new address, even then that not 100%. In my tests, it still seems "sticky" even if you delete the /container. Not sure if it's using "copy" in winbox that causes that, or using the same disk path, or whatever. But only if I ensure everything is removed (container & root-disk), and the recreating the VETH. Only then it seems to always pickup a new IP address from the VETH.

Did you file a bug report at help.mikrotik.com for this already?
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3253
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: The IP address of the container does not change

Mon Mar 06, 2023 2:22 am

The address in the container will change on condition that you create a new VETH interface and specify it in the containet settings.
This one may be true, I can't say I recreated the veth, reassigned, and rebooted much.
Also, the address in the container changes without creating a new VETH interface if you restart the router.
But I tried enough restart after an IP change to know that may not be enough... In my case, it didn't pick it never picks it up after reboots with same VETH after an IP change. I'd take that behavior – stoping & starting it seem reasonable for it pick it up. But that's not what I've seen.

Maybe here it matter if you have /etc mounted... I didn't not, but the root disk is fixed, so maybe it can only update on creating... That the only thing I can think of why you say it picks it up after a restart...
 
jessearcher
just joined
Posts: 4
Joined: Fri Apr 21, 2017 6:47 am

Re: The IP address of the container does not change

Sun Aug 13, 2023 4:33 am

This appears to be broken still in v7.10.2, had to follow the workaround posted of deleting veth2, creating it again, then deleting and recreating the container.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3253
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: The IP address of the container does not change

Mon Aug 14, 2023 10:16 pm

There are few fixes in v7.11beta/rc's, and IPv6. Specifically, things like...
*) container - fixed IP address in container host file;

So hopefully it's fixed in the next stable.
 
brg3466
Member Candidate
Member Candidate
Posts: 177
Joined: Sat Aug 01, 2015 7:29 am

Re: The IP address of the container does not change

Wed Sep 20, 2023 1:03 am

still broken in 7.12beta7. Can't change the veth ip address unless restart the routerOS after change.

Who is online

Users browsing this forum: bpwl, hatred, kolopeter, Michiganbroadband, truefriendcz and 90 guests