目录
1.1按实验配置pc1-pc4及服务器的IP地址、子网掩码及网关
一.实验一拓扑图
1.实验步骤
1.1配置pc1-pc4的IP地址、子网掩码及网关
1.2配置交换机与路由器的命令
sw2
vlan batch 10 20 30
int e0/0/1
port link-type access(p l a)
port default vlan 10(p d v 10)
int e0/0/2
port link-type access(p l a)
port default vlan 20(p d v 20)
int e0/0/3
port link-type access(p l a)
port default vlan 30(p d v 30)
int g0/0/1
port link-type trunk(p l t)
port trunk allow-pass vlan 2 to 4094(p t a v a)
sw1
vlan batch 10 20 30 100
int g0/0/1
port link-type trunk(p l t)
port trunk allow-pass vlan 2 to 4094(p t a v a)
int g0/0/2
port link-type access(p l a)
port default vlan 100(p d v 100)
int Vlanif10
ip address 192.168.1.254 24
int Vlanif20
ip address 192.168.2.254 24
int Vlanif30
ip address 192.168.3.254 24
int Vlanif100
ip address 192.168.4.1 24
ip route-static 192.168.5.0 24 192.168.4.2
ip route-static 172.16.1.0 24 10.1.11.1
R1
int g0/0/0
ip address 192.168.4.2 24
int g0/0/1
ip address 192.168.5.254 24
ip route-static 0.0.0.0 0 192.168.4.1
1.3将相关命令配置好后ping看能否通信(以pc2为例)
二.实验二拓扑图
1.实验步骤
1.1按实验配置pc1-pc4及服务器的IP地址、子网掩码及网关
1.2配置交换机与路由器的命令
sw5
vlan 20
int e0/0/1
p l a
p d v 20
int e0/0/2
p l a
p d v 20
int g0/0/1
p l t
p t a v a
sw4
vlan 10
int e0/0/1
p l a
p d v 10
int e0/0/2
p l a
p d v 10
int g0/0/1
p l t
p t a v a
sw3
vlan batch 20 300
int g0/0/1
p l t
p t a v a
int g0/0/2
p l t
p t a v a
int vlanif 20
ip add 192.168.2.254 24
int vlanif 300
ip add 10.1.13.2 30
ip route-static 192.168.1.0 24 10.1.13.1
ip route-static 172.16.1.0 24 10.1.13.1
sw2
vlan batch 10 200
int g0/0/2
p l t
p t a v a
int g0/0/1
p l t
p t a v a
int vlanif 10
ip add 192.168.1.254 24
int vlanif 200
ip add 10.1.12.2 30
ip route-static 192.168.2.0 24 10.1.12.1
ip route-static 172.16.1.0 24 10.1.12.1
sw1
vlan batch 100 200 300
int g0/0/1
p l a
p d v 100
int g0/0/2
p l t
p t a v a
int g0/0/3
p l t
p t a v a
int vlanif 100
ip add 10.1.11.2 30
int vlanif 200
ip add 10.1.12.1 30
int vlanif 300
ip add 10.1.13.1 30
ip route-static 192.168.1.0 24 10.1.12.2
ip route-static 192.168.2.0 24 10.1.13.2
R1
int g0/0/0
ip add 10.1.11.1 30
int g0/0/1
ip add 172.16.1.254 24
ip route-static 0.0.0.0 0 10.1.11.2