交换机sw2配置
创建vlanvlan batch 10 20 30 40 50 60 70
进入接口,trunk模式
interface gigabitethernet g0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60
批量创建接口加入trunk模式,pvid为10
port-group group-member g0/0/2 to g0/0/6
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60
port trunk pvid vlan 10
交换机sw1配置
批量创建vlan10 20 30 40 50 60 70
vlan batch 10 20 30 40 50 60 70
交换机sw1核心交换机,为用户的网关,也为dhcp服务器
进入vlan接口,创建IP地址
interface vlanif 10
ip address 192.168.10.2 24
quit
interface vlanif 20
ip address 192.168.20.1 24
quit
interface vlanif 30
ip address 192.168.30.1 24
quit
interface vlanif 40
ip address 192.168.40.1 24
quit
interface vlanif 50
ip address 192.168.50.1 24
quit
interface vlanif 60
ip address 192.168.60.1 24
quit
开启dhcp服务
dhcp enable
创建ip地址池
ip pool vlan20
network 192.168.20.0 mask 24
gateway-list 192.168.20.1
quit
ip pool vlan30
network 192.168.30.0 mask 24
gateway-list 192.168.30.1
quit
ip pool vlan40
network 192.168.40.0 mask 24
gateway-list 192.168.40.1
quit
ip pool vlan50
network 192.168.50.0 mask 24
gateway-list 192.168.50.1