某所で少し変な挙動を見かけたので、ちょっと手元の環境で再現試験。 結果を先に書くと、再現しなかったんだけど、環境構築から試験まで色々やったので、ここにまとめておく。
name | MTU | NIC | 無差別 | 偽装 | MAC |
---|---|---|---|---|---|
Test-sw1 | 1500 | vmnic3 | ✕ | ✕ | ✕ |
Test-sw2 | 1500 | vmnic4 | ✕ | ✕ | ✕ |
name | vLAN | vSW | 無差別 | 偽装 | MAC |
---|---|---|---|---|---|
test-pg1 | 601 | Test-sw1 | ✕ | ✕ | ✕ |
test-pg2 | 601 | Test-sw2 | ✕ | ✕ | ✕ |
言葉の定義 (VMware ESXi 6.7 のマニュアルより抜粋し編集)
FreeBSDは普通にInstall。
/boot/loader.conf
に以下を追加carp_load=“YES”
/etc/rc.conf
hostname="test-2" # 2号機は test-1 moused_nondefault_enable="NO" # Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable dumpdev="NO" zfs_enable="YES" sshd_enable="YES" vmware_guest_kmod_enable="YES" vmware_guest_enable="YES" ifconfig_vmx0="inet xxx.xxx.xxx.xxx/mm -rxcsum -txcsum -tso -lro" # Management用 ifconfig_vmx1="inet 192.168.1.1/24 -rxcsum -txcsum -tso -lro" # 2号機は 192.168.1.2/24 を割り当てる ifconfig_vmx1_alias0="inet vhid 1 advbase 1 advskew 100 pass 192.168.1.3 alias 192.168.1.3/32" # CARP設定
pkg install doas open-vm-tools-nox11
ifmcstat
コマンドを実行する。JoinしているGroupなどが確認できる。詳細は man ifmcstat
を参照ifmcstat -i vmx1
などifconfig [I/F name] vhid [VHID Number] state (master|backup)
コマンドを利用するversion 15.2 no service pad service tcp-keepalives-in service tcp-keepalives-out service timestamps debug datetime msec localtime service timestamps log datetime msec localtime service password-encryption service sequence-numbers service unsupported-transceiver no service dhcp ! hostname swc1 ! boot-start-marker boot-end-marker ! ! username seirios privilege 15 password 7 ****************** aaa new-model ! aaa authentication login CONSOLE local-case ! aaa session-id common clock timezone JST 9 0 switch 1 provision ws-c2960x-48td-l no ip source-route ip routing ! ip domain-name mgmt.example.com ip name-server 8.8.8.8 ip name-server 8.8.4.4 vtp mode off ! spanning-tree mode pvst spanning-tree extend system-id no spanning-tree vlan 1-4094 no errdisable detect cause gbic-invalid ! vlan internal allocation policy ascending ! vlan 601 name "Test1" ! no cdp run ! interface FastEthernet0 ip address XXX.XXX.XXX.XXX mmm.mmm.mmm.mmm no ip route-cache ! interface GigabitEthernet1/0/1 ! (snip) ! interface GigabitEthernet1/0/45 ! interface GigabitEthernet1/0/46 switchport access vlan 601 switchport trunk allowed vlan 601 switchport mode trunk ! interface GigabitEthernet1/0/47 ! interface GigabitEthernet1/0/48 switchport access vlan 602 switchport trunk allowed vlan 601 switchport mode trunk ! interface GigabitEthernet1/0/49 ! interface GigabitEthernet1/0/50 ! interface TenGigabitEthernet1/0/1 ! interface TenGigabitEthernet1/0/2 ! interface Vlan1 no ip address shutdown ! interface Vlan601 ip address 192.168.1.254 255.255.255.0 ip information-reply no ip route-cache ! no ip http server no ip http secure-server ! ip route 0.0.0.0 0.0.0.0 xxx.xxx.xxx.xxx ip ssh version 2 ! ip access-list extended MGMT permit ip xxx.xxx.xxx.xxx mm.mm.mm.mm any ! no vstack configuration mode exclusive ! line con 0 logging synchronous line vty 0 4 access-class MGMT in exec-timeout 0 0 privilege level 15 login authentication CONSOLE exec prompt timestamp transport preferred none transport input telnet ssh line vty 5 15 access-class MGMT in exec-timeout 0 0 privilege level 15 login authentication CONSOLE exec prompt timestamp transport preferred none transport input telnet ssh ! ntp server ntp.nict.jp end
なお、HSRP Configurationは
interface Vlan601 ip address 192.168.1.254 255.255.255.0 ip broadcast-address 192.168.1.255 ip information-reply standby version 2 standby 1 ip 192.168.1.252 standby 1 priority 80 standby 1 authentication 12345678 no ip route-cache
無差別 | 偽装転送 | MAC変更 | 結果 | 備考 |
---|---|---|---|---|
✕ | ✕ | ✕ | ✕ | CARPは正しく動作しなかった。外からのICMPに返答もしない。 |
〇 | 〇 | 〇 | 〇 | CARPは正しく動作した |
✕ | 〇 | 〇 | ✕ | CARPのStateは正しく動作した(Master/Backupが正しく決定される)が、外部からのpingに対して返答しない |
〇 | ✕ | 〇 | ✕ | CARPは正しく動作しなかった。外からのICMPに返答もしない。 |
〇 | 〇 | ✕ | 〇 | CARPは正しく動作した |
HSRP | Group | auth | 結果 | 備考 |
---|---|---|---|---|
✕ | ✕ | ✕ | 〇 | |
〇 | 10 | ✕ | 〇 | |
〇 | 10 | 〇 | 〇 | |
〇 | 1 | 〇 | 〇 | |
〇 | 1 | ✕ | 〇 |