Linux上からIPv6アドレス指定でsshするときにはインタフェース名をつける


Linux上からIPv6アドレスを指定してsshしようとしたら「port 22: Invalid argument」と言われてしまった。

[root@centos8 ~]# ssh root@fe80::250:56ff:fe8f:aba9
ssh: connect to host fe80::250:56ff:fe8f:aba9 port 22: Invalid argument
[root@centos8 ~]#

きちんとpingでは応答あるのに

[root@centos8 ~]# ping -6 fe80::250:56ff:fe8f:aba9 -c 5
PING fe80::250:56ff:fe8f:aba9(fe80::250:56ff:fe8f:aba9) 56 data bytes
64 bytes from fe80::250:56ff:fe8f:aba9%ens192: icmp_seq=1 ttl=255 time=0.246 ms
64 bytes from fe80::250:56ff:fe8f:aba9%ens192: icmp_seq=2 ttl=255 time=0.269 ms
64 bytes from fe80::250:56ff:fe8f:aba9%ens192: icmp_seq=3 ttl=255 time=0.250 ms
64 bytes from fe80::250:56ff:fe8f:aba9%ens192: icmp_seq=4 ttl=255 time=0.303 ms
64 bytes from fe80::250:56ff:fe8f:aba9%ens192: icmp_seq=5 ttl=255 time=0.316 ms

--- fe80::250:56ff:fe8f:aba9 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 135ms
rtt min/avg/max/mdev = 0.246/0.276/0.316/0.035 ms
[root@centos8 ~]#

なんでかと思ったら、sshコマンドでは、sshコマンドを実行したホストのどのインタフェースを使ってアクセスするのかを明示的に指定する必要があったようだ。

[root@centos8 ~]# ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:9c:2a:d1 brd ff:ff:ff:ff:ff:ff
    inet 172.17.44.49/16 brd 172.17.255.255 scope global noprefixroute ens192
       valid_lft forever preferred_lft forever
    inet6 xxxx:xxx:xxxx:4700:2788:3aad:4bfa:6715/64 scope global dynamic noprefixroute
       valid_lft 2172237sec preferred_lft 185037sec
    inet6 fe80::2c85:a948:cd5:d5e1/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
[root@centos8 ~]#

つかうネットワークインタフェースは「ens192」なので、IPv6アドレスの後ろに「%ens192」をつけて実行

[root@centos8 ~]# ssh  root@fe80::250:56ff:fe8f:aba9%ens192
Password:
Last login: Wed Apr  7 16:24:37 2021 from fe80::2c85:a948
Oracle Corporation      SunOS 5.11      11.3    September 2015
root@solaris11:~# exit
logout
Connection to fe80::250:56ff:fe8f:aba9%ens192 closed.
[root@centos8 ~]#

問題無く接続できました。

楽天モバイル回線でForticlientによるSSL-VPNを行うと98%で止まるがエラーもない件の対処


楽天モバイル回線でForticlientによるSSL-VPNを行うと、下記の98%の状態で止まり、しばらく待つとエラーメッセージもなく未接続状態に戻ってしまう。

楽天モバイル回線以外でやってみると正常に接続できる。

2022/02/01追記: 今日からNTTドコモでIPv6シングルスタック化が始まったらしい。もしかして、類似の現象がドコモでテザリングした際に発生する可能性がある。

ちなみに他の回線でも発生する場合はデバイスマネージャのネットワークアダプタにある「WAN Miniport (IP)」をアンインストールし、Windows再起動することで再作成させることで治ることが多いようだ。

楽天モバイルの場合の事例についてぐぐるとIPv6を無効化するといける、という話があるので、そこらへんにヒントがあるな、と調べて見た。

調査方法は SSL-VPN接続先として指定するホスト名の名前解決を調べて見る

C:\> nslookup vpn.domain.local
サーバー: Unknown
Address: 192.168.43.1

権限のない回答:
名前: vpn.domain.local
Address: 64:ff9b::xxxx:xxxx
      xxx.xxx.xxx.xxx
C:\>

IPv6アドレスは設定されていないはずなのにIPv6アドレスの応答があるとは何事???

Google DNSで名前解決を調べて見ると、こちらは想定通りのIPv4アドレスのみの応答となる。

C:\> nslookup vpn.domain.local 8.8.8.8
サーバー: dns.google
Address: 8.8.8.8

権限のない回答:
名前: vpn.domain.local
Address: xxx.xxx.xxx.xxx
C:\>

この設定していないはずのIPv6アドレス「64:ff9b::xxxx:xxxx」が何者なのか調べたところ、NAT64用に予約されているアドレス帯であることが判明。

JPNIC ニュースレターNo.64「NAT64/DNS64

楽天モバイル網ではIPv6ベースで通信を行うため、IPv4のみの接続先についてIPv6に変換したアドレスを用意している、ということになるようだ。

