码迷,mamicode.com
首页 > 其他好文 > 详细

每日总结

时间:2021-06-09 15:31:19      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:运行   hang   static   广播   first   vlsm   nal   pdo   lock   

计算机网络 动态路由配置

RIPRouting Information Protocol,路由信息协议,是应用较早、使用较普遍的IGP内部网关协议,适用于小型同类网络,是典型的距离矢量协议。

RIP协议跳数作为衡量路径开销的,RIP协议里规定最大跳数为15

RIP协议有两个版本RIPv1RIPv2

RIPv1属于有类路由协议,不支持VLSM(变长子网掩码),RIPv1是以广播的形式进行路由信息的更新的;更新周期为30秒。

RIPv2属于无类路由协议,支持VLSM(变长子网掩码),RIPv2是以组播的形式进行路由信息的更新的,组播地址是224.0.0.9RIPv2还支持基于端口的认证,提高网络的安全性。

OSPF协议用链路状态来评估路由,可用于规模很大的网络。

OSPF可通过区域划分网络,对于规模较小的网络一般只设置一个区域0,对于规模较大的网络,可划分多个区域,其中区域0是必不可少的,它用于连接其它各区域。

OSPF协议采用组播方式进行OSPF包交换,组播地址为224.0.0.5(全部OSPF路由器)和224.0.06(指定路由器)。

OSPF协议的管理距离是110,低于RIP协议的120,所以如果设备同时运行OSPF协议和RIP协议,则OSPF协议产生的路由优先级高。

技术图片

交换机

Switch>en

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#hostname S3560

S3560(config)#vlan 10

S3560(config-vlan)#exit

S3560(config)#vlan 20

S3560(config-vlan)#interface fa 0/10

S3560(config-if)#switchport access vlan 10

S3560(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up

exit

S3560(config)#int fa 0/20

S3560(config-if)#switchport access valn20

^

% Invalid input detected at ‘^‘ marker.

S3560(config-if)#exit

S3560(config)#interface vlan 10

S3560(config-if)#ip address 192.168.1.1 255.255.255.0

S3560(config)#int vlan 10

S3560(config-if)#ip address 192.168.1.1 255.255.255.0

S3560(config-if)#no shutdown

S3560(config-if)#exit

S3560(config)#int vlan 20

S3560(config-if)#

%LINK-5-CHANGED: Interface Vlan20, changed state to up

ip address 192.168.3.1 255.255.255.0

S3560(config-if)#no shutdown

S3560(config-if)#end

S3560#

%SYS-5-CONFIG_I: Configured from console by console

show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, 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 not set

 

C 192.168.1.0/24 is directly connected, Vlan10

 

S3560#conf t

Enter configuration commands, one per line. End with CNTL/Z.

S3560(config)#router ospf 1

S3560(config-router)#network 192.168.1.0 0.0.0.255 area 0

S3560(config-router)#network 192.168.3.0 0.0.0.255 area 0

S3560(config-router)#end

S3560#

%SYS-5-CONFIG_I: Configured from console by console

show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, 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 not set

 

C 192.168.1.0/24 is directly connected, Vlan10

 

S3560#conf t

Enter configuration commands, one per line. End with CNTL/Z.

S3560(config)#router ospf 1

S3560(config-router)#network 192.168.1.0 0.0.0.255 area 0

S3560(config-router)#network 192.168.3.0 0.0.0.255 area 0

S3560(config-router)#end

S3560#

%SYS-5-CONFIG_I: Configured from console by console

show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, 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 not set

 

C 192.168.1.0/24 is directly connected, Vlan10

 

路由A

Router>en

Router#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname R1

R1(config)#int fa 0/0

R1(config-if)#no shutdown

 

R1(config-if)#

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

 

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

 

R1(config-if)#ip address 192.168.3.2 255.255.255.0

R1(config-if)#exit

R1(config)#int serial 2/0

R1(config-if)#no shutdown

R1(config-if)#clock rate 64000

R1(config-if)#ip address 192.168.4.1 255.255.255.0

R1(config-if)#end

R1#

%SYS-5-CONFIG_I: Configured from console by console

show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, 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 not set

 

C 192.168.3.0/24 is directly connected, FastEthernet0/0

C 192.168.4.0/24 is directly connected, Serial2/0

 

R1#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R1(config)#router ospf 1

R1(config-router)#network 192.168.3.0 0.0.0.255 area 0

R1(config-router)#network 192.168.4.0 0.0.0.255 area 0

R1(config-router)#end

R1#

%SYS-5-CONFIG_I: Configured from console by console

show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, 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 not set

 

C 192.168.3.0/24 is directly connected, FastEthernet0/0

C 192.168.4.0/24 is directly connected, Serial2/0

 

路由B

Router>en

Router#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname R2

R2(config)#int fa 0/0

R2(config-if)#no shut down

 

R2(config-if)#

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

 

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

 

R2(config-if)#no shutdown

R2(config-if)#ip address 192.168.2.1 255.255.255.0

R2(config-if)#exit

R2(config)#int serial 2/0

R2(config-if)#no shutdown

R2(config-if)#ip address 192.168.4.2 255.255.255.0

R2(config-if)#end

R2#

%SYS-5-CONFIG_I: Configured from console by console

show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, 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 not set

 

C 192.168.2.0/24 is directly connected, FastEthernet0/0

C 192.168.4.0/24 is directly connected, Serial2/0

 

R2#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R2(config)#router ospf 1

R2(config-router)#network 192.168.2.0 0.0.0.255 area 0

R2(config-router)#network 192.168.4.0 0.0.0.255 area 0

R2(config-router)#end

R2#

%SYS-5-CONFIG_I: Configured from console by console

show ip route

每日总结

标签:运行   hang   static   广播   first   vlsm   nal   pdo   lock   

原文地址:https://www.cnblogs.com/Arisf/p/14866208.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!