H3C基礎(chǔ)單臂路由+stp+dhcp配置
HCLHub練習(xí)
http://hclhub.h3c.com/project/5146/summary/master
HCLHub答案
http://hclhub.h3c.com/project/5149/summary/master
命令
R1
?sysname R1
?dhcp enable
dhcp server ip-pool vlan10
?gateway-list 192.168.10.254
?network 192.168.10.0 mask 255.255.255.0
?address range 192.168.10.10 192.168.10.100
?dns-list 8.8.8.8
?expired day 2
dhcp server ip-pool vlan20
?gateway-list 192.168.20.254
?network 192.168.20.0 mask 255.255.255.0
?address range 192.168.20.10 192.168.20.100
?dns-list 8.8.8.8
?expired day 2
interface GigabitEthernet0/0.1
?ip address 192.168.10.254 255.255.255.0
?vlan-type dot1q vid 10
?dhcp server apply ip-pool vlan10
interface GigabitEthernet0/0.2
?ip address 192.168.20.254 255.255.255.0
?vlan-type dot1q vid 20
?dhcp server apply ip-pool vlan20
SW1
?sysname SW1
vlan 10
vlan 20
?stp instance 0 root primary
?stp mode stp
interface GigabitEthernet1/0/1
?port link-type trunk
?port trunk permit vlan 1 10 20
interface GigabitEthernet1/0/2
?port link-type trunk
?port trunk permit vlan 1 10 20
interface GigabitEthernet1/0/24
?port link-type trunk
?port trunk permit vlan 1 10 20
SW2
sysname SW2
vlan 10
vlan 20
?stp instance 0 root secondary
?stp mode stp
interface GigabitEthernet1/0/1
?port access vlan 10
?stp edged-port
interface GigabitEthernet1/0/2
?port access vlan 20
?stp edged-port
interface GigabitEthernet1/0/3
?port link-type trunk
?port trunk permit vlan 1 10 20
interface GigabitEthernet1/0/4
?port link-type trunk
?port trunk permit vlan 1 10 20
SW3
?sysname SW3
vlan 10
vlan 20
?stp mode stp
interface GigabitEthernet1/0/1
?port access vlan 10
?stp edged-port
interface GigabitEthernet1/0/2
?port access vlan 20
?stp edged-port
interface GigabitEthernet1/0/3
?port link-type trunk
?port trunk permit vlan 1 10 20
interface GigabitEthernet1/0/4
?port link-type trunk
?port trunk permit vlan 1 10 20