ただ、FortiClientの実装上それでは都合が悪いようだ。

FortiClientのSSL-VPN接続先のサーバ指定を、サーバ名表記から、IPv4アドレス表記に変更し、「無効なサーバ証明書を非表示」に設定することで接続が完了することを確認した。

「無効なサーバ証明書を非表示」に設定する理由は、SSL証明書はホスト名に対して発行されており、IPアドレスに対しては発行されていないためです。(以前はIPアドレスに対しても発行できたが、現在は禁止されている)


2021/10/15追記

BIGLOBEがInfra Study 2nd #3「いまさら聞けないIPv6ネットワーク」というイベントで「DNSの振り分けでNAT64/DNS64の不具合を回避 ~固定回線でIPv4 over IPv6接続するための工夫~」という発表を行った。

BIGLOBEでは固定回線でもNAT64/DNS64を導入しているのですが、IPv6アドレスに変換されると困るサービスなどは、DNS64の名前解決を行わないようにDNSサーバ側で細工をしている、とのこと。

USB Network Native Driver for ESXiを適用したESXiがアップデートできなかった


USB Network Native Driver for ESXiをインストールしたESXi 7.0.0に対してESXi 7.0 Update 1aを適用しようとしたところ、エラーになった。

[root@esxiserver:/vmfs/volumes/0364c042-e0f8e72a/vmware/vSphere7/esxi-patch] esx
cli software vib install -d /vmfs/volumes/software/vmware/vSphere7/esxi-patch/VM
ware-ESXi-7.0U1a-17119627-depot.zip
 [DependencyError]
 VIB VMW_bootbank_vmkusb-nic-fling_2.1-6vmw.700.1.0.39035884 requires vmkapi_incompat_2_6_0_0, but the requirement cannot be satisfied within the ImageProfile.
 Please refer to the log file for more details.
[root@esxiserver:/vmfs/volumes/0364c042-e0f8e72a/vmware/vSphere7/esxi-patch]

じゃぁ、Driverをアップデートすればいいのかな?と ESXi701-VMKUSB-NIC-FLING-40599856-component-17078334.zip をインストールしてみようかと思えば、失敗(注: 「Note: This is ONLY for ESXi 7.0 Update 1, for ESXi 7.0/6.7/6.5, please ensure you are using the correct version of driver.」と書いてある通りだった)

[root@esxiserver:/vmfs/volumes/0364c042-e0f8e72a/vmware/vSphere7/esxi-patch] esx
cli software vib update -d /vmfs/volumes/0364c042-e0f8e72a/vmware/tmp/ESXi701-VM
KUSB-NIC-FLING-40599856-component-17078334.zip
 [DependencyError]
 VIB VMW_bootbank_vmkusb-nic-fling_2.1-6vmw.701.0.0.40599856 requires vmkapi_2_7_0_0, but the requirement cannot be satisfied within the ImageProfile.
 VIB VMW_bootbank_vmkusb-nic-fling_2.1-6vmw.701.0.0.40599856 requires vmkapi_incompat_2_7_0_0, but the requirement cannot be satisfied within the ImageProfile.
 Please refer to the log file for more details.
[root@esxiserver:/vmfs/volumes/0364c042-e0f8e72a/vmware/vSphere7/esxi-patch]

じゃぁ、zipファイルを2つ指定すればいけるのでは?と試してみると、こちらは成功した。

