Сделал скрипт для настройки бриджа для тестов и экспериментов:
DHCP Server <-> server---server_br <-> bridge
dhclient client1 <-> client1---client1_br <-> bridge
dhclient client2 <-> client2---client2_br <-> bridge
dhclient client3 <-> client3---client3_br <-> bridge
server, server_br, clientN, clientN_br - это имена интерфейсов veth (виртуальных «патчей»).
+ ifconfig -a
bond0: flags=5122<BROADCAST,MASTER,MULTICAST> mtu 1500
ether 46:5d:f3:67:fd:0b txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
bridge: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether ca:4e:93:0d:08:a2 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2 bytes 108 (108.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
client1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether a2:28:6b:ef:fc:90 txqueuelen 1000 (Ethernet)
RX packets 1 bytes 54 (54.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
client2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether f6:f7:dc:4d:38:36 txqueuelen 1000 (Ethernet)
RX packets 1 bytes 54 (54.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
client3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 76:5a:e7:30:2e:51 txqueuelen 1000 (Ethernet)
RX packets 1 bytes 54 (54.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
client1_br: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether ca:4e:93:0d:08:a2 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1 bytes 54 (54.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
client2_br: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether ca:5b:c7:5f:6b:8e txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1 bytes 54 (54.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
client3_br: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether ea:3d:63:4a:9a:20 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1 bytes 54 (54.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255
ether 00:17:a5:36:cf:ae txqueuelen 1000 (Ethernet)
RX packets 2616305 bytes 221079995 (210.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2484697 bytes 3410215862 (3.1 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
RX packets 4407 bytes 1266168 (1.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4407 bytes 1266168 (1.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
server: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.10.1 netmask 255.255.255.0 broadcast 192.168.10.255
ether 3a:64:d7:9b:80:77 txqueuelen 1000 (Ethernet)
RX packets 1 bytes 54 (54.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
server_br: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether d2:ed:a1:21:f0:24 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1 bytes 54 (54.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
root@chimaera:/etc/dhcp# dhclient -v client3
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/client3/76:5a:e7:30:2e:51
Sending on LPF/client3/76:5a:e7:30:2e:51
Sending on Socket/fallback
DHCPDISCOVER on client3 to 255.255.255.255 port 67 interval 5
DHCPOFFER of 192.168.10.13 from 192.168.10.1
DHCPREQUEST for 192.168.10.13 on client3 to 255.255.255.255 port 67
DHCPACK of 192.168.10.13 from 192.168.10.1
bound to 192.168.10.13 -- renewal in 271 seconds.
root@chimaera:/etc/dhcp# dhclient -v client2
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/client2/f6:f7:dc:4d:38:36
Sending on LPF/client2/f6:f7:dc:4d:38:36
Sending on Socket/fallback
DHCPDISCOVER on client2 to 255.255.255.255 port 67 interval 8
DHCPOFFER of 192.168.10.12 from 192.168.10.1
DHCPREQUEST for 192.168.10.12 on client2 to 255.255.255.255 port 67
DHCPACK of 192.168.10.12 from 192.168.10.1
bound to 192.168.10.12 -- renewal in 270 seconds.
root@chimaera:/etc/dhcp# dhclient -v client1
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/client1/a2:28:6b:ef:fc:90
Sending on LPF/client1/a2:28:6b:ef:fc:90
Sending on Socket/fallback
DHCPDISCOVER on client1 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on client1 to 255.255.255.255 port 67 interval 8
DHCPOFFER of 192.168.10.14 from 192.168.10.1
DHCPREQUEST for 192.168.10.14 on client1 to 255.255.255.255 port 67
DHCPACK of 192.168.10.14 from 192.168.10.1
bound to 192.168.10.14 -- renewal in 234 seconds.
Т.е. получается, что dhclient работает. Он ведь шлет запрос именно с указанного интерфейса?
Но пинги почему-то не идут ни между client, ни server.
root@chimaera:/etc/dhcp# ping -w 3 -4 -I client1 192.168.10.1
PING 192.168.10.1 (192.168.10.1) from 192.168.10.14 client1: 56(84) bytes of data.
--- 192.168.10.1 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2034ms
root@chimaera:/etc/dhcp# ping -w 3 -4 -I client1 192.168.10.13
PING 192.168.10.13 (192.168.10.13) from 192.168.10.14 client1: 56(84) bytes of data.
--- 192.168.10.13 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2056ms