欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

三层交换VLAN路由配置技巧解析

程序员文章站 2023-01-03 12:51:53
三层交换VLAN路由配置技巧解析...

    pc1配置:

    no ip routing

    interface fastethernet0/0

    ip address 172.16.20.254 255.255.255.0

    no shutdown

    pc2配置:

    no ip routing

    interface fastethernet0/0

    ip address 172.16.30.254 255.255.255.0

    no shutdown

三层交换VLAN路由配置技巧解析

 

    switch配置:

    ip routing

    interface fastethernet0/1

    switchport access vlan 20

    no ip address

    !

    interface fastethernet0/2

    switchport access vlan 30

    no ip address

    !

    vlan database

    vlan 20

    vlan 30

    exit

    !

    interface vlan20

    ip address 172.16.20.1 255.255.255.0

    no shutdown

    !

    interface vlan30

    ip address 172.16.30.1 255.255.255.0

    no shutdown

    ===========================

    验证:

    pc1#ping 172.16.30.254 type escape sequence to abort. sending 5, 100-byte icmp echos to 172.16.30.254, timeout is 2 seconds: !!!!! success rate is 100 percent (5/5), round-trip min/avg/max = 44/100/196 ms

    pc2#ping 172.16.20.254 type escape sequence to abort. sending 5, 100-byte icmp echos to 172.16.20.254, timeout is 2 seconds: !!!!! success rate is 100 percent (5/5), round-trip min/avg/max = 56/80/120 ms