[root@esxiserver:/vmfs/volumes/0364c042-e0f8e72a/vmware/vSphere7/esxi-patch] esx
cli software vib install -d /vmfs/volumes/software/vmware/vSphere7/esxi-patch/VM
ware-ESXi-7.0U1a-17119627-depot.zip -d /vmfs/volumes/0364c042-e0f8e72a/vmware/tm
p/ESXi701-VMKUSB-NIC-FLING-40599856-component-17078334.zip
Installation Result
   Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.
   Reboot Required: true
   VIBs Installed: VMW_bootbank_bnxtnet_216.0.50.0-16vmw.701.0.0.16850804, VMW_bootbank_bnxtroce_216.0.58.0-7vmw.701.0.0.16850804, VMW_bootbank_brcmfcoe_12.0.1500.0-1vmw.701.0.0.16850804, VMW_bootbank_brcmnvmefc_12.6.278.10-3vmw.701.0.0.16850804, VMW_bootbank_elxiscsi_12.0.1200.0-2vmw.701.0.0.16850804, VMW_bootbank_elxnet_12.0.1250.0-5vmw.701.0.0.16850804, VMW_bootbank_i40en_1.8.1.123-1vmw.701.0.0.16850804, VMW_bootbank_i40iwn_1.1.2.6-1vmw.701.0.0.16850804, VMW_bootbank_iavmd_2.0.0.1055-5vmw.701.0.0.16850804, VMW_bootbank_icen_1.0.0.9-1vmw.701.0.0.16850804, VMW_bootbank_igbn_0.1.1.0-7vmw.701.0.0.16850804, VMW_bootbank_iser_1.1.0.1-1vmw.701.0.0.16850804, VMW_bootbank_ixgben_1.7.1.28-1vmw.701.0.0.16850804, VMW_bootbank_lpfc_12.6.278.10-8vmw.701.0.0.16850804, VMW_bootbank_lpnic_11.4.62.0-1vmw.701.0.0.16850804, VMW_bootbank_lsi-mr3_7.712.51.00-1vmw.701.0.0.16850804, VMW_bootbank_lsi-msgpt2_20.00.06.00-3vmw.701.0.0.16850804, VMW_bootbank_lsi-msgpt35_13.00.13.00-2vmw.701.0.0.16850804, VMW_bootbank_lsi-msgpt3_17.00.10.00-2vmw.701.0.0.16850804, VMW_bootbank_mtip32xx-native_3.9.8-1vmw.701.0.0.16850804, VMW_bootbank_ne1000_0.8.4-11vmw.701.0.0.16850804, VMW_bootbank_nenic_1.0.29.0-2vmw.701.0.0.16850804, VMW_bootbank_nfnic_4.0.0.44-2vmw.701.0.0.16850804, VMW_bootbank_nhpsa_70.0050.0.100-1vmw.701.0.0.16850804, VMW_bootbank_nmlx4-core_3.19.16.8-2vmw.701.0.0.16850804, VMW_bootbank_nmlx4-en_3.19.16.8-2vmw.701.0.0.16850804, VMW_bootbank_nmlx4-rdma_3.19.16.8-2vmw.701.0.0.16850804, VMW_bootbank_nmlx5-core_4.19.16.8-2vmw.701.0.0.16850804, VMW_bootbank_nmlx5-rdma_4.19.16.8-2vmw.701.0.0.16850804, VMW_bootbank_ntg3_4.1.5.0-0vmw.701.0.0.16850804, VMW_bootbank_nvme-pcie_1.2.3.9-2vmw.701.0.0.16850804, VMW_bootbank_nvmerdma_1.0.1.2-1vmw.701.0.0.16850804, VMW_bootbank_nvmxnet3-ens_2.0.0.22-1vmw.701.0.0.16850804, VMW_bootbank_nvmxnet3_2.0.0.30-1vmw.701.0.0.16850804, VMW_bootbank_pvscsi_0.1-2vmw.701.0.0.16850804, VMW_bootbank_qcnic_1.0.15.0-10vmw.701.0.0.16850804, VMW_bootbank_qedentv_3.40.3.0-12vmw.701.0.0.16850804, VMW_bootbank_qedrntv_3.40.4.0-12vmw.701.0.0.16850804, VMW_bootbank_qfle3_1.0.67.0-9vmw.701.0.0.16850804, VMW_bootbank_qfle3f_1.0.51.0-14vmw.701.0.0.16850804, VMW_bootbank_qfle3i_1.0.15.0-9vmw.701.0.0.16850804, VMW_bootbank_qflge_1.1.0.11-1vmw.701.0.0.16850804, VMW_bootbank_rste_2.0.2.0088-7vmw.701.0.0.16850804, VMW_bootbank_sfvmk_2.4.0.0010-15vmw.701.0.0.16850804, VMW_bootbank_smartpqi_70.4000.0.100-3vmw.701.0.0.16850804, VMW_bootbank_vmkata_0.1-1vmw.701.0.0.16850804, VMW_bootbank_vmkfcoe_1.0.0.2-1vmw.701.0.0.16850804, VMW_bootbank_vmkusb-nic-fling_2.1-6vmw.701.0.0.40599856, VMW_bootbank_vmkusb_0.1-1vmw.701.0.0.16850804, VMW_bootbank_vmw-ahci_2.0.5-2vmw.701.0.0.16850804, VMware_bootbank_cpu-microcode_7.0.1-0.10.17119627, VMware_bootbank_crx_7.0.1-0.10.17119627, VMware_bootbank_elx-esx-libelxima.so_12.0.1200.0-3vmw.701.0.0.16850804, VMware_bootbank_esx-base_7.0.1-0.10.17119627, VMware_bootbank_esx-dvfilter-generic-fastpath_7.0.1-0.10.17119627, VMware_bootbank_esx-ui_1.34.4-16668064, VMware_bootbank_esx-update_7.0.1-0.10.17119627, VMware_bootbank_esx-xserver_7.0.1-0.10.17119627, VMware_bootbank_gc_7.0.1-0.10.17119627, VMware_bootbank_loadesx_7.0.1-0.10.17119627, VMware_bootbank_lsuv2-hpv2-hpsa-plugin_1.0.0-3vmw.701.0.0.16850804, VMware_bootbank_lsuv2-intelv2-nvme-vmd-plugin_1.0.0-2vmw.701.0.0.16850804, VMware_bootbank_lsuv2-lsiv2-drivers-plugin_1.0.0-4vmw.701.0.0.16850804, VMware_bootbank_lsuv2-nvme-pcie-plugin_1.0.0-1vmw.701.0.0.16850804, VMware_bootbank_lsuv2-oem-dell-plugin_1.0.0-1vmw.701.0.0.16850804, VMware_bootbank_lsuv2-oem-hp-plugin_1.0.0-1vmw.701.0.0.16850804, VMware_bootbank_lsuv2-oem-lenovo-plugin_1.0.0-1vmw.701.0.0.16850804, VMware_bootbank_lsuv2-smartpqiv2-plugin_1.0.0-4vmw.701.0.0.16850804, VMware_bootbank_native-misc-drivers_7.0.1-0.10.17119627, VMware_bootbank_qlnativefc_4.0.3.0-17vmw.701.0.0.16850804, VMware_bootbank_vdfs_7.0.1-0.10.17119627, VMware_bootbank_vmware-esx-esxcli-nvme-plugin_1.2.0.38-1vmw.701.0.0.16850804, VMware_bootbank_vsan_7.0.1-0.10.17119627, VMware_bootbank_vsanhealth_7.0.1-0.10.17119627, VMware_locker_tools-light_11.1.1.16303738-16850804
   VIBs Removed: VMW_bootbank_bnxtnet_216.0.50.0-4vmw.700.1.0.15843807, VMW_bootbank_bnxtroce_216.0.58.0-1vmw.700.1.0.15843807, VMW_bootbank_brcmfcoe_12.0.1500.0-1vmw.700.1.0.15843807, VMW_bootbank_brcmnvmefc_12.4.293.2-3vmw.700.1.0.15843807, VMW_bootbank_elxiscsi_12.0.1200.0-1vmw.700.1.0.15843807, VMW_bootbank_elxnet_12.0.1250.0-5vmw.700.1.0.15843807, VMW_bootbank_i40en_1.8.1.16-1vmw.700.1.0.15843807, VMW_bootbank_i40iwn_1.1.2.5-1vmw.700.1.0.15843807, VMW_bootbank_iavmd_2.0.0.1055-3vmw.700.1.0.15843807, VMW_bootbank_igbn_0.1.1.0-6vmw.700.1.0.15843807, VMW_bootbank_iser_1.1.0.0-1vmw.700.1.0.15843807, VMW_bootbank_ixgben_1.7.1.26-1vmw.700.1.0.15843807, VMW_bootbank_lpfc_12.4.293.3-5vmw.700.1.0.15843807, VMW_bootbank_lpnic_11.4.62.0-1vmw.700.1.0.15843807, VMW_bootbank_lsi-mr3_7.712.50.00-1vmw.700.1.0.15843807, VMW_bootbank_lsi-msgpt2_20.00.06.00-2vmw.700.1.0.15843807, VMW_bootbank_lsi-msgpt35_13.00.12.00-1vmw.700.1.0.15843807, VMW_bootbank_lsi-msgpt3_17.00.10.00-1vmw.700.1.0.15843807, VMW_bootbank_mtip32xx-native_3.9.8-1vmw.700.1.0.15843807, VMW_bootbank_ne1000_0.8.4-10vmw.700.1.0.15843807, VMW_bootbank_nenic_1.0.29.0-1vmw.700.1.0.15843807, VMW_bootbank_nfnic_4.0.0.44-1vmw.700.1.0.15843807, VMW_bootbank_nhpsa_2.0.50-1vmw.700.1.0.15843807, VMW_bootbank_nmlx4-core_3.19.16.7-1vmw.700.1.0.15843807, VMW_bootbank_nmlx4-en_3.19.16.7-1vmw.700.1.0.15843807, VMW_bootbank_nmlx4-rdma_3.19.16.7-1vmw.700.1.0.15843807, VMW_bootbank_nmlx5-core_4.19.16.7-1vmw.700.1.0.15843807, VMW_bootbank_nmlx5-rdma_4.19.16.7-1vmw.700.1.0.15843807, VMW_bootbank_ntg3_4.1.4.1-1vmw.700.1.0.15843807, VMW_bootbank_nvme-pcie_1.2.2.13-1vmw.700.1.0.15843807, VMW_bootbank_nvmerdma_1.0.0.0-1vmw.700.1.0.15843807, VMW_bootbank_nvmxnet3-ens_2.0.0.22-1vmw.700.1.0.15843807, VMW_bootbank_nvmxnet3_2.0.0.30-1vmw.700.1.0.15843807, VMW_bootbank_pvscsi_0.1-2vmw.700.1.0.15843807, VMW_bootbank_qcnic_1.0.15.0-8vmw.700.1.0.15843807, VMW_bootbank_qedentv_3.12.1.0-23vmw.700.1.0.15843807, VMW_bootbank_qedrntv_3.12.1.2-12vmw.700.1.0.15843807, VMW_bootbank_qfle3_1.0.66.0-5vmw.700.1.0.15843807, VMW_bootbank_qfle3f_1.0.51.0-12vmw.700.1.0.15843807, VMW_bootbank_qfle3i_1.0.15.0-6vmw.700.1.0.15843807, VMW_bootbank_qflge_1.1.0.11-1vmw.700.1.0.15843807, VMW_bootbank_rste_2.0.2.0088-7vmw.700.1.0.15843807, VMW_bootbank_sfvmk_2.0.0.1004-3vmw.700.1.0.15843807, VMW_bootbank_smartpqi_1.0.4.3011-1vmw.700.1.0.15843807, VMW_bootbank_vmkata_0.1-1vmw.700.1.0.15843807, VMW_bootbank_vmkfcoe_1.0.0.2-1vmw.700.1.0.15843807, VMW_bootbank_vmkusb-nic-fling_2.1-6vmw.700.1.0.39035884, VMW_bootbank_vmkusb_0.1-1vmw.700.1.0.15843807, VMW_bootbank_vmw-ahci_1.3.9-1vmw.700.1.0.15843807, VMware_bootbank_cpu-microcode_7.0.0-1.0.15843807, VMware_bootbank_crx_7.0.0-1.0.15843807, VMware_bootbank_elx-esx-libelxima.so_12.0.1200.0-2vmw.700.1.0.15843807, VMware_bootbank_esx-base_7.0.0-1.0.15843807, VMware_bootbank_esx-dvfilter-generic-fastpath_7.0.0-1.0.15843807, VMware_bootbank_esx-ui_1.34.0-15603211, VMware_bootbank_esx-update_7.0.0-1.0.15843807, VMware_bootbank_esx-xserver_7.0.0-1.0.15843807, VMware_bootbank_loadesx_7.0.0-1.0.15843807, VMware_bootbank_lsuv2-hpv2-hpsa-plugin_1.0.0-2vmw.700.1.0.15843807, VMware_bootbank_lsuv2-intelv2-nvme-vmd-plugin_1.0.0-2vmw.700.1.0.15843807, VMware_bootbank_lsuv2-lsiv2-drivers-plugin_1.0.0-2vmw.700.1.0.15843807, VMware_bootbank_lsuv2-nvme-pcie-plugin_1.0.0-1vmw.700.1.0.15843807, VMware_bootbank_lsuv2-oem-dell-plugin_1.0.0-1vmw.700.1.0.15843807, VMware_bootbank_lsuv2-oem-hp-plugin_1.0.0-1vmw.700.1.0.15843807, VMware_bootbank_lsuv2-oem-lenovo-plugin_1.0.0-1vmw.700.1.0.15843807, VMware_bootbank_lsuv2-smartpqiv2-plugin_1.0.0-3vmw.700.1.0.15843807, VMware_bootbank_native-misc-drivers_7.0.0-1.0.15843807, VMware_bootbank_qlnativefc_4.0.1.0-3vmw.700.1.0.15843807, VMware_bootbank_vdfs_7.0.0-1.0.15843807, VMware_bootbank_vmware-esx-esxcli-nvme-plugin_1.2.0.37-1vmw.700.1.0.15843807, VMware_bootbank_vsan_7.0.0-1.0.15843807, VMware_bootbank_vsanhealth_7.0.0-1.0.15843807, VMware_locker_tools-light_11.0.5.15389592-15843807
   VIBs Skipped:
