视频1 视频21 视频41 视频61 视频文章1 视频文章21 视频文章41 视频文章61 推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37 推荐39 推荐41 推荐43 推荐45 推荐47 推荐49 关键词1 关键词101 关键词201 关键词301 关键词401 关键词501 关键词601 关键词701 关键词801 关键词901 关键词1001 关键词1101 关键词1201 关键词1301 关键词1401 关键词1501 关键词1601 关键词1701 关键词1801 关键词1901 视频扩展1 视频扩展6 视频扩展11 视频扩展16 文章1 文章201 文章401 文章601 文章801 文章1001 资讯1 资讯501 资讯1001 资讯1501 标签1 标签501 标签1001 关键词1 关键词501 关键词1001 关键词1501 专题2001
某大型思科网络的配置实例
2025-09-24 00:15:01 责编:小OO
文档
实战推荐:某大型思科网络的配置实例

【内容摘要】 编者按:这是一个比较综合的实例,从拓扑图上可以看出,它所包含的设备和技术。以下对这个例子作些说明希望能够和各位网友交流。1.对于内部局域网,选用cisco的catalyst6506作为中心交换机,二级交换采用catalyst3500,同时为了说明trunk,又加了一个catalyst2900作为三级交换,对于终端连接用了catalyst1900交换机,这样就可以在catalyst6506与catalyst3……

