はじめに
本稿では、ネットワークインフラの自動化管理と監視に関する実践的な設定例を紹介する。具体的な動作原理と操作方法については、関連技術ドキュメントを参照されたい。
ネットワーク構成
本章では、示すネットワークトポロジーに基づいた各機器の設定内容を説明する。
コアスイッチ1(core-sw1)の設定
sys
sysname core-sw1
vlan batch 10 20 30 40 50 60 100
vlan batch 200 210 220 230 240 250
stp region-configuration
region-name huawei
revision-level 1
instance 1 vlan 10 20 30
instance 2 vlan 40 50 60
instance 3 vlan 200 210 220
instance 4 vlan 230 240 250
instance 5 vlan 100
active region-configuration
q
stp instance 1 root primary
stp instance 3 root primary
stp instance 5 root primary
stp instance 2 root secondary
stp instance 4 root secondary
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan all
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan all
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan all
interface GigabitEthernet0/0/3
eth-trunk 1
interface GigabitEthernet0/0/4
eth-trunk 1
interface Vlanif10
ip address 172.16.0.252 255.255.254.0
vrrp vrid 10 virtual-ip 172.16.1.254
vrrp vrid 10 priority 120
interface Vlanif20
ip address 172.16.2.252 255.255.254.0
vrrp vrid 10 virtual-ip 172.16.3.254
vrrp vrid 10 priority 120
interface Vlanif30
ip address 172.16.4.252 255.255.254.0
vrrp vrid 10 virtual-ip 172.16.5.254
vrrp vrid 10 priority 120
interface Vlanif40
ip address 172.16.6.252 255.255.254.0
vrrp vrid 10 virtual-ip 172.16.7.254
vrrp vrid 10 priority 100
interface Vlanif50
ip address 172.16.8.252 255.255.254.0
vrrp vrid 10 virtual-ip 172.16.9.254
vrrp vrid 10 priority 100
interface Vlanif60
ip address 172.16.10.252 255.255.254.0
vrrp vrid 10 virtual-ip 172.16.11.254
vrrp vrid 10 priority 100
dhcp enable
ip pool POOL_VLAN10
network 172.16.0.0 mask 255.255.254.0
gateway-list 172.16.1.254
dns-list 192.168.150.1
excluded-ip-address 172.16.1.1 172.16.1.253
excluded-ip-address 172.16.0.252 172.16.0.253
interface Vlanif10
dhcp select global
q
ip pool POOL_VLAN20
network 172.16.2.0 mask 255.255.254.0
gateway-list 172.16.3.254
dns-list 192.168.150.1
excluded-ip-address 172.16.3.1 172.16.3.253
excluded-ip-address 172.16.2.252 172.16.2.253
interface Vlanif20
dhcp select global
q
ip pool POOL_VLAN30
network 172.16.4.0 mask 255.255.254.0
gateway-list 172.16.5.254
dns-list 192.168.150.1
excluded-ip-address 172.16.5.1 172.16.5.253
excluded-ip-address 172.16.4.252 172.16.4.253
interface Vlanif30
dhcp select global
q
ip pool POOL_VLAN40
network 172.16.6.0 mask 255.255.254.0
gateway-list 172.16.7.254
dns-list 192.168.150.1
excluded-ip-address 172.16.7.1 172.16.7.253
excluded-ip-address 172.16.6.252 172.16.6.253
interface Vlanif40
dhcp select global
q
ip pool POOL_VLAN50
network 172.16.8.0 mask 255.255.254.0
gateway-list 172.16.9.254
dns-list 192.168.150.1
excluded-ip-address 172.16.9.1 172.16.9.253
excluded-ip-address 172.16.8.252 172.16.8.253
interface Vlanif50
dhcp select global
q
ip pool POOL_VLAN60
network 172.16.10.0 mask 255.255.254.0
gateway-list 172.16.11.254
dns-list 192.168.150.1
excluded-ip-address 172.16.11.1 172.16.11.253
excluded-ip-address 172.16.10.252 172.16.10.253
interface Vlanif60
dhcp select global
q
interface Vlanif200
ip address 172.200.1.251 255.255.254.0
vrrp vrid 20 virtual-ip 172.200.1.254
vrrp vrid 20 priority 120
interface Vlanif210
ip address 172.210.3.251 255.255.254.0
vrrp vrid 20 virtual-ip 172.210.3.254
vrrp vrid 20 priority 120
interface Vlanif220
ip address 172.220.5.251 255.255.254.0
vrrp vrid 20 virtual-ip 172.220.5.254
vrrp vrid 20 priority 120
interface Vlanif230
ip address 172.230.7.251 255.255.254.0
vrrp vrid 20 virtual-ip 172.230.7.254
vrrp vrid 20 priority 100
interface Vlanif240
ip address 172.240.9.251 255.255.254.0
vrrp vrid 20 virtual-ip 172.240.9.254
vrrp vrid 20 priority 100
interface Vlanif250
ip address 172.250.11.251 255.255.254.0
vrrp vrid 20 virtual-ip 172.250.11.254
vrrp vrid 20 priority 100
interface Vlanif100
ip address 192.168.100.251 255.255.255.0
vrrp vrid 20 virtual-ip 192.168.100.254
vrrp vrid 20 priority 120
vlan 70
interface Vlanif70
ip address 10.1.70.1 255.255.255.252
interface GigabitEthernet0/0/5
port link-type access
port default vlan 70
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
router id 2.2.2.2
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 10.1.70.0 0.0.0.3
network 172.16.0.0 0.0.1.255
network 172.16.2.0 0.0.1.255
network 172.16.4.0 0.0.1.255
network 172.16.6.0 0.0.1.255
network 172.16.8.0 0.0.1.255
network 172.16.10.0 0.0.1.255
network 172.200.0.0 0.0.1.255
network 172.210.2.0 0.0.1.255
network 172.220.4.0 0.0.1.255
network 172.230.6.0 0.0.1.255
network 172.240.8.0 0.0.1.255
network 172.250.10.0 0.0.1.255
network 192.168.100.0 0.0.0.255
network 2.2.2.2 0.0.0.0
q
コアスイッチ2(core-sw2)の設定
sys
sysname core-sw2
vlan batch 10 20 30 40 50 60 100
vlan batch 200 210 220 230 240 250
stp region-configuration
region-name huawei
revision-level 1
instance 1 vlan 10 20 30
instance 2 vlan 40 50 60
instance 3 vlan 200 210 220
instance 4 vlan 230 240 250
instance 5 vlan 100
active region-configuration
q
stp instance 1 root secondary
stp instance 3 root secondary
stp instance 5 root secondary
stp instance 2 root primary
stp instance 4 root primary
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan all
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan all
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan all
interface GigabitEthernet0/0/3
eth-trunk 1
interface GigabitEthernet0/0/4
eth-trunk 1
interface Vlanif10
ip address 172.16.0.253 255.255.254.0
vrrp vrid 10 virtual-ip 172.16.1.254
vrrp vrid 10 priority 100
interface Vlanif20
ip address 172.16.2.253 255.255.254.0
vrrp vrid 10 virtual-ip 172.16.3.254
vrrp vrid 10 priority 100
interface Vlanif30
ip address 172.16.4.253 255.255.254.0
vrrp vrid 10 virtual-ip 172.16.5.254
vrrp vrid 10 priority 100
interface Vlanif40
ip address 172.16.6.253 255.255.254.0
vrrp vrid 10 virtual-ip 172.16.7.254
vrrp vrid 10 priority 120
interface Vlanif50
ip address 172.16.8.253 255.255.254.0
vrrp vrid 10 virtual-ip 172.16.9.254
vrrp vrid 10 priority 120
interface Vlanif60
ip address 172.16.10.253 255.255.254.0
vrrp vrid 10 virtual-ip 172.16.11.254
vrrp vrid 10 priority 120
dhcp enable
ip pool POOL_VLAN10
network 172.16.0.0 mask 255.255.254.0
gateway-list 172.16.1.254
dns-list 192.168.150.1
excluded-ip-address 172.16.0.1 172.16.0.254
interface Vlanif10
dhcp select global
q
ip pool POOL_VLAN20
network 172.16.2.0 mask 255.255.254.0
gateway-list 172.16.3.254
dns-list 192.168.150.1
excluded-ip-address 172.16.2.1 172.16.2.254
interface Vlanif20
dhcp select global
q
ip pool POOL_VLAN30
network 172.16.4.0 mask 255.255.254.0
gateway-list 172.16.5.254
dns-list 192.168.150.1
excluded-ip-address 172.16.4.1 172.16.4.254
interface Vlanif30
dhcp select global
q
ip pool POOL_VLAN40
network 172.16.6.0 mask 255.255.254.0
gateway-list 172.16.7.254
dns-list 192.168.150.1
excluded-ip-address 172.16.6.1 172.16.6.254
interface Vlanif40
dhcp select global
q
ip pool POOL_VLAN50
network 172.16.8.0 mask 255.255.254.0
gateway-list 172.16.9.254
dns-list 192.168.150.1
excluded-ip-address 172.16.8.1 172.16.8.254
interface Vlanif50
dhcp select global
q
ip pool POOL_VLAN60
network 172.16.10.0 mask 255.255.254.0
gateway-list 172.16.11.254
dns-list 192.168.150.1
excluded-ip-address 172.16.10.1 172.16.10.254
interface Vlanif60
dhcp select global
q
interface Vlanif200
ip address 172.200.1.252 255.255.254.0
vrrp vrid 20 virtual-ip 172.200.1.254
vrrp vrid 20 priority 100
interface Vlanif210
ip address 172.210.3.252 255.255.254.0
vrrp vrid 20 virtual-ip 172.210.3.254
vrrp vrid 20 priority 100
interface Vlanif220
ip address 172.220.5.252 255.255.254.0
vrrp vrid 20 virtual-ip 172.220.5.254
vrrp vrid 20 priority 100
interface Vlanif230
ip address 172.230.7.252 255.255.254.0
vrrp vrid 20 virtual-ip 172.230.7.254
vrrp vrid 20 priority 120
interface Vlanif240
ip address 172.240.9.252 255.255.254.0
vrrp vrid 20 virtual-ip 172.240.9.254
vrrp vrid 20 priority 120
interface Vlanif250
ip address 172.250.11.252 255.255.254.0
vrrp vrid 20 virtual-ip 172.250.11.254
vrrp vrid 20 priority 120
interface Vlanif100
ip address 192.168.100.252 255.255.255.0
vrrp vrid 20 virtual-ip 192.168.100.254
vrrp vrid 20 priority 100
vlan 80
interface Vlanif80
ip address 10.1.80.1 255.255.255.252
interface GigabitEthernet0/0/5
port link-type access
port default vlan 80
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
router id 3.3.3.3
ospf 1 router-id 3.3.3.3
silent-interface Vlanif10
silent-interface Vlanif20
silent-interface Vlanif30
silent-interface Vlanif40
silent-interface Vlanif50
silent-interface Vlanif60
silent-interface Vlanif200
silent-interface Vlanif210
silent-interface Vlanif220
silent-interface Vlanif230
silent-interface Vlanif240
silent-interface Vlanif250
silent-interface Vlanif100
area 0.0.0.0
network 10.1.80.0 0.0.0.3
network 172.16.0.0 0.0.1.255
network 172.16.2.0 0.0.1.255
network 172.16.4.0 0.0.1.255
network 172.16.6.0 0.0.1.255
network 172.16.8.0 0.0.1.255
network 172.16.10.0 0.0.1.255
network 172.200.0.0 0.0.1.255
network 172.210.2.0 0.0.1.255
network 172.220.4.0 0.0.1.255
network 172.230.6.0 0.0.1.255
network 172.240.8.0 0.0.1.255
network 172.250.10.0 0.0.1.255
network 192.168.100.0 0.0.0.255
network 3.3.3.3 0.0.0.0
q
集約スイッチ1(sum-sw1)の設定
sys
sysname sum-sw1
vlan batch 10 20 30 40 50 60 100
vlan batch 200 210 220 230 240 250
port-group group-member GigabitEthernet0/0/1 to GigabitEthernet0/0/9
port link-type trunk
port trunk allow-pass vlan all
q
stp region-configuration
region-name huawei
revision-level 1
instance 1 vlan 10 20 30
instance 2 vlan 40 50 60
instance 3 vlan 200 210 220
instance 4 vlan 230 240 250
instance 5 vlan 100
active region-configuration
q
集約スイッチ2(sum-sw2)の設定
sys
sysname sum-sw2
vlan batch 10 20 30 40 50 60 100
vlan batch 200 210 220 230 240 250
port-group group-member GigabitEthernet0/0/1 to GigabitEthernet0/0/9
port link-type trunk
port trunk allow-pass vlan all
q
stp region-configuration
region-name huawei
revision-level 1
instance 1 vlan 10 20 30
instance 2 vlan 40 50 60
instance 3 vlan 200 210 220
instance 4 vlan 230 240 250
instance 5 vlan 100
active region-configuration
q
接入スイッチ(SW1-SW6)の設定
接入スイッチ1(SW1)
sys
sysname SW1
vlan batch 10 100 200
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 100 200
q
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 100 200
q
interface GigabitEthernet0/0/3
port link-type access
port default vlan 10
q
接入スイッチ2(SW2)
sys
sysname SW2
vlan batch 20 100 210
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 20 100 210
q
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 20 100 210
q
interface GigabitEthernet0/0/3
port link-type access
port default vlan 20
q
接入スイッチ3(SW3)
sys
sysname SW3
vlan batch 30 100 220
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 30 100 220
q
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 30 100 220
q
interface GigabitEthernet0/0/3
port link-type access
port default vlan 30
q
接入スイッチ4(SW4)
sys
sysname SW4
vlan batch 40 100 230
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 40 100 230
q
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 40 100 230
q
interface GigabitEthernet0/0/3
port link-type access
port default vlan 40
q
接入スイッチ5(SW5)
sys
sysname SW5
vlan batch 50 100 240
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 50 100 240
q
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 50 100 240
q
interface GigabitEthernet0/0/3
port link-type access
port default vlan 50
q
接入スイッチ6(SW6)
sys
sysname SW6
vlan batch 60 100 250
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 60 100 250
q
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 60 100 250
q
interface GigabitEthernet0/0/3
port link-type access
port default vlan 60
q
ファイアウォール(FW1)の設定
admin
Huawei@123
Admin@123
sys
sysname FW1
firewall zone untrust
add interface GigabitEthernet1/0/4
q
firewall zone trust
add interface GigabitEthernet0/0/0
add interface GigabitEthernet1/0/0
add interface GigabitEthernet1/0/1
add interface GigabitEthernet1/0/3
q
firewall zone dmz
add interface GigabitEthernet1/0/2
q
interface GigabitEthernet1/0/0
ip address 10.1.70.2 255.255.255.252
q
interface GigabitEthernet1/0/1
ip address 10.1.80.2 255.255.255.252
q
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
q
router id 1.1.1.1
ospf 1 router-id 1.1.1.1
default-route-advertise always
area 0.0.0.0
network 10.1.70.0 0.0.0.3
network 10.1.80.0 0.0.0.3
q
DMZスイッチ(DMZ-SW1)の設定
sys
sysname DMZ-SW1
vlan batch 150 160 170
interface Vlanif150
ip address 192.168.150.254 255.255.255.0
q
interface Vlanif160
ip address 192.168.160.254 255.255.255.0
q
interface Vlanif170
ip address 192.168.170.254 255.255.255.0
q
interface GigabitEthernet0/0/2
port link-type access
port default vlan 150
q
interface GigabitEthernet0/0/3
port link-type access
port default vlan 160
q
interface GigabitEthernet0/0/4
port link-type access
port default vlan 170
q
vlan 90
interface Vlanif90
ip address 10.1.90.1 255.255.255.252
q
interface GigabitEthernet0/0/1
port link-type access
port default vlan 90
q
interface LoopBack0
ip address 4.4.4.4 255.255.255.255
q
router id 4.4.4.4
ospf 1 router-id 4.4.4.4
area 0.0.0.1
network 192.168.150.0 0.0.0.255
network 192.168.160.0 0.0.0.255
network 192.168.170.0 0.0.0.255
network 10.1.90.0 0.0.0.3
network 4.4.4.4 0.0.0.0
q
設定のポイント
本構成では STP(Spanning Tree Protocol)による冗長化、VRRP(Virtual Router Redundancy Protocol)によるデフォルトゲートウェイの冗長化、OSPF による動的ルーティングを設定している。各 VLAN ごとに DHCP プールを構成し、IP アドレスの自動割当てを行っている。