关于回环地址
2013-07-15 11:05
183 查看
在配置OSPF路由协议的时候配置回环(loopback)接口是很重要的1件事.Cisco建议你配置OSPF的时候 顺便配置回环接口.所谓回环接口,是逻辑接口而非物理接口,即不是你触摸的到的router上的真正的接口.
作用是作为诊断OSPF而用.如果router的某一个接口由于故障down 掉而不可用了,此时你怎么通过telnet来连接并进行管理用呢?所以就引入了回环接口是概念,回环接口永远不会down掉,你就可以通过连上回环接口来进行管理Configuring Loopback Interfaces 配置回环接口前先使用show ip ospf命令查看RID,接下来对接口进行配置,如下:RouterA的配置:
RouterA(config)#int loopback0
RouterA(config-if)#ip address 172.16.10.1 255.255.255.0
RouterA(config-if)#no shut
RouterA(config-if)#^Z
RouterA#RouterB的配置:
RouterB(config)#int lo0
RouterB(config-if)#ip address 172.16.20.1 255.255.255.0
RouterB(config-if)#no shut
RouterB(config-if)#^Z
RouterB#RouterC的配置:
RouterC(config)#int lo0
RouterC(config-if)#ip address 172.16.30.1 255.255.255.0
RouterC(config-if)#no shut
RouterC(config-if)#^Z
RouterC#
注意2个回环接口的IP地址配置机制为任意配置,但是IP地址必须处于不同的子网内Verifying Loopbacks and RIDs 验证回环接口的地址,可以使用show running-config的命令查看,如下:
RouterC#sh run
(略)
!
interface Loopback0
ip address 172.16.30.1 255.255.255.0
!
(略)loopback 接口的用法
此类接口是应用最为广泛的一种虚接口,几乎在每台路由器上都会使用。常见于如下用途 1 作为一台路由器的管理地址;
系统管理员完成网络规划之后,为了方便管理,会为每一台路由器创建一个
loopback 接口,并在该接口上单独指定一个IP 地址作为管理地址,管理员会
使用该地址对路由器远程登录(telnet ),该地址实际上起到了类似设备名称
一类的功能。
但是通常每台路由器上存在众多接口和地址,为何不从当中随便挑选一个呢?
原因如下:由于telnet 命令使用TCP 报文,会存在如下情况:路由器的某一个
接口由于故障down 掉了,但是其他的接口却仍旧可以telnet ,也就是说,到
达这台路由器的TCP 连接依旧存在。所以选择的telnet 地址必须是永远也不会
down 掉的,而虚接口恰好满足此类要求。由于此类接口没有与对端互联互通
的需求,所以为了节约地址资源,loopback 接口的地址通常指定为32 位掩码。 2 使用该接口地址作为动态路由协议OSPF 、BGP 的router id;
动态路由协议OSPF 、BGP 在运行过程中需要为该协议指定一个Router id ,作
为此路由器的唯一标识,并要求在整个自治系统内唯一。由于router id 是一个
32 位的无符号整数,这一点与IP 地址十分相像。而且IP 地址是不会出现重复
现象的,所以通常将路由器的router id 指定为与该设备上的某个接口的地址相
同。由于loopback 接口的IP 地址通常被视为路由器的标识,所以也就成了
router id 的最佳选择。
3、使用该接口地址作为BGP 建立TCP 连接的源地址;
在BGP 协议中,两个运行BGP 的路由器之间建立邻居关系是通过TCP 建立连
接完成的。
在配置邻居时通常指定loopback 接口为建立TCP 连接的源地址(通常只用于
IBGP ,原因同2.1 ,都是为了增强TCP 连接的健壮性)
配置命令如下:
router id 61.235.66.1
interface loopback 0
ip address 61.235.66.1 255.255.255.255
router bgp 100
neighbor 61.235.66.7 remote-as 200
neighbor 61.235.66.7 update-source LoopBack0RIDRouter ID (RID) The Router ID (RID) is an IP address used to identify the router. Cisco
chooses the Router ID by using the highest IP address of all configured loopback interfaces.
If no loopback interfaces are configured with addresses, OSPF will choose the highest IP
address of all active physical interfaces.Loopback interfaces are logical interfaces, which means they are not real
router interfaces. They can be used for diagnostic(.诊断的) purposes as well as OSPF configuration在OSPF中为什么要用loopback interface:if you are not using loopback interfaces then the serial interface of your router is the RID of the router because it has the highest IP address of active interfaces. If this interface goes down, then a re-election must occur on who is going to be the DR and BDR on the network. Not necessarily a big deal, but what happens if this is a flapping link (going up/down)? The routers will not converge because the election is never completed. This is obviously a problem with OSPF. Loopback interfaces solve this problem because they never go down and the RID of the router never changes
作用是作为诊断OSPF而用.如果router的某一个接口由于故障down 掉而不可用了,此时你怎么通过telnet来连接并进行管理用呢?所以就引入了回环接口是概念,回环接口永远不会down掉,你就可以通过连上回环接口来进行管理Configuring Loopback Interfaces 配置回环接口前先使用show ip ospf命令查看RID,接下来对接口进行配置,如下:RouterA的配置:
RouterA(config)#int loopback0
RouterA(config-if)#ip address 172.16.10.1 255.255.255.0
RouterA(config-if)#no shut
RouterA(config-if)#^Z
RouterA#RouterB的配置:
RouterB(config)#int lo0
RouterB(config-if)#ip address 172.16.20.1 255.255.255.0
RouterB(config-if)#no shut
RouterB(config-if)#^Z
RouterB#RouterC的配置:
RouterC(config)#int lo0
RouterC(config-if)#ip address 172.16.30.1 255.255.255.0
RouterC(config-if)#no shut
RouterC(config-if)#^Z
RouterC#
注意2个回环接口的IP地址配置机制为任意配置,但是IP地址必须处于不同的子网内Verifying Loopbacks and RIDs 验证回环接口的地址,可以使用show running-config的命令查看,如下:
RouterC#sh run
(略)
!
interface Loopback0
ip address 172.16.30.1 255.255.255.0
!
(略)loopback 接口的用法
此类接口是应用最为广泛的一种虚接口,几乎在每台路由器上都会使用。常见于如下用途 1 作为一台路由器的管理地址;
系统管理员完成网络规划之后,为了方便管理,会为每一台路由器创建一个
loopback 接口,并在该接口上单独指定一个IP 地址作为管理地址,管理员会
使用该地址对路由器远程登录(telnet ),该地址实际上起到了类似设备名称
一类的功能。
但是通常每台路由器上存在众多接口和地址,为何不从当中随便挑选一个呢?
原因如下:由于telnet 命令使用TCP 报文,会存在如下情况:路由器的某一个
接口由于故障down 掉了,但是其他的接口却仍旧可以telnet ,也就是说,到
达这台路由器的TCP 连接依旧存在。所以选择的telnet 地址必须是永远也不会
down 掉的,而虚接口恰好满足此类要求。由于此类接口没有与对端互联互通
的需求,所以为了节约地址资源,loopback 接口的地址通常指定为32 位掩码。 2 使用该接口地址作为动态路由协议OSPF 、BGP 的router id;
动态路由协议OSPF 、BGP 在运行过程中需要为该协议指定一个Router id ,作
为此路由器的唯一标识,并要求在整个自治系统内唯一。由于router id 是一个
32 位的无符号整数,这一点与IP 地址十分相像。而且IP 地址是不会出现重复
现象的,所以通常将路由器的router id 指定为与该设备上的某个接口的地址相
同。由于loopback 接口的IP 地址通常被视为路由器的标识,所以也就成了
router id 的最佳选择。
3、使用该接口地址作为BGP 建立TCP 连接的源地址;
在BGP 协议中,两个运行BGP 的路由器之间建立邻居关系是通过TCP 建立连
接完成的。
在配置邻居时通常指定loopback 接口为建立TCP 连接的源地址(通常只用于
IBGP ,原因同2.1 ,都是为了增强TCP 连接的健壮性)
配置命令如下:
router id 61.235.66.1
interface loopback 0
ip address 61.235.66.1 255.255.255.255
router bgp 100
neighbor 61.235.66.7 remote-as 200
neighbor 61.235.66.7 update-source LoopBack0RIDRouter ID (RID) The Router ID (RID) is an IP address used to identify the router. Cisco
chooses the Router ID by using the highest IP address of all configured loopback interfaces.
If no loopback interfaces are configured with addresses, OSPF will choose the highest IP
address of all active physical interfaces.Loopback interfaces are logical interfaces, which means they are not real
router interfaces. They can be used for diagnostic(.诊断的) purposes as well as OSPF configuration在OSPF中为什么要用loopback interface:if you are not using loopback interfaces then the serial interface of your router is the RID of the router because it has the highest IP address of active interfaces. If this interface goes down, then a re-election must occur on who is going to be the DR and BDR on the network. Not necessarily a big deal, but what happens if this is a flapping link (going up/down)? The routers will not converge because the election is never completed. This is obviously a problem with OSPF. Loopback interfaces solve this problem because they never go down and the RID of the router never changes
相关文章推荐
- 关于Linux的本地回环路由lo [127.0.0.1 ]
- 关于OSPF通告第二地址
- 原博客 地址(主要关于C++) mark,勿忘
- 关于TI DAC芯片 DAC101C081 地址选择
- iOS错误报告中关于崩溃地址的分析
- 关于“Exchange Server 地址列表服务未能响应”的错误解决方法。
- [讨论]关于VXD中的地址
- 关于线性地址到物理地址的转换缓冲
- C++,关于指针形参”值传递VS地址传递“的问题
- 转载自一篇文章,为什么UBOOT的lds文件关于TEXT地址的定义无效
- 关于装修的一些图片所在的网站地址
- 关于ntko office api地址
- 关于cygwin的使用方法的博客地址
- U-Boot中关于TEXT_BASE,代码重定位,链接地址相关说明
- 关于WinCE6.0 应用程序中直接访问物理地址
- 关于运行地址和加载地址的几个很多初学者模糊不清的问题我在这里总结一下
- 关于地址的迷思....
- 关于JS访问文件服务器的HTTP文件地址实现文件下载
- 嵌入式学习心得(十二)关于一维二维指针的地址
- 关于servlet中重定向、转发的地址问题