对VLAN的划分和VLAN间路由也是CCNP认证考试中常见的内容,需要各位学员熟悉掌握在使用路由器来组网时候的这些要点知识。 r4和r5模拟pc机,r3为三层交换机,r1为路由器。 r4: no ip routing in e0/1 ip add 192.168.2.2 255.255.255.0 duplx full no sh ip default-gateway 192.168.2.1 r5: no ip routing in e0/1 ip add 192.168.3.2 255.255.255.0 duplx full no sh ip default-gateway 192.168.3.1 r3: vlan database vlan 3 vlan 2 exit ip routing in f0/1 switchport mode acc switchport acc vlan 2 in f0/2 switchport mode acc switchport acc vlan 3 in vlan 2 ip add 192.168.2.1 255.255.255.0 no sh in vlan 3 ip add 192.168.3.1 255.255.255.0 no sh in f0/3 no switchport 这条命令将端口作为三层端口使用,二层端口是不能够配ip地址的。 ip add 192.168.1.1 255.255.255.0 no sh ip route 0.0.0.0 0.0.0.0 192.168.1.2 r1: in e0/1 ip add 192.168.1.2 255.255.255.0 no sh ip nat inside in e0/2 ip add 118.122.119.1 255.255.255.0 no sh ip nat outside access-list 1 permit 192.168.2.0 0.0.0.255 access-list 2 permit 192.168.3.0 0.0.0.255 ip nat inside source list 1 inter e0/2 overload ip route 0.0.0.0 0.0.0.0 118.122.119.2 r2: in e0/1 ip add 118.122.119.2 255.255.255.0 no sh in loop 1 ip add 2.2.2.2 255.0.0.0 no sh switch#show ip ro i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is 192.168.1.2 to network 0.0.0.0 C    192.168.1.0/24 is directly connected, FastEthernet0/3  | 
不良信息举报Q:2000617|Archiver|ROS软路由论坛 ROSABC.com 网络方案网络工程交流
GMT+8, 2025-11-4 21:08 , Processed in 0.033118 second(s), 16 queries .
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.