中小企业中必用的静态路由网络技术,一分钟了解下

2023-06-28 13:00:48

一、静态路由

静态路由是这样的一种路由,它通过人工输入到路由选择表中。

二、静态路由优点

1、不需要动态路由选择协议,这减少了路由器的日常开销。

2、在小型互连网络上很容易配置。

3、可以控制路由选择。

三、静态路由配置

五台路由器,划分成三个网段;要求使用静态路由协议,使得路由器之间能够互相通信

帧中继仅了解即可,不作为掌握技术。重点掌握静态路由配置。

1、R1配置:

R1#sh run

Building configuration...

Current configuration : 743 bytes

!

version 12.2

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname R1

!

!

ip subnet-zero

no ip domain-lookup

!

!

!

!

interface Loopback0

ip address 1.1.1.1 255.255.255.255

!

interface Ethernet0

ip address 172.16.1.1 255.255.255.0

!

interface Ethernet1

no ip address

shutdown

!

interface Serial0

no ip address

shutdown

!

interface Serial1

ip address 172.16.2.1 255.255.255.0

encapsulation frame-relay

frame-relay map ip 172.16.2.3 103 broadcast

frame-relay map ip 172.16.2.5 105 broadcast

no frame-relay inverse-arp

!

ip classless

ip route 172.16.3.0 255.255.255.0 172.16.2.3

no ip http server

!

!

!

line con 0

exec-timeout 0 0

logging synchronous

line aux 0

line vty 0 4

!

End

R2#sh run

Building configuration...

Current configuration:

!

version 12.0

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname R2

!

!

ip subnet-zero

no ip domain-lookup

!

!

!

!

interface Loopback0

ip address 2.2.2.2 255.255.255.255

no ip directed-broadcast

!

interface Ethernet0

ip address 172.16.1.2 255.255.255.0

no ip directed-broadcast

!

interface Ethernet1

no ip address

no ip directed-broadcast

shutdown

!

interface Serial0

no ip address

no ip directed-broadcast

shutdown

!

interface Serial1

no ip address

no ip directed-broadcast

shutdown

!

no ip http server

ip classless

ip route 172.16.2.0 255.255.255.0 172.16.1.1

ip route 172.16.3.0 255.255.255.0 172.16.1.1

!

!

line con 0

exec-timeout 0 0

logging synchronous

transport input none

line aux 0

line vty 0 4

!

End

R3#sh run

Building configuration...

Current configuration:

!

version 12.0

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname R3

!

!

!

!

!

!

ip subnet-zero

no ip domain-lookup

!

cns event-service server

!

!

!

!

!

interface Loopback0

ip address 3.3.3.3 255.255.255.255

no ip directed-broadcast

!

interface Ethernet0

no ip address

no ip directed-broadcast

shutdown

!

interface Serial0

ip address 172.16.3.3 255.255.255.0

no ip directed-broadcast

encapsulation ppp

!

interface Serial1

ip address 172.16.2.3 255.255.255.0

no ip directed-broadcast

encapsulation frame-relay

frame-relay map ip 172.16.2.5 301 broadcast

frame-relay map ip 172.16.2.1 301 broadcast

no frame-relay inverse-arp

!

ip classless

ip route 172.16.1.0 255.255.255.0 172.16.2.1

no ip http server

!

!

!

line con 0

exec-timeout 0 0

logging synchronous

transport input none

line aux 0

line vty 0 4

!

End

R4#sh run

Building configuration...

Current configuration : 798 bytes

!

version 12.1

no service single-slot-reload-enable

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname R4

!

logging rate-limit console 10 except errors

!

ip subnet-zero

no ip finger

no ip domain-lookup

!

cns event-service server

!

!

!

!

!

interface Loopback0

ip address 4.4.4.4 255.255.255.255

!

interface Ethernet0

no ip address

shutdown

!

interface Serial0

no ip address

shutdown

!

interface Serial1

ip address 172.16.3.4 255.255.255.0

encapsulation ppp

clockrate 64000

!

ip kerberos source-interface any

ip classless

ip route 172.16.1.0 255.255.255.0 172.16.3.3

ip route 172.16.2.0 255.255.255.0 172.16.3.3

no ip http server

!

!

!

line con 0

exec-timeout 0 0

logging synchronous

transport input none

line aux 0

line vty 0 4

!

End

R5#sh run

Building configuration...

Current configuration:

!

version 12.1

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname R5

!

!

!

!

!

!

ip subnet-zero

no ip domain-lookup

!

cns event-service server

!

!

!

interface Loopback0

ip address 5.5.5.5 255.255.255.255

!

interface Ethernet0

no ip address

shutdown

!

interface Serial0

no ip address

shutdown

!

interface Serial1

ip address 172.16.2.5 255.255.255.0

encapsulation frame-relay

frame-relay map ip 172.16.2.3 501 broadcast

frame-relay map ip 172.16.2.1 501 broadcast

no frame-relay inverse-arp

!

ip classless

ip route 172.16.1.0 255.255.255.0 172.16.2.1

ip route 172.16.3.0 255.255.255.0 172.16.2.3

no ip http server

!

!

!

line con 0

exec-timeout 0 0

logging synchronous

transport input none

line aux 0

line vty 0 4

总结:静态路由配置非常简单,就像地图一样需要管理员手动进行绘制,路由目的地及下一跳,可以理解为到达目的地就必须要到达下一站才能逐跳达到。经过的每一跳路由器都都必须有到达目标的路由和下一跳地址。