[root@esxiserver:/vmfs/volumes/0364c042-e0f8e72a/vmware/vSphere7/esxi-patch]

よって、依存するパッケージがある場合は、その全てを-dオプションで指定すればアップデートできる、ということのようだった。

HPE 5700 スイッチのコマンド


以前にHPE5700スイッチの設定をした際、「HPE 5700 スイッチの日付設定」という記事を書いた。

今回はもっといくつか設定が必要になったので、いろいろメモ書きとして残しておく。

参考にしたもの
HPEスイッチ(旧H3C)シリーズ 設定別コマンド早見表
HPEスイッチ 基本コマンド&初期設定例 ~VLAN/リンクアグリゲーション(LACP), ssh, snmp, ntp, syslog等の管理設定,debug~

2022/04/14追記
HPE 5940スイッチの設定をする際に探したら HPE japanの純正ドキュメント「HPE FLEXFABRIC & FLEXNETWORK スイッチ基本操作ガイド V1.1」を発見した
普通使う設定の範囲は概ね含んでいるので、まずはコレを読むと良い。(2023/03/29に確認したらv1.1からv1.3にアップデートしていた)

上記の配布元URLは「[Switch] HPE FlexFabric / FlexNetwork スイッチ基本操作ガイド」で、他に「Aruba CXスイッチ基本操作ガイド」と「ArubaOSスイッチ基本操作ガイド」があった。(2023/03/29時点では ARUBA CX スイッチ 基本操作ガイド V3.0とARUBA OS スイッチ 基本操作ガイド V1.6)

