一、 创建vlan,和配置trunk、将接口加入到vlan
1) sw1创建多个vlan,和查看创建的vlan
[SW1]vlan batch 10 20
[SW1]interface GigabitEthernet 0/0/1
[SW1-GigabitEthernet0/0/1]port link-type trunk
[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
3) 将接口加入到vlan
[SW1]interface Ethernet 0/0/1 [SW1-Ethernet0/0/1]port link-type access
[SW1-Ethernet0/0/1]port default vlan 10
[SW1]interface Ethernet 0/0/2 [SW1-Ethernet0/0/2]port link-type access
[SW1-Ethernet0/0/2]port default vlan 20
二、 配置单臂路由
1) pc1和pc2配置IP地址
2) R1配置单臂路由,配置子接口
[R1]interface GigabitEthernet 0/0/0.10
[R1-GigabitEthernet0/0/0.10]arp broadcast enable
[R1-GigabitEthernet0/0/0.10]dot1q termination vid 10
[R1-GigabitEthernet0/0/0.10]ip address 192.168.10.1 24
[R1]interface GigabitEthernet 0/0/0.20
[R1-GigabitEthernet0/0/0.20]arp broadcast enable
[R1-GigabitEthernet0/0/0.20]dot1q termination vid 20
[R1-GigabitEthernet0/0/0.20]ip address 192.168.20.1 24
查看配置的子接口的端口
3) 测试能不能ping通
三、 配置ospf多区域、重分发、ospf汇总,ospf认证
1)R1、R2、R3、R4、win7配置IP地址
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ipaddress 192.168.40.1 24
[R1]interface LoopBack 1 [R1-LoopBack1]ipaddress 1.1.1.1 32
[R1]interface GigabitEthernet 0/0/2
[R1-GigabitEthernet0/0/2]ip address 192.168.30.2 24
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.40.2 24
[R2]interface LoopBack 2
[R2-LoopBack2]ip address 2.2.2.2 32
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.50.1 24
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.50.2 24
[R3]interface LoopBack 1
[R3-LoopBack1]ip address 3.3.3.3 32
[R3]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.60.1 24
[R4]interface GigabitEthernet 0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.30.1 24
[R4]interface LoopBack 1
[R4-LoopBack1]ip address 172.16.1.1 24
[R4]interface LoopBack 2
[R4-LoopBack2]ip address 172.16.2.1 24
[R4]interface LoopBack 3
[R4-LoopBack3]ip address 172.1 3.1 24
[R4]interface LoopBack 4
[R4-LoopBack4]ip address 172.16.4.1 24
[R1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 192.168.40.0 0.0.0.255
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 192.168.40.0 0.0.0.255
[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]network 192.168.50.0 0.0.0.255
[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.1]network 192.168.50.0 0.0.0.255
测试配置的ospf
4) R1、R3配置ospf重分发直连路由、R1可以ping通60.0网段,pc1也可以ping通60.0网段
[R1]ospf 1
[R1-ospf-1]import-route direct type 2
[R3]ospf 1
[R3-ospf-1]import-route direct type 2
[R1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]authentication-mode simple pwd@123
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]authentication-mode simple pwd@123
[R2]ospf 1
[R2-ospf-1]area 1
[R2-ospf-1-area-0.0.0.1]authentication-mode simple pwd@123
[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]authentication-mode simple pwd@123
验证
四、 R4、R1配置rip v2
1)R4配置rip v2宣告直连网络
[R4]rip 1
[R4-rip-1]version 2
[R4-rip-1]network 192.168.30.0
[R4-rip-1]network 172.16.0.0
2)R1配置rip v2宣告直连网络
[R1]rip 1
[R1-rip-1]version 2
[R1-rip-1]network 192.168.30.0
五、 在R1将rip发布到ospf,将ospf发布到Rip中,
[R1]ospf 1
[R1-ospf-1]import-route rip cost 1
[R1]rip 1
[R1-rip-1]import-route ospf cost 1
1)rip重分发一条直连路由,使全网互通。
[R1]rip 1
[R1-rip-1]import-route direct
[R4]interface GigabitEthernet0/0/0
[R4-GigabitEthernet0/0/0]rip summary-address 172.16.0.0 255.255.255.0
七、 路由器开启telnet,win7可以telnet到
1) 路由器开启telnet
[R2]user-interface vty 0 4
[R2-ui-vty0-4]authentication-mode password
[R2-ui-vty0-4]set authentication password cipher pwd@123
[R2-ui-vty0-4]user privilege level 15
[R4]user-interface vty 0 4
[R4-ui-vty0-4]authentication-mode password
[R4-ui-vty0-4]set authentication password cipher pwd@123
[R4-ui-vty0-4]user privilege level 15