-----------------------------------------------------------------------------

 编者按:这是一个比较综合的实例,从拓扑图上可以看出,它所包含的设备和技术。以下对这个例子作些说明希望能够和各位网友交流。

  1.对于内部局域网,选用cisco的catalyst 6506作为中心交换机,二级交换采用catalyst 3500,同时为了说明trunk,又加了一个catalyst 2900 作为三级交换,对于终端连接用了catalyst 1900交换机,这样就可以在catalyst 6506与catalyst 3500之间以及catalyst 3500与catalyst 2900 之间建立trunk,实现跨交换机的vlan。

  注:catalyst 2900系列如果要实现trunk,软件必须是企业版的,关于类似疑问可以至疑难杂谈栏目。

  2.对于外连上,主要是专线连接和拨号访问,当然种类比较多.包括了ddn、 isdn、 frame relay、 e1 线路等。

  3.本例给出设备的基本配置。

  4.对于多设备的连接问题,值得注意的是路由问题,本实例外连部分采用静态路由而内部局域网采用动态路由.

  5.在本例的帧中继配置中,运用了ip unnumbered ,可以节省地址资源,有兴趣可以注意一下

  在网关有关*作说明讲行很多,但很少有实例,这个配置例我想对于许多入门的朋友启发不少,我也希望这么的帖子与大家共享和交流一下!

 配置实例

  vlan划分问题:

  对于交换设备本例中划到vlan 1中,而对于外连设备的所有以太网端口,均划到vlan 2中,下面给出各vlan的名称和网关地址,本例划分8个vlan.

  vlan id vlan name gateway

  vlan 1 bluestudy 1 10.1.0.1/16

  vlan 2 bluestudy 2 10.2.0.1/16

  vlan 3 bluestudy 3 10.3.0.1/16

  vlan 4 bluestudy 4 10.4.0.1/16

  vlan 5 bluestudy 5 10.5.0.1/16

  vlan 6 bluestudy 6 10.6.0.1/16

  vlan 7 bluestudy 7 10.7.0.1/16

  vlan 8 bluestudy 8 10.8.0.1/16

  catalyst 6506 的配置

  enter password:

  enable

  enter password:

  config t

  set system name bluestudy

  set time 10/30/2000 9:30:00

  set password

  set enablepass

  set interface sc0 10.1.0.2/16

  set ip route default 10.1.0.1

  set ip dns server 10.1.0.100

  set ip dns domain bluestudy.com

  set ip dns enable

  set vtp domain bluestudy mode server

  set vlan 1 name bluestudy 1

  set vlan 2 name bluestudy 2

  set vlan 3 name bluestudy 3

  set vlan 4 name bluestudy 4

  set vlan 5 name bluestudy 5

  set vlan 6 name bluestudy 6

  set vlan 7 name bluestudy 7

  set vlan 8 name bluestudy 8

  set port negotiation 2/1-8 enable

  set port name 2/1-8 gec 802.1q trunk

  set trunk 2/1-8 desirable dot1q

  set port speed 2/1-8 1000

  set vlan 1 3/1-48

  对于6506的交换机方面的配置只需做出trunk即可,因为要实现跨交换机之间的虚网,下面配置6506的路由模块,因为6506的路由模块现在与管理引擎模块集成在了一起,所以,默认命令是:session 15

  详情请见 6506 路由设置.

  catalyst 6506rsm模块的配置

  (enable) session 15

  trying router-15...

  connected to router-15.

  escape character is '^]'.

  enable

  configure terminal

  hostname bluestudy

  enable password password

  line vty 0 6

  password secret_word

  ip domain-name bluestudy.com

  ip name-server 10.1.0.100

  interface vlan 1

  ip address 10.1.0.1 255.255.0.0

  no shutdown

  interface vlan 2

  ip address 10.2.0.1 255.255.0.0

  no shutdown

  interface vlan 3

  ip address 10.3.0.1 255.255.0.0

  no shutdown

  interface vlan 4

  ip address 10.4.0.1 255.255.0.0

  no shutdown

  interface vlan 5

  ip address 10.5.0.1 255.255.0.0

  no shutdown

  interface vlan 6

  ip address 10.6.0.1 255.255.0.0

  no shutdown

  interface vlan 7

  ip address 10.7.0.1 255.255.0.0

  no shutdown

  interface vlan 8

  ip address 10.8.0.1 255.255.0.0

  no shutdown

  router rip

  version 2

  network 10.0.0.0

  ip route 0.0.0.0 0.0.0.0 10.2.0.12

  ip route 192.168.2.0 255.255.255.0 10.2.0.13

  ip route 192.168.3.0 255.255.255.240 10.2.0.11

  ip route 192.168.4.0 255.255.255.0 10.2.0.11

  ip route 192.168.5.0 255.255.255.0 10.2.0.11

  ip route 192.168.6.0 255.255.255.0 10.2.0.11

  copy running-config startup-config

  building configuration...

  [ok]

  这里给出的是单纯的命令行,略去了一些默认状况的设置. catalyst 3500 的配置

  catalyst 3500 的配置

  !

  version 12.0

  no service pad

  service timestamps debug uptime

  service timestamps log uptime

  service password-encryption

  !

  hostname bluestudy

  !

  enable password password

  !

  username bluestudy password password

  username test password password

  !

  省略端口的显示

  !

  interface gigabitethernet0/1

  switchport trunk encapsulation dot1q

  switchport mode trunk

  !

  interface gigabitethernet0/2

  !

  interface vlan1

  ip address 10.1.0.4 255.255.0.0

  ip helper-address 10.1.0.100

  ip directed-broadcast

  no ip route-cache

  !

  ip default-gateway 10.1.0.1

  interface ethernet1/1(与2900对接)

  switchport trunk encapsulation dot1q

  switchport mode trunk

  !

  interface ethernet1/2(与1900 a对接)

  switchport access vlan 3

  no shut

  !

  interface ethernet1/3(与1900 b对接)

  switchport access vlan 4

  no shut

  !

  snmp-server engineid local 000000090200000216be4e80

  snmp-server community public ro

  snmp-server community private rw

  snmp-server chassis-id 0x17

  (打开简单的网络管理,便于以后,cisco 网管软件识别和管理)

  !

  line con 0

  login local

  transport input none

  stopbits 1

  line vty 0 4

  login local

  line vty 5 15

  login

  !

  end

  catalyst 2900 的配置

  catalyst 2900 的配置

  2900的配置与3500的相似,命令如下

  hostname bluestudy

  !

  enable password password

  !

  username bluestudy password password

  username test password password

  !

  省略端口的显示

  !

  interface ethernet0/1(与3500对接)

  switchport trunk encapsulation dot1q

  switchport mode trunk

  !

  interface vlan1

  ip address 10.1.0.3 255.255.0.0

  ip helper-address 10.1.0.100

  ip directed-broadcast

  no ip route-cache

  !

  ip default-gateway 10.1.0.1

  !

  interface ethernet0/2(与1900 c对接)

  switchport access vlan 5

  no shut

  !

  interface ethernet0/3(与1900 d对接)

  switchport access vlan 6

  no shut

  !

  snmp-server engineid local 000000090200000216be4e80

  snmp-server community public ro

  snmp-server community private rw

  snmp-server chassis-id 0x17

  !

  line con 0

  login local

  transport input none

  stopbits 1

  line vty 0 4

  login local

  line vty 5 15

  login

  !

  end

  cisco catalyst 1900 的配置

  cisco catalyst 1900 的配置

  对于1900的配置就相对容易得多了

  只需在enable 状态下键入 setup 就会进入配置向导

  给出交换机的

  ip地址:10.3.0.5

  掩码:255.255.0.0

  网关:10.3.0.1

  就可以了,另外应该打开简单的网络管理协议snmp

  snmp-server community public ro

  snmp-server community private rw

  即可

  pix 520a的基本配置

  pix version 4.2(4)

  nameif ethernet0 outside security0

  nameif ethernet1 inside security100

  enable password password encrypted

  passwd password encrypted

  hostname pix_a

  fixup protocol ftp 21

  fixup protocol http 80

  fixup protocol smtp 25

  fixup protocol h323 1720

  fixup protocol rsh 514

  fixup protocol sqlnet 1521

  names

  no failover

  failover timeout 0:00:00

  failover ip address outside 0.0.0.0

  failover ip address inside 0.0.0.0

  pager lines 24

  no logging console

  logging monitor debugging

  logging buffered debugging

  no logging trap

  logging facility 20

  interface ethernet0 auto

  interface ethernet1 auto

  ip address outside 192.168.0.1 255.255.255.252

  ip address inside 10.2.0.13 255.255.0.0

  arp timeout 14400

  nat (inside ) 0 192.168.0.0 255.255.255.252

  rip outside passive

  no rip outside default

  no rip inside passive

  rip inside default

  route outside 192.168.2.0 255.255.255.0 192.168.0.2

  route inside 0.0.0.0 0.0.0.0 10.2.0.1

  timeout xlate 3:00:00 conn 1:00:00 udp 0:02:00

  timeout rpc 0:10:00 h323 0:05:00

  timeout uauth 0:05:00 absolut

  esnmp-server community public ro

  snmp-server community private rw

  telnet 10.2.0.200 255.255.255.255

  telnet timeout 15

  mtu outside 1500

  mtu inside 1500

  floodguard 0

  cisco 2610a 的配置

  cisco 2610a 的配置

  current configuration:

  !

  version 11.3

  service timestamps debug uptime

  service timestamps log uptime

  service password-encryption

  !

  hostname 2610a

  !

  enable password password

  !

  username bluestudy password password

  no ip domain-lookup!

  !

  interface ethernet0/0

  ip address 192.168.0.2 255.255.255.252

  no shut

  !

  interface serial0/0

  ip address 192.168.0.5 255.255.255.252

  no shut

  !

  interface serial0/1

  no ip address

  shutdown

  !

  ip route 0.0.0.0 0.0.0.0 192.168.0.1

  ip route 192.168.2.0 255.255.255.0 192.168.0.6

  !

  snmp-server community public ro

  snmp-server community private rw

  !

  line con 0

  line aux 0

  line vty 0 4

  login local

  !

  no scheduler allocate

  end

  cisco 1603的配置

  current configuration:

  !

  version 12.0

  service timestamps debug uptime

  service timestamps log uptime

  no service password-encryption

  !

  hostname 1603

  !

  enable secret password

  enable password password

  !

  memory-size iomem 25

  ip subnet-zero

  !

  interface serial0

  ip address 192.168.0.6 255.255.255.252

  no ip directed-broadcast

  !

  interface ethernet0

  ip address 192.168.2.1 255.255.255.0

  no ip unreachables

  no ip directed-broadcast

  !

  ip classless

  ip route 0.0.0.0 0.0.0.0 s0

  no ip http server

  !

  snmp-server community public ro

  snmp-server community private rw

  !

  line con 0

  password password

  transport input none

  line aux 0

  line vty 0 4

  password password

  login

  !

  no scheduler allocate

  end

  pix 520b的基本配置

  pix version 4.2(4)

  nameif ethernet0 outside security0

  nameif ethernet1 inside security100

  enable password password encrypted

  passwd password encrypted

  hostname pix520_b

  fixup protocol ftp 21

  fixup protocol http 80

  fixup protocol smtp 25

  fixup protocol h323 1720

  fixup protocol rsh 514

  fixup protocol sqlnet 1521

  names

  no failover

  failover timeout 0:00:00

  failover ip address outside 0.0.0.0

  failover ip address inside 0.0.0.0

  pager lines 24

  no logging console

  no logging monitor

  no logging buffered

  no logging trap

  logging facility 20

  interface ethernet0 auto

  interface ethernet1 auto

  ip address outside 202.108.66.97 255.255.255.248

  ip address inside 10.2.0.12 255.255.0.0

  arp timeout 14400

  global (outside) 1 202.108.66.100

  nat (inside) 1 0.0.0.0 0.0.0.0 0 0

  no rip outside passive

  no rip outside default

  no rip inside passive

  no rip inside default

  route outside 0.0.0.0 0.0.0.0 202.109.77.98

  timeout xlate 3:00:00 conn 1:00:00 udp 0:02:00

  timeout rpc 0:10:00 h323 0:05:00

  timeout uauth 0:05:00 absolute

  no snmp-server location

  no snmp-server contact

  snmp-server community public

  no snmp-server enable traps

  telnet 10.2.0.200 255.255.255.255

  telnet timeout 15

  mtu outside 1500

  mtu inside 1500

  floodguard 0

  cisco 2610b 的配置

  current configuration:

  !

  version 11.3

  service timestamps debug uptime

  service timestamps log uptime

  service password-encryption

  !

  hostname 2610b

  !

  enable password password

  !

  username bluestudy password password

  no ip domain-lookup!

  !

  interface ethernet0/0

  ip address 202.108.66.98 255.255.255.248

  no shut

  !

  interface serial0/0

  ip address 202.108.8.1 255.255.255.252

  no shut

  !

  interface serial0/1

  no ip address

  shutdown

  !

  ip route 0.0.0.0 0.0.0.0 202.108.8.2

  !

  snmp-server community public ro

  snmp-server community private rw

  !

  line con 0

  line aux 0

  line vty 0 4

  login local

  !

  no scheduler allocate

  end

  cisco 2610c 的配置

  version 11.2

  service udp-small-servers

  service tcp-small-servers

  !

  hostname 2610c

  !

  enable secret cisco

  !

  ip subnet-zero

  no ip domain-lookup

  !

  ip address-pool local

  isdn switch-type basic-net3

  interface ethernet0

  ip address 10.2.0.11 255.255.0.0

  !

  interface serial0

  no ip address

  encapsulation frame-relay

  frame-relay lmi-type ansi

  !

  interface serial0.1 point-to-point

  description frame relay to bluestudy1

  ip unnumbered ethernet0

  frame-relay interface-dlci 10

  !

  interface serial0.2 point-to-point

  description frame relay to bluestudy2

  ip unnumbered ethernet0

  frame-relay interface-dlci 11

  !

  interface bri1/0

  no ip address

  shutdown

  isdn switch-type basic-net3

  !

  interface bri1/1

  ip address 192.168.3.1 255.255.255.240

  encapsulation ppp

  timeout absolute 60 0

  dialer idle-timeout 3600

  dialer-group 1

  isdn switch-type basic-net3

  peer default ip address pool default

  ppp authentication chap pap callin

  !

  interface bri1/2

  no ip address

  encapsulation ppp

  shutdown

  isdn switch-type basic-net3

  !

  interface bri1/3

  no ip address

  encapsulation ppp

  shutdown

  isdn switch-type basic-net3

  no peer default ip address

  !

  ip local pool default 192.168.3.3 192.168.3.14

  ip http server

  ip classless

  ip route 192.168.5.0 255.255.255.0 serial0.1

  ip route 192.168.4.0 255.255.255.0 serial0.2

  ip route 0.0.0.0 0.0.0.0 10.2.0.1

  !

  access-list 1 permit any

  dialer-list 1 protocol ip list 1

  line con 0

  password console

  login

  line aux 0

  line vty 0 4

  password telnet

  login

  !

  end

  cisco 1720a 的配置

  version 11.2

  service udp-small-servers

  service tcp-small-servers

  hostname bluestudy1

  !

  enable secret cisco

  !

  ip subnet-zero

  no ip domain-lookup

  !

  interface fastethernet0

  ip address 192.168.5.1 255.255.255.0

  !

  interface serial0

  no ip address

  encapsulation frame-relay

  !

  interface serial0.1 point-to-point

  description frame relay to bluestudy

  ip unnumbered ethernet0

  frame-relay interface-dlci 10

  !

  ip http server

  ip classless

  ip route 0.0.0.0 0.0.0.0 serial0.1

  !

  line con 0

  password console

  login

  line aux 0

  line vty 0 4

  password bluestudy1

  login

  !

  end

  cisco 1720b 的配置

  version 11.2

  service udp-small-servers

  service tcp-small-servers

  hostname bluestudy1

  !

  enable secret cisco

  !

  ip subnet-zero

  no ip domain-lookup

  !

  interface fastethernet0

  ip address 192.168.4.1 255.255.255.0

  !

  interface serial0

  no ip address

  encapsulation frame-relay

  !

  interface serial0.1 point-to-point

  description frame relay to bluestudy

  ip unnumbered ethernet0

  frame-relay interface-dlci 11

  !

  ip http server

  ip classless

  ip route 0.0.0.0 0.0.0.0 serial0.1

  !

  line con 0

  password console

  login

  line aux 0

  line vty 0 4

  password bluestudy2

  login

  !

  end 

 公司内部网如何进行vlan的划分

  vlan的定义

  究竟什么是vlan呢? vlan(virtual local area network)即虚拟局域网,是一种通过将局域网内的设备逻辑地而不是物理地划分成一个个网段从而实现虚拟工作组的新兴技术。ieee于1999年颁布了用以标准化vlan实现方案的802.1q协议标准草案。

  vlan技术允许网络管理者将一个物理的lan逻辑地划分成不同的广播域(或称虚拟lan,即vlan),每一个vlan都包含一组有着相同需求的计算机工作站,与物理上形成的lan有着相同的属性。但由于它是逻辑地而不是物理地划分,所以同一个vlan内的各个工作站无须被放置在同一个物理空间里,即这些工作站不一定属于同一个物理lan网段。一个vlan内部的广播和单播流量都不会转发到其他vlan中,即使是两台计算机有着同样的网段,但是它们却没有相同的vlan号,它们各自的广播流也不会相互转发,从而有助于控制流量、减少设备投资、简化网络管理、提高网络的安全性。

  vlan是为解决以太网的广播问题和安全性而提出的,它在以太网帧的基础上增加了vlan头,用vlan id把用户划分为更小的工作组,不同工作组间的用户二层互访,每个工作组就是一个虚拟局域网。虚拟局域网的好处是可以广播范围,并能够形成虚拟工作组,动态管理网络。

  既然vlan隔离了广播风暴,同时也隔离了各个不同的vlan之间的通讯,所以不同的vlan之间的通讯是需要有路由来完成的。

  vlan的划分

  1.根据端口来划分vlan

  许多vlan厂商都利用交换机的端口来划分vlan成员。被设定的端口都在同一个广播域中。例如,一个交换机的1,2,3,4,5端口被定义为虚拟网aaa,同一交换机的6,7,8端口组成虚拟网bbb。这样做允许各端口之间的通讯,并允许共享型网络的升级。但是,这种划分模式将虚拟网在了一台交换机上。

  第二代端口vlan技术允许跨越多个交换机的多个不同端口划分vlan,不同交换机上的若干个端口可以组成同一个虚拟网。

  以交换机端口来划分网络成员,其配置过程简单明了。因此,从目前来看,这种根据端口来划分vlan的方式仍然是最常用的一种方式。

  2.根据mac地址划分vlan

  这种划分vlan的方*是根据每个主机的mac地址来划分,即对每个mac地址的主机都配置它属于哪个组。这种划分vlan方*的最大优点就是当用户物理位置移动时,即从一个交换机换到其他的交换机时,vlan不用重新配置,所以,可以认为这种根据mac地址的划分方*是基于用户的vlan,这种方*的缺点是初始化时,所有的用户都必须进行配置,如果有几百个甚至上千个用户的话,配置是非常累的。而且这种划分的方*也导致了交换机执行效率的降低,因为在每一个交换机的端口都可能存在很多个vlan组的成员,这样就无*广播包了。另外,对于使用笔记本电脑的用户来说,他们的网卡可能经常更换,这样,vlan就必须不停地配置。

  3.根据网络层划分vlan

  这种划分vlan的方*是根据每个主机的网络层地址或协议类型(如果支持多协议)划分的,虽然这种划分方*是根据网络地址,比如ip地址,但它不是路由,与网络层的路由毫无关系。

  这种方*的优点是用户的物理位置改变了,不需要重新配置所属的vlan,而且可以根据协议类型来划分vlan,这对网络管理者来说很重要,还有,这种方*不需要附加的帧标签来识别vlan,这样可以减少网络的通信量。

  这种方*的缺点是效率低,因为检查每一个数据包的网络层地址是需要消耗处理时间的(相对于前面两种方*),一般的交换机芯片都可以自动检查网络上数据包的以太网帧头,但要让芯片能检查ip帧头,需要更高的技术,同时也更费时。当然,这与各个厂商的实现方*有关。

  4.根据ip组播划分vlan

  ip 组播实际上也是一种vlan的定义,即认为一个组播组就是一个vlan,这种划分的方*将vlan扩大到了广域网,因此这种方*具有更大的灵活性,而且也很容易通过路由器进行扩展,当然这种方*不适合局域网,主要是效率不高。

  vlan的标准

  对vlan的标准,我们只是介绍两种比较通用的标准,当然也有一些公司具有自己的标准,比如cisco公司的isl标准,虽然不是一种大众化的标准,但是由于cisco catalyst交换机的大量使用,isl也成为一种不是标准的标准了。

  · 802.10vlan标准

  在1995年,cisco公司提倡使用ieee802.10协议。在此之前,ieee802.10曾经在全球范围内作为vlan安全性的同一规范。cisco公司试图采用优化后的802.10帧格式在网络上传输framtagging模式中所必须的vlan标签。然而,大多数802委员会的成员都反对推广802.10。因为,该协议是基于frametagging方式的。

  · 802.1q

  在1996年3月,ieee802.1internetworking委员会结束了对vlan初期标准的修订工作。新出台的标准进一步完善了vlan的体系结构,统一了fram-etagging方式中不同厂商的标签格式,并制定了vlan标准在未来一段时间内的发展方向,形成的802.1q的标准在业界获得了广泛的推广。它成为vlan史上的一块里程碑。802.1q的出现打破了虚拟网依赖于单一厂商的僵局,从一个侧面推动了vlan的迅速发展。另外,来自市场的压力使各大网络厂商立刻将新标准融合到他们各自的产品中。

  公司内部进行vlan的划分实例

  对于每个公司而言都有自己不同的需求,下面我们给出一个典型的公司的vlan的实例,这样也可以成为我们以后为公司划分vlan的依据。

  某公司现在有工程部、销售部、财务部。vlan的划分:工程部vlan10,销售部vlan20,财务部vlan30,并且各部门还可以相互通讯。现有设备如下:cisco 30路由器,cisco catalyst 2924交换机一台,二级交换机若干台。

  交换机配置文件中的部分代码如下:

  ......

  !

  interface vlan10

  ip address 192.168.0.1

  !

  interface vlan20

  ip address 192.168.1.1

  !

  interface vlan30

  ip address 192.168.2.1

  !

  ......

  路由器配置文件中的部分代码如下:

  ......

  interface fastethernet 1/0.1

  encapsulation isl 10

  ip address 192.168.0.2

  !

  interface fastethernet 1/0.2

  encapsulation isl 20

  ip address 192.168.1.2

  !

  interface fastethernet 1/0.3

  encapsulation isl 30

  ip address 192.168.2.2

  !

  ......

  !

  router rip

  network 192.168.0.0

  !

  ......

 入门童话

  可以把整个网络(一个自治系统as)看成一个王国,这个王国可以分成几个 区(area),现在我们来看看区域内的某一个人(你所在的机器root)是怎样得到一张 世界地图(routing table)的。

  首先,你得跟你周围的人(同一网段如129.102)建立基本联系。你大叫一声 “我在这!”(发hello报文),于是,周围的人知道你的存在,他们也会大叫,这样 你知道周围大概有哪些人,你与他们之间建立了邻居(neighbor)关系,当然,他们 之间也有邻居关系。

  在你们这一群人中,最有威望(priority优先级)的人会被推荐为首领( designated router)首领与你之间是上下级关系(adjacency邻接),它会与你建立 单线联系,而不许你与其它邻居有过多交往,他会说:“那样做的话,街上太挤了 ”。

  你只好通过首领来知道更多的消息了,首先,你们互通消息,他告诉你他知 道的所有地图的地名,你也会告诉他你现知道的地名,当然上也许只有你一个点。 (database des cription数据库描述报文)

  你发现地名表中有你缺少的或比你新的东西,你会问他要一份更详细的资料 ,他发现你的地名表中有他需要的东西,他也会向你索求新资料。(link state request连接状态请求报文)

  当然,你们毫不犹豫地将一份详细资料发送给对方。(link state update连 接状态升级报文)

  收到地图后,互相致谢表示收到了。(link state ack连接状态响应报文)

  现在,你已经尽你所能得到一份地图(link state database连接状态数据库 ),你去查找地图把到所有地方的路挑一条最近(shortest path最短路)的,记 为一张表格(routing table路由表),当然以后查这份表格就知道到目的地的一 条最近的路了。地图也要收好,万一表格上的某条路不通了可以通过图去找一条新 的路。

  其实跟你有联系的,只是周围一群人,外面的消息要通过首领来知道。因为 你的地图是跟首领的一致,我们假设你是首领,你要去画一份世界地图。

  你命令所有手下向你通报消息,你可以知道你这一群人的任何一点点小动静 (event事件)。你手下还会有同时属于两群人的家伙(同一区内两网段),他会 告诉你另一群人的地图,当然也会把你们这一群人的地图泄露,(不过,无所谓啦 )。这样,整个区的地图你知道了(对于不知道的那也没办*,我们尽力了)。

  通过不停地交换地图,现在,整个区的人都有同样的地图了,住在区边境上 的人义不容辞地把这个区的地图(精确到每一群人)发送到别的区,把别的区信息 发送进来。国王会把这些边境的人命名为骨干(backbone area)。通过骨干人士 的不懈努力,现在,整个国家的地图你都了解得一清二楚了。

  有些人“里通外国”(as boundary router自治系统边界路由器) ,他们知 道一些“出国”(as external route自治系统外部路由)的路,当然他们会把这些 秘密公之与众(import 引入),通过信息的传递,现在,你已经有一张完整的“ 世界地图”了。

  ospf是这样标记最短的路的:对于某个目的地,首先,考虑是否有同一区内 部到目的地的路(intra area区域内),如果有,则在其中取一条离你最近的(花 费最小),写进你的表格中,这个目的地可能是到本群体某个人也可能是到其他群 体的,对于经过其他区域的路由,你会不予考虑,跟自己人(同区域)打交道总比 与外人(其他区域)打交道好;如果没有本区的路,你只好通过别的区域了(区域 间),你只要在地图上找最近的就是了;如果你发现目的地在国外,你也只能先把 它标记到你的表格上,期待什么时候王国扩张到那,你就可以把它标记到国内地图 上了。

本贴来自天极网群乐社区--http://q.yesky.com/group/review-17655119.html下载本文

显示全文
专题