发新话题
打印

CISCO IOS上配置OSPF接口参数

CISCO IOS上配置OSPF接口参数

CISCO IOS上配置OSPF接口参数
CISCO IOS使得管理者能改变特定的接口的OSPF参数。这个实验将会涉及3个或更多常用参数(成本、hello间隔和dead interval)

成本参数通过在一个特殊的接口上发送包来设置OSPF。缺省时,成本通过公式(100 000 000/链路带宽)来计算。所以缺省时,使用以太网接口的成本量为1亿被1千万除等于10。OSPF成本参数对控制传输流量非常有用,特别是在你更喜欢慢速链路而不是快速链路时。

OSPF的HELLO间隔是指在一个特定接口上发送HELLO包之间的时间长度。HELLO包对于所属网络中的所有路由器都必须是一致的。HELLO接口将根据网络类型分类(广播式=0,非广播式=30、点到点=10,点到多点=30)

OSPF终结间隔是指在邻居路由器被宣布关闭之前,从邻居路由器不必看见HELLO包的时间秒数。终结间隔必须与所属网络中的所有路由器一致。根据网络类型,终结间隔是不同的(广播式=40,非广播式=120,点到点=40,点到多点=120)。

这个实验将会验证配置OSPF特殊接口参数。路由器A和B之间的串行接口被配置的成本为66。这比与路由器B和相连的串行链路的缺省值高2倍。OSPF的HELLO间隔被设置为20,终结间隔被设置为120,并被用在路由器A和路由器B的串行接口上。

//router a
int lo0   //defines a virtual interface the ip address is used as the router id
  ip addr 1.1.1.1 255.255.255.0

int e0/0
  ip addr 10.1.1.2 255.255.255.0

int s0/0
  ip addr 192.1.1.1 255.255.255.0
  ip ospf cost 64
  ip ospf hello-interval 20
  ip ospf dead-interval 120

router ospf 64
  netw 192.1.1.0 0.0.0.255 area 0
  netw 1.1.1.1 0.0.0.0 area 0
  netw 10.1.1.0 0.0.0.255 area 0



//router b

int lo0
  ip addr 2.2.2.2 255.255.255.0

int e0/0
  no ip addr
  shut

int s0/0
ip addr 192.1.1.2 255.255.255.0
  ip ospf cost 66
  ip ospf hello-interval 20
  ip ospf dead-interval 120
  clockrate 500000

int s0/1
  ip addr 193.1.1.2 255.255.255.0
  clockrate 500000

router ospf 64
  netw 192.1.1.0 0.0.0.255 area 0
  netw 2.2.2.2 0.0.0.0 area 0
  netw 193.1.1.0 0.0.0.255 area 0



//router c
int lo0
  ip addr 3.3.3.3 255.255.255.0

int e0/0
  ip addr 10.1.1.2 255.255.255.0

int s0/0
  ip addr 193.1.1.1 255.255.255.0

router ospf 64
  netw 192.1.1.0 0.0.0.255 area 0
  netw 3.3.3.3 0.0.0.0 area 0
  netw 10.1.1.0 0.0.0.255 area 0


监视和测试配置
routera# show ip ospf int s0/0
  hello 20  dead 120  cost 66  network type point-to-point


100M以太网  100 000 000 bit/s ,OSPF带宽计算1000 000 000/100 000 000=10

routera# show ip ospf inter e0/0
  network type broadcast cost 10
  
routerc# show ip ospf int loopback 0
  network type loopback cost 1

配置路由器A的以太网接口的成本改为200
routera# int e0/0
  ip ospf cost 200

使用命令 show ip route 显示路由器A上的路由表,注意到3.3.3.3的路径改变了。路由器A现在使用通过串行接口的路径,成本为131并比现在使用以太网的新成本低。

routera# show ip route
  O 3.3.3.3 [100/131] via 192.1.1.2 serial 0

现在看一看连入同一网络中的路由器与HELLO间隔不匹配时会发生什么。在路由器A的串行接口上,将HELLO间隔改为30秒。
router# int s0/0
        ip ospf hello-interval 30

使用 show ip ospf neighbor命令显示路由器A上的OSPF邻居状况,与路由器B的邻居关系已消失。
routera# show ip ospf neighbor
3.3.3.3 1 full/BDR

使用命令 debug ip ospf events命令监视路由器A上的OSPF事件。注意路由器A从路由器B收到的OSPF包,并且HELLO间隔不匹配。形不成邻接。

routera#
OSPF:mismatched hello parameters from 192.1.1.2
◇飘堕的淡褶  QQ●147468
http://blog.windecember.cn

▲中国思科社区[GOOGLE网上论坛]
http://groups.google.com/group/cciecn
http://club.cn.yahoo.com/ccie

TOP

发新话题