基本

・特権モードに入る

「system」「system-view」(“sys”でもOK)

・設定の確認

現在の設定確認「display current-configuration」
保存されている設定確認「display saved-configuration」

なお、「display」はCisco風に「show」でも動く

・設定確認とかの際に「More」を表示させない

「screen-length disable」を非特権モードで実行する。

・設定したものを保存

「save」

・設定を入れたものを消すとき

「undo 各コマンド」(Ciscoの”no 各コマンド”に相当)

ポートの状態確認

「display interface brief」

「display link-aggregation summary」
「display link-aggregation port」
「display link-aggregation member-port」

スイッチの個体設定

・スイッチのホスト名設定

「sysname ホスト名」

・現在時刻表示

「show clock」

・タイムゾーン設定

「clock timezone Tokyo add 09:00:00」

・手動で時刻を設定する場合

まず特権モードで「clock protocol none」
次に非特権モードで「clock datetime 21:09:00 2020/07/26」

・NTP設定をする場合

「clock protocol ntp」でNTPプロトコルを指定したあと
「ntp-service unicast-server xxx.xxx.xx.xx」

NTPサーバが複数ある場合は、サーバ毎に「ntp-service unicast-server ~」を実行する。

また、NTP通信に使用するインタフェースを指定する場合は「ntp-service source M-GigabitEthernet 0/0/0」とか「ntp-service source Vlan-interface1」という形で指定する

