You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting up VETH pair between host and a container the default behavior of the kernel is to pick a random MAC address. The idea is to be able to use set phys-address ... for a custom MAC.
However, this only works with containers if the veth pair, and custom MAC, is created first, with a leave between, and then adding one end of the pair to a container, with a second leave.
Expected Behavior
Expected the custom MAC to be set on the interface.
Steps To Reproduce
admin@example:/> configure
admin@example:/config/> edit interface veth1a
admin@example:/config/interface/veth1a/> set veth peer veth1b
admin@example:/config/interface/veth1a/> end
admin@example:/config/> edit interface veth1b
admin@example:/config/interface/veth1b/> set phys-address 00:c0:ff:ee:00:01
admin@example:/config/interface/veth1b/> set ipv4 address 10.10.0.200 prefix-length 24
admin@example:/config/interface/veth1b/> set container-network
admin@example:/config/interface/veth1b/> end
admin@example:/config/> edit container test
admin@example:/config/container/test/> set network interface veth1b
admin@example:/config/container/test/> leave
admin@example:/> show interfaces
INTERFACE PROTOCOL STATE DATA
e1 ethernet UP 02:00:00:00:00:01
ipv6 fec0::ff:fe00:1/64 (link-layer)
ipv6 fe80::ff:fe00:1/64 (link-layer)
lo ethernet UP 00:00:00:00:00:00
ipv4 127.0.0.1/8 (static)
ipv6 ::1/128 (static)
veth0a ethernet 00:1a:33:01:02:03
ipv4 192.168.2.200/24
veth0b ethernet UP 2a:81:c2:ec:b8:b5
veth1a ethernet UP 6a:14:d0:9d:29:50
veth1b ethernet 00:c0:ff:ee:00:01 # <-------
ipv4 10.10.0.200/24
admin@example:/> show container
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d05ee2b5d301 localhost/curios-httpd-v24.03.0:latest /usr/sbin/httpd -... 4 seconds ago Up 4 seconds test
admin@example:/> container shell test
$ ifconfig
eth0 Link encap:Ethernet HWaddr 5A:F8:22:09:F7:52 # <-------
inet addr:192.168.2.200 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::58f8:22ff:fe09:f752/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:1592 (1.5 KiB)
eth1 Link encap:Ethernet HWaddr DA:28:BD:75:F2:26 # <-------
inet addr:10.10.0.200 Bcast:10.10.0.255 Mask:255.255.255.0
inet6 addr: fe80::d828:bdff:fe75:f226/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:586 (586.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
$
Additional information
No response
The text was updated successfully, but these errors were encountered:
This patch adds support for setting the mac address already when
creating veth interfaces. Necessary to cooperate with containers.
Fixes#453
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This patch adds support for setting the mac address already when
creating veth interfaces. Necessary to cooperate with containers.
Fixes#453
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This patch adds support for setting the mac address already when
creating veth interfaces. Necessary to cooperate with containers.
Fixes#453
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Current Behavior
When setting up VETH pair between host and a container the default behavior of the kernel is to pick a random MAC address. The idea is to be able to use
set phys-address ...
for a custom MAC.However, this only works with containers if the veth pair, and custom MAC, is created first, with a
leave
between, and then adding one end of the pair to a container, with a secondleave
.Expected Behavior
Expected the custom MAC to be set on the interface.
Steps To Reproduce
Additional information
No response
The text was updated successfully, but these errors were encountered: