概述:S1模拟为公司核心交换机,并作为DHCP服务器为市场部和财务部客户端分配IP地址。
S1配置
<Huawei>sys
[Huawei]sysname S1
[S1]vlan batch 10 20
[S1]int g0/0/1
[s1-GigabitEthernet0/0/1]port link-type trunk
[s1-GigabitEthernet0/0/1]port trunk allow-pass vlan 10
[s1-GigabitEthernet0/0/1]int g0/0/2
[s1-GigabitEthernet0/0/2]port link-type trunk
[s1-GigabitEthernet0/0/2]port trunk allow-pass vlan 20
[s1-GigabitEthernet0/0/2]int vlan 10
[s1-Vlanif10]ip add 192.168.1.1 24
[s1-Vlanif10]dhcp select global
[s1-Vlanif10]int vlan 20
[s1-Vlanif20]ip add 192.168.2.1 24
[s1-Vlanif20]dhcp select global
[s1-Vlanif20]q
[S1]ip pool shichang
[s1-ip-pool-shichang]network 192.168.1.0 mask 24
[s1-ip-pool-shichang]gateway-list 192.168.1.1
[s1-ip-pool-shichang]dns-list 219.141.140.10 8.8.8.8
[s1-ip-pool-shichang]lease day 2 hour 0 minute
[s1-ip-pool-shichang]excluded-ip-address 192.168.1.2 192.168.1.100
[s1-ip-pool-shichang]q
[S1]ip pool caiwu
[s1-ip-pool-caiwu]network 192.168.2.0 mask 24
[s1-ip-pool-caiwu]gateway-list 192.168.2.1
[s1-ip-pool-caiwu]dns-list 219.141.140.10 8.8.8.8
[s1-ip-pool-caiwu]lease day 3 hour 0 minute 0
[s1-ip-pool-caiwu]excluded-ip-address 192.168.2.2 192.168.2.100
[s1-ip-pool-caiwu]static-bind ip-address 192.168.2.115 mac-address 5489-9873-3534
[s1-ip-pool-caiwu]q
[S1]
S2配置
<s2>sys
[s2]vlan 10
[s2]int e0/0/0
[s2-Ethernet0/0/1]port link-type trunk
[s2-Ethernet0/0/1]port trunk allow-pass vlan 20
[s2-Ethernet0/0/1]int e0/0/2
[s2-Ethernet0/0/2]port link-type access
[s2-Ethernet0/0/2]port default vlan 20
[s2-Ethernet0/0/2]q [s2]
S3配置
<s3>sys
[s3]vlan 10
[s3]int e0/0/0
[s3-Ethernet0/0/1]port link-type trunk
[s3-Ethernet0/0/1]port trunk allow-pass vlan 10
[s3-Ethernet0/0/1]int e0/0/2
[s3-Ethernet0/0/2]port link-type access
[s3-Ethernet0/0/2]port default vlan 10
[s3-Ethernet0/0/2]q
[s3]