CARP虚拟IP在虚拟环境中不能ping通

我们有三台带有SmartOS的物理机器在局域网中。 其中两个10.40.0.3010.40.0.240是基于两个基于pfSense的虚拟化网关的pipe理程序。 这些网关分别有10.40.0.110.40.0.2地址。 在网关之间共享一个10.40.0.3虚拟IP。 第三个SmartOS机器, 10.40.0.221 ,是一个存储主机。 以下是它的一个ARP表:

 [root@68-05-ca-1a-d2-eb ~]# arp -a -n Net to Media Table: IPv4 Device IP Address Mask Flags Phys Addr ------ -------------------- --------------- -------- --------------- aggr0 224.0.0.251 255.255.255.255 S 01:00:5e:00:00:fb aggr0 10.40.0.2 255.255.255.255 f2:b4:a3:21:de:9f aggr0 10.40.0.3 255.255.255.255 00:00:5e:00:01:02 aggr0 10.40.0.1 255.255.255.255 a2:b1:25:07:ea:97 aggr0 10.40.0.15 255.255.255.255 20:6a:8a:0e:a5:6e aggr0 10.40.0.30 255.255.255.255 02:08:20:ee:5b:8b aggr0 10.40.0.240 255.255.255.255 02:08:20:3e:aa:9e aggr0 224.0.0.22 255.255.255.255 S 01:00:5e:00:00:16 aggr0 10.40.0.221 255.255.255.255 SPLA 68:05:ca:1a:d2:eb [root@68-05-ca-1a-d2-eb ~]# 

如您所见,ARP表中有一个共享虚拟IP的条目。 问题是,我们既不能从存储主机ping通共享IP,也不能在pfSense虚拟机上看到传入的ICMP数据包。

我们猜测这个问题与虚拟化有关。 我们删除了虚拟化网卡的所有限制:

 root@a0-36-9f-17-e3-fe ~ dladm show-linkprop net1 -z d783afd7-f8e0-48bf-bc9d-b41939e7b8f8 LINK PROPERTY PERM VALUE DEFAULT POSSIBLE net1 autopush rw -- -- -- net1 zone rw d783afd7-f8e0-48bf-bc9d-b41939e7b8f8 -- -- net1 state r- unknown up up,down net1 mtu rw 1500 1500 1500 net1 secondary-macs rw -- -- -- net1 maxbw rw -- -- -- net1 cpus rw -- -- -- net1 cpus-effective r- 1-2 -- -- net1 pool rw -- -- -- net1 pool-effective r- -- -- -- net1 priority rw high high low,medium,high net1 tagmode rw vlanonly vlanonly normal,vlanonly net1 protection rw -- -- mac-nospoof, restricted, ip-nospoof, dhcp-nospoof net1 promisc-filtered rw off on off,on net1 allowed-ips rw -- -- -- net1 allowed-dhcp-cids rw -- -- -- net1 rxrings rw -- -- -- net1 rxrings-effective r- -- -- -- net1 txrings rw -- -- -- net1 txrings-effective r- -- -- -- net1 txrings-available r- 0 -- -- net1 rxrings-available r- 0 -- -- net1 rxhwclnt-available r- 0 -- -- net1 txhwclnt-available r- 0 -- -- root@a0-36-9f-17-e3-fe ~ 

但它并没有开始工作。

我们还有什么可以尝试的?

我认为你必须configuration运行UCARP的两台网关机器,并将这些属性添加到networkingconfiguration中:

  "allow_ip_spoofing": true, "allow_mac_spoofing": true 

要做到这一点,你可以创build一个文件,命名为例如updatenic.json

 { "update_nics": [ { "mac": "e2:31:fc:70:df:1c", "allow_ip_spoofing": true, "allow_mac_spoofing": true } ] } 

然后发出命令

 vmadm update UUID < updatenic.json