<interface type='bridge'> <mac address='fa:16:3e:07:4f:e6'/> <source bridge='brq07e0cfa1-17'/> <target dev='tap36ab4e20-b9'/> <model type='virtio'/> <alias name='net0'/>
[root@x86compute01 ~]# brctl show | grep brq07e0cfa1-17 brq07e0cfa1-17 8000.80693348e5f3 no eth3.1018 [root@x86compute01 ~]# brctl show brq07e0cfa1-17 bridge name bridge id STP enabled interfaces brq07e0cfa1-17 8000.80693348e5f3 no eth3.1018 tap072726f0-9e tap36ab4e20-b9 tap39b89d04-01 tap50e98e5c-7c tap5cd371cb-ae tap86ac8424-dd tap886ad6ad-95 tapa0fcf5e3-7b tapa2d15d3f-d0 tapbae1e208-d2 tapbe4b01e2-56 tapc0787db9-80 tapcd243c6a-83 tape38639a7-f3 tape409411f-a2 tape6388f29-4e vnet1 vnet4 vnet7
[root@x86compute01 ~]# brctl show brq07e0cfa1-17 | grep tap36ab4e20-b9 tap36ab4e20-b9 [root@x86compute01 ~]# tcpdump -i tap36ab4e20-b9 proto ospf tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on tap36ab4e20-b9, link-type EN10MB (Ethernet), capture size 262144 bytes 19:22:55.283298 IP 10.10.18.148 > 224.0.0.5: OSPFv2, Hello, length 44 19:23:05.283287 IP 10.10.18.148 > 224.0.0.5: OSPFv2, Hello, length 44 ^C
[root@x86compute01 ~]# ip a show tap36ab4e20-b9 -----------没有ip 302: tap36ab4e20-b9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master brq07e0cfa1-17 state UNKNOWN group default qlen 1000 link/ether fe:16:3e:07:4f:e6 brd ff:ff:ff:ff:ff:ff inet6 fe80::fc16:3eff:fe07:4fe6/64 scope link valid_lft forever preferred_lft forever [root@x86compute01 ~]#
[root@x86compute01 ~]# ip a show tap36ab4e20-b9 302: tap36ab4e20-b9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master brq07e0cfa1-17 state UNKNOWN group default qlen 1000 link/ether fe:16:3e:07:4f:e6 brd ff:ff:ff:ff:ff:ff inet6 fe80::fc16:3eff:fe07:4fe6/64 scope link valid_lft forever preferred_lft forever [root@x86compute01 ~]# virsh dumpxml instance-00003aa6 | grep 10.10.19 [root@x86compute01 ~]# cat proc/net/arp cat: proc/net/arp: 没有那个文件或目录 [root@x86compute01 ~]# virsh dumpxml instance-00003aa6 | grep "mac address" <mac address='fa:16:3e:07:4f:e6'/> [root@x86compute01 ~]# virsh net-list 名称 状态 自动开始 持久 ---------------------------------------------------------- [root@x86compute01 ~]# arp -an fa:16:3e:07:4f:e6 fa:16:3e:07:4f:e6: 未知的主机 [root@x86compute01 ~]# virsh domiflist instance-00003aa6 接口 类型 源 型号 MAC ------------------------------------------------------- tap36ab4e20-b9 bridge brq07e0cfa1-17 virtio fa:16:3e:07:4f:e6 [root@x86compute01 ~]#
虚拟网卡tap device就是一个dhcp设备,它不会有静态ip,而对应的dhcp服务是由dnsmasq实现的, dhcp服务的host-file中保存着这些tap device的mac地址对应的ip
docker exec -it neutron_dhcp_agent bash
neutron-dhcp-agent)[neutron@controller2 /]$ cd /var/lib/neutron/dhcp/07e0cfa1-1701-44d6-a835-432192448ad9/ (neutron-dhcp-agent)[neutron@controller2 07e0cfa1-1701-44d6-a835-432192448ad9]$ grep 10.10.18.148 * addn_hosts:10.10.18.148 focal.kc.local. focal host:fa:16:3e:07:4f:e6,focal.kc.local.,10.10.18.148
controller1 、controller2都有有94ec94a9-88d3-4974-a1f5-8e86efa66a63这个namespace,dhcp有这个ip的配置
(neutron-dhcp-agent)[neutron@controller1 07e0cfa1-1701-44d6-a835-432192448ad9]$ grep 10.10.18.148 *
addn_hosts:10.10.18.148 host-10-10-18-148.openstacklocal host-10-10-18-148
host:fa:16:3e:07:4f:e6,host-10-10-18-148.openstacklocal,10.10.18.148