本文共 3240 字,大约阅读时间需要 10 分钟。
S0#conf t
S0(config)#int fa 0/1S0(config-if)#switchport trunk encapsulation dot1qS0(config-if)#switchport mode trunkS0(config-if)#exitS0(config)#int fa 0/2S0(config-if)#switchport trunk encapsulation dot1qS0(config-if)#switchport mode trunkS0(config-if)#exitS0(config)#int fa 0/3S0(config-if)#switchport trunk encapsulation dot1qS0(config-if)#switchport mode trunkS1#vlan database
S1(vlan)#vtp domain liuChanging VTP domain name from a to liuR1(vlan)#vlan 2VLAN 2 added:Name: VLAN0002R1(vlan)#vlan 3VLAN 3 added:Name: VLAN0003R1(vlan)#vlan 4VLAN 4 added:Name: VLAN0004R1(vlan)#vlan 5VLAN 5 added:Name: VLAN0005R1(vlan)#vlan 6VLAN 6 added:Name: VLAN0006R1(vlan)#vlan 7VLAN 7 added:Name: VLAN0007S1(config)#int fa 0/2
S1(config-if)#switchport mode accessS1(config-if)#switchport access vlan 2S1(config)#int fa 0/3S1(config-if)#switchport mode accessS1(config-if)#switchport access vlan 3S2(config)#int fa 0/3
S2(config-if)#switchport mode accessS2(config-if)#switchport access vlan 4S2(config)#int fa 0/2S2(config-if)#switchport mode accessS2(config-if)#switchport access vlan 5S3(config)#int fa 0/2
S3(config-if)#switchport mode accessS3(config-if)#switchport access vlan 6S3(config)#int fa 0/3S3(config-if)#switchport mode accessS3(config-if)#switchport access vlan 7S0#conf t
S0(config)#int vlan 2S0(config-if)#ip address 192.168.2.1 255.255.255.0S0(config)#int vlan 3S0(config-if)#ip address 192.168.3.1 255.255.255.0S0(config)#int vlan 4S0(config-if)#ip address 192.168.4.1 255.255.255.0S0(config)#int vlan 5S0(config-if)#ip address 192.168.5.1 255.255.255.0S0(config)#int vlan 6S0(config-if)#ip address 192.168.6.1 255.255.255.0S0(config)#int vlan 7S0(config-if)#ip address 192.168.7.1 255.255.255.0S0(config)#ip dhcp pool 2
S0(dhcp-config)#network 192.168.2.0 255.255.255.0S0(dhcp-config)#default-router 192.168.2.1S0(config)#ip dhcp pool 3
S0(dhcp-config)#network 192.168.3.0 255.255.255.0S0(dhcp-config)#default-router 192.168.3.1S0(config)#ip dhcp pool 4
S0(dhcp-config)#network 192.168.4.0 255.255.255.0S0(dhcp-config)#default-router 192.168.4.1S0(config)#ip dhcp pool 5
S0(dhcp-config)#network 192.168.5.0 255.255.255.0S0(dhcp-config)#default-router 192.168.5.1S0(config)#ip dhcp pool 6
S0(dhcp-config)#network 192.168.6.0 255.255.255.0S0(dhcp-config)#default-router 192.168.6.1S0(config)#ip dhcp pool 7
S0(dhcp-config)#network 192.168.7.0 255.255.255.0S0(dhcp-config)#default-router 192.168.7.1S0(config)#ip routing
S0#show ip route转载于:https://blog.51cto.com/xwxhvip/2046925