NTPの動作状況は「show ntp-service sessions」と「show ntp-service status」

・管理用IPアドレス

HPE5710背面にある管理用(MGMT)インタフェース(MGE0/0/0)に管理用IPアドレスを割り当てる場合

interface M-GigabitEthernet0/0/0
ip address 172.17.44.227 255.255.0.0
no dhcp client identifier
<interface Vlanから抜けたあと>
ip route-static 0.0.0.0 0.0.0.0 172.17.0.1

Vlan-interface1に管理用IPアドレスを割り当てる場合

interface Vlan-interface1
ip address 172.17.44.1 255.255.0.0
<interface Vlanから抜けたあと>
ip route-static 0.0.0.0 0.0.0.0 172.17.0.1

・管理用ユーザ作成

「admin」というユーザをパスワード「password」で作成する場合

local-user admin
password simple password
authorization-attribute user-role network-admin
service-type ssh https

作成したローカルユーザの確認「display local-user」

・リモートログインへの権限割り当て

vtyの0~4にsshでログインする権限を与える。
なお、下記はuser-roleとしてnetwork-adminとnetwork-operatorの2つが書かれているが実際は「user-role network-admin」を追加するだけで、自動的にnetwork-operatorも追加された。

line vty 0 4
authentication-mode scheme
user-role network-admin
user-role network-operator
protocol inbound ssh
idle-timeout 30 5

・リモートログインの許可

ssh有効設定「ssh server enable」
状態確認「display ssh server status」

・Web管理画面有効化

httpsを有効にする場合「ip https enable」
現在の設定状況確認「display ip https」

VLAN関連

「display vlan brief」

Link-aggregation設定

Link-aggregation/Trunk/トランク/LACP/IEE 802.3ad設定について

VMware KB「ESXi/ESX および Cisco/HP スイッチによる EtherChannel/リンク集約コントロール プロトコル (LACP) のサンプル構成 (1004048)

ジャンボフレーム関連

layer-2向け設定とlayer-3向け設定がある模様

interfaceの下で「mtu 9000」と設定するか、「jumboframe enable」と設定するか?

jumboframeの方はlayer-2/layer-3の両方で記載があったが、mtuの方はlayer-3のみ記載があった

jumboframe enableにすると10000のジャンボフレームが使えるようになる。「jumboframe enable 数値」でも可でその場合は1536~10000が指定できる

mtuの場合は「mtu 数値」で指定する。数値は128~9008

GL.iNet GL-MV1000でDynamic DNSが動かない


GL.iNet GL-MV1000のlcuiの方でdyn.comのDynamic DNSを設定したのだが、再起動時に自動実行してくれない。

設定画面としては下記の様になっている。

Enabledにチェックが入っているので、自動起動してもよさそうなのだがしていない。

とりあえず起動の仕組みをさぐるため、ルータにrootでログイン。

とりあえず「/etc/init.d」にはどんなファイルがあるのか確認してみると「ddns」というソレっぽいファイルが。

