现在的位置: 首页 > 网络 > 正文

利用三层交换机实现VLAN间路由

2019年10月08日 网络 ⁄ 共 646字 ⁄ 字号 暂无评论

PC1
IP: 192.168.1.2
Submark: 255.255.255.0
Gateway: 192.168.1.1
PC2
IP: 192.168.2.2
Submark: 255.255.255.0
Gateway: 192.168.2.1
PC3
IP: 192.168.1.3
Submark: 255.255.255.0
Gateway: 192.168.1.1

3.配置二层交换机S1
en
conf t
vlan 2
exit
vlan 3
exit
int fa 0/2
switchport access vlan 2
int fa 0/3
switchport access vlan 3
int fa 0/1
switchport mode trunk
exit
show vlan
S3560

4.配置三层交换机

en
conf t

ip routing
vlan 2
exit
vlan 3
exit
int fa 0/1
switchport trunk encapsulation dot1q
switchport mode trunk
exit
int fa 0/2
switchport access vlan 2
exit
interface vlan 2
ip address 192.168.1.1 255.255.255.0
no shutdown
exit
interface vlan 3
ip address 192.168.2.1 255.255.255.0
no shutdown
exit
show ip route
show vlan

四、实验结果

PC3 Ping PC1
Ping 192.168.1.2
PC3 Ping PC2
Ping 192.168.1.3

给我留言

留言无头像?