1.
1、原理介绍
1.2
、拓扑
1.2
、配制
PC1:===============================
int f0/0
duplex full
speed 100
ip add 10.1.1.2 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 10.1.1.1
PC2:==================================
int f0/0
duplex full
speed 100
ip add 10.2.2.2 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 10.1.1.2
Sw1:交换上的配制===================================
vlan datebase
vlan 10
//创建
vlan 10
vlan 20 //创建
vlan 20
int f0/1 //将
f0/1端口放在
vlan 10中
duplex full
speed 100
switchport mode access
switchport access vlan 10
no sh
int f0/2 //将
f0/2端口放在
vlan 20中
duplex full
speed 100
switchport mode access
switchport access vlan 20
no sh
int f0/5 //该端口和路由器相连,所以设为
trunk链路。
shutdown
duplex full
speed 100
switchport mode trunk
switchport trunk encap dot1q
no sh
R1:===================================
int f0/0
no sh
int f0/0.1
encap dot1q 10 //其中的
10为是
vlan
10
ip add 10.1.1.1 255.255.255.0
no sh
int f0/0.2
encap dot1q 20 //其中的
20为是
vlan
20
ip add 10.2.2.1 255.255.255.0
no sh
exit
ip route 10.1.1.0 255.255.255.0 f0/0.1
//设置静态路由
ip route 10.2.2.0 255.255.255.0 f0/0.2
1.3、验证
我们用
PC1来
ping PC2,如果通说明实验成功。然后我们把交换机上的
f0/5 shutdown再来看看是不是不通了。。
©著作权归作者所有:来自51CTO博客作者gary168的原创作品,如需转载,请注明出处,否则将追究法律责任
0
收藏
转载于:https://blog.51cto.com/gary407568105/142308