root@GL-MV1000:~# ls /etc/init.d
boot              firewall          gl_s2s            initswitch        openvpn           sysctl            usbmode
bootcount         firewall_gl       gl_tertf          led               qosswitch         sysfixtime        vpn-service
clear_flag        gl_fixdomain      gl_udp_server     lighttpd          relayd            sysntpd           wireguard
cron              gl_init           glcrond           log               rpcd              system            wireguard_server
ddns              gl_monitor        glfw              modem-init        samba             ucitrack
dnsmasq           gl_mqtt           glqos             mwan3             smstools3         uhttpd
done              gl_mv1000         gpio_switch       network           startvpn          umount
dropbear          gl_route_policy   haveged           odhcpd            stubby            urandom_seed
root@GL-MV1000:~#

/etc/rc.dには「S95ddns」と「K10ddns」(どちらも/etc/init.d/ddnsへのシンボリックリンク)

root@GL-MV1000:~# ls /etc/rc.d
K10ddns              S00sysfixtime        S19dnsmasq           S50glfw              S95ddns              S99lighttpd
K10gpio_switch       S10boot              S19dropbear          S50stubby            S95done              S99startvpn
K50dropbear          S10gl_mv1000         S19firewall          S60samba             S96led               S99urandom_seed
K51stubby            S10system            S19mwan3             S70modem-init        S98sysntpd           S99wireguard
K85odhcpd            S11sysctl            S20network           S80gl_tertf          S99bootcount         S99wireguard_server
K89log               S12log               S20usbmode           S80relayd            S99gl_monitor
K90network           S12rpcd              S21initswitch        S80ucitrack          S99gl_mqtt
K90sysfixtime        S13haveged           S35odhcpd            S90vpn-service       S99gl_route_policy
K98boot              S15gl_fixdomain      S50cron              S94gpio_switch       S99gl_s2s
K99umount            S18firewall_gl       S50glcrond           S94smstools3         S99gl_udp_server
root@GL-MV1000:~#

すでに/etc/rc.d/S95ddnsがあるので起動時から動作していても良さそうなのにしていない、ということはスクリプトの中で何らかの処理を行っているはず、ということで中身を確認。

root@GL-MV1000:~# cat /etc/init.d/ddns
#!/bin/sh /etc/rc.common
START=95
STOP=10
boot() {
return 0
}
reload() {
/usr/lib/ddns/dynamic_dns_updater.sh -- reload
return 0
}
restart() {
/usr/lib/ddns/dynamic_dns_updater.sh -- stop
sleep 1
enable=`uci -q get ddns.glddns.enabled`
if [ "$enable" = 1 ];then
        /usr/lib/ddns/dynamic_dns_updater.sh -- start
fi
}
start() {
enable=`uci -q get ddns.glddns.enabled`
if [ "$enable" = 1 ];then
        /usr/lib/ddns/dynamic_dns_updater.sh -- start
fi
}
stop() {
/usr/lib/ddns/dynamic_dns_updater.sh -- stop
return 0
}
root@GL-MV1000:~#

「start()」で「uci -q get ddns.glddns.enabled」の値を確認している。

root@GL-MV1000:~# uci -q get ddns.glddns.enabled
root@GL-MV1000:~#

現状は値が設定されていないため、起動していないようだ。

uciのパラメータを全部確認する場合は「uci -q show」で確認できるので、「uci -q show|grep dns.」を実行してみた。

root@GL-MV1000:~# uci -q show|grep dns.
ddns.global=ddns
ddns.global.ddns_dateformat='%F %R'
ddns.global.ddns_loglines='250'
ddns.global.upd_privateip='0'
ddns.myddns_ipv4=service
ddns.myddns_ipv4.lookup_host='yourhost.example.com'
ddns.myddns_ipv4.domain='yourhost.example.com'
ddns.myddns_ipv4.username='your_username'
ddns.myddns_ipv4.password='your_password'
ddns.myddns_ipv4.interface='wan'
ddns.myddns_ipv4.ip_source='network'
ddns.myddns_ipv4.ip_network='wan'
ddns.myddns_ipv4.service_name='dyn.com'
ddns.myddns_ipv4.enabled='0'
ddns.myddns_ipv6=service
ddns.myddns_ipv6.update_url='http://[USERNAME]:[PASSWORD]@your.provider.net/nic/update?hostname=[DOMAIN]&myip=[IP]'
ddns.myddns_ipv6.lookup_host='yourhost.example.com'
ddns.myddns_ipv6.domain='yourhost.example.com'
ddns.myddns_ipv6.username='your_username'
ddns.myddns_ipv6.password='your_password'
ddns.myddns_ipv6.use_ipv6='1'
ddns.myddns_ipv6.interface='wan6'
ddns.myddns_ipv6.ip_source='network'
ddns.myddns_ipv6.ip_network='wan6'
ddns.myddns_ipv6.enabled='0'
ddns.osakana=service
ddns.osakana.enabled='1'
ddns.osakana.lookup_host='********************'
ddns.osakana.service_name='dyn.com'
ddns.osakana.domain='********************'
ddns.osakana.username='********************'
ddns.osakana.password='********************'
dhcp.@dnsmasq[0]=dnsmasq
dhcp.@dnsmasq[0].domainneeded='1'
dhcp.@dnsmasq[0].boguspriv='1'
dhcp.@dnsmasq[0].filterwin2k='0'
dhcp.@dnsmasq[0].localise_queries='1'
dhcp.@dnsmasq[0].rebind_protection='1'
dhcp.@dnsmasq[0].rebind_localhost='1'
dhcp.@dnsmasq[0].local='/lan/'
dhcp.@dnsmasq[0].domain='lan'
dhcp.@dnsmasq[0].expandhosts='1'
dhcp.@dnsmasq[0].nonegcache='0'
dhcp.@dnsmasq[0].authoritative='1'
dhcp.@dnsmasq[0].readethers='1'
dhcp.@dnsmasq[0].leasefile='/tmp/dhcp.leases'
dhcp.@dnsmasq[0].resolvfile='/tmp/resolv.conf.auto'
dhcp.@dnsmasq[0].nonwildcard='1'
dhcp.@dnsmasq[0].localservice='1'
glconfig.ddns=service
glconfig.ddns.enabled='0'
luci.diag.dns='openwrt.org'
ucitrack.@dhcp[0].init='dnsmasq'
root@GL-MV1000:~#

