一、vlan间三层路由
1.1、描述
vlan间路由可以通过routerswitch来做也就是三层交换机,不用通过路由器。
1.2、拓扑
通过三层交换路由不需要另外的交换机,可以让如图所示vlan10与vlan20之间的主机互相访问。
2.3、其本配制
SW1 :===========================
vlan datebase
vlan 10 /创建vlan 10
vlan 20 /创建 vlan 20
exit
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
PC1 :============================
int f0/0
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 /由于拿路由器来模拟PC所以启默认路由指向网关
PC2 :============================
int f0/0
ip add 10.2.2.2 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 10.2.2.1
以上命令配制好后,PC1 ping PC2 是ping不通的
2.4、配制三层路由
SW1 :============================
conf t
ip routing /在交换机上启用路由功能
int vlan 10
ip add 10.1.1.1 255.255.255.0 /设备vlan的IP地址
no sh
int vlan 20
ip add 10.1.1.2 255.255.255.0
no sh
这样配制后 再用PC1来ping PC2是不是通了。是不是很简单