ん?

「glconfig.ddns.enabled=’0’」?

もしかして、GL.iNet Admin Panelの方にある???

[アプリケーション]-[リモートアクセス]に「ダイナミックDNS」がありました。

有効化をしてみます

これにより「uci -q show|grep dns.」に大きな変化が・・・

root@GL-MV1000:~# uci -q show|grep dns.
ddns.global=ddns
ddns.global.ddns_dateformat='%F %R'
ddns.global.ddns_loglines='250'
ddns.global.upd_privateip='0'
ddns.global.use_curl='1'
ddns.osakana=service
ddns.osakana.enabled='1'
ddns.osakana.lookup_host='*******************'
ddns.osakana.service_name='dyn.com'
ddns.osakana.domain='*******************'
ddns.osakana.username='*******************'
ddns.osakana.password='*******************'
ddns.glddns=service
ddns.glddns.interface='wan'
ddns.glddns.check_interval='10'
ddns.glddns.check_unit='minutes'
ddns.glddns.force_interval='60'
ddns.glddns.force_unit='minutes'
ddns.glddns.ip_url='http://checkip.dyndns.com'
ddns.glddns.ip_source='web'
ddns.glddns.password='*******************'
ddns.glddns.username='*******************'
ddns.glddns.domain='cx0f702.glddns.com'
ddns.glddns.param_enc='cx0f702'
ddns.glddns.lookup_host='cx0f702.glddns.com'
ddns.glddns.service_name='glddns.com'
ddns.glddns.update_url='http://[USERNAME]:[PASSWORD]@ddns.glddns.com/nic/update?hostname=[PARAMENC]&myip=[IP]'
ddns.glddns.enabled='1'
dhcp.@dnsmasq[0]=dnsmasq
dhcp.@dnsmasq[0].domainneeded='1'
dhcp.@dnsmasq[0].boguspriv='1'
dhcp.@dnsmasq[0].filterwin2k='0'
dhcp.@dnsmasq[0].localise_queries='1'
dhcp.@dnsmasq[0].rebind_protection='1'
dhcp.@dnsmasq[0].rebind_localhost='1'
dhcp.@dnsmasq[0].local='/lan/'
dhcp.@dnsmasq[0].domain='lan'
dhcp.@dnsmasq[0].expandhosts='1'
dhcp.@dnsmasq[0].nonegcache='0'
dhcp.@dnsmasq[0].authoritative='1'
dhcp.@dnsmasq[0].readethers='1'
dhcp.@dnsmasq[0].leasefile='/tmp/dhcp.leases'
dhcp.@dnsmasq[0].resolvfile='/tmp/resolv.conf.auto'
dhcp.@dnsmasq[0].nonwildcard='1'
dhcp.@dnsmasq[0].localservice='1'
glconfig.ddns=service
glconfig.ddns.enabled='0'
glconfig.ddns.check_status='1'
glconfig.ddns.ddns_enabled='1'
glconfig.ddns.http_enabled='0'
glconfig.ddns.https_enabled='0'
glconfig.ddns.ssh_enabled='0'
luci.diag.dns='openwrt.org'
ucitrack.@dhcp[0].init='dnsmasq'
root@GL-MV1000:~#

そして、luciの方も無事Dynamic DNSが起動している状態となりました。

また、GL.iNetの提供するDynamic DNS(glddns)もあわせて有効になっています。