王娜 发表于 2013-10-24 11:13:29

【合肥清默】cisco逻辑接口

思科的逻辑接口: 一、loopback 口Loopback(环回)口是完全是有软件模拟的路由器本地接口,它永远都处于UP状态,当然可以手工关闭。配置一个loopback类似于配置一个以太网口。发往此接口的数据将会被路由器在本地处理。作用:OSPF 协议中作为ROUTER-ID;实施发向TELNET 或作为远程TELNET访问的网络接口等;命令:配置接口r1(config)#interface loopback <0-2147483647>Loopback interface numberr1(config-if)#ip add 1.1.1.1 255.255.255.0不需要手工no shutdown ,这是和以太口的区别; 删除接口:r1(config)#no interface loopback ?<0-2147483647>Loopback interface number 查看接口信息:r1#show interfaces loopback ?<0-2147483647>Loopback interface number手工关闭接口: r1(config)#interface loopback 10r1(config-if)#shutdown 特殊情况在ospf中,默认情况下,学到的loopback口的IP地址,不论原本是多少位的网络位,都以32位的地址学习。如:R1:interface Loopback0 ip address 1.1.1.1 255.255.255.0 router ospf 1 router-id 1.1.1.1 log-adjacency-changes network 1.1.1.0 0.0.0.255 area 2 network 12.12.12.0 0.0.0.255 area 0!在R2上学习的路由是:    1.0.0.0/32 is subnetted, 1 subnetsO IA    1.1.1.1 via 12.12.12.1, 00:00:10, Ethernet0/0当然,可以修改:r1(config)#int loopback 0r1(config-if)#ip ospf network point-to-point 二、tunnel口路由器借助Tunnel接口实现隧道功能,允许利用传输协议如IP来传输任意协议的网络数据包,它提供的事一个用来实现标准的点到点的传输模式。由于Tunnel实现的是点到点的传输链路,所以,对于每一个单独的链路收拾必须设置一个Tunnel接口。 Tunnel传输使用的场合:允许运行非Ip协议的本地网络之间通过一个单一网络(如IP)通信,因为Tunnel支持多种不同的负载协议;允许通过单一的网络连接间子网允许在广域网上提供VPN功能IPV6网络向ipv4网络的过渡,如6to4等隧道技术 配置r1(config)#interface tunnel <0-2147483647>Tunnel interface numberr1(config)#interface tunnel 0       以下是设定Tunnel源地址,每个Tunnel接口需要明确配置隧道的源地址和目标地址,为了保证隧道接口的稳定性,一般将loopback地址做为目标和源地址,在Tunnel接口帧场工作之前,需要确认地址和目的地址的连通性。r1(config-if)#tunnel source A.B.C.D            ip addressAsync            Async interfaceBVI                Bridge-Group Virtual InterfaceCDMA-Ix            CDMA Ix interfaceCTunnel            CTunnel interfaceDialer             Dialer interfaceEthernet         IEEE 802.3Lex                Lex interfaceLoopback         Loopback interfaceMFR                Multilink Frame Relay bundle interfaceMultilink          Multilink-group interfaceNull               Null interfacePort-channel       Ethernet Channel of interfacesTunnel             Tunnel interfaceVif                PGM Multicast Host interfaceVirtual-PPP      Virtual PPP interfaceVirtual-Template   Virtual Template interfaceVirtual-TokenRingVirtual TokenRingX:X:X:X::X         IPv6 address如:r1(config-if)#tunnel source 1.1.1.1 r1(config-if)#tunnel destination 2.2.2.2注意:在同一台路由器上,不能使用相同的源地址和目标地址创建两个相同封装模式的Tunnel接口。Tunnel封装格式就是其载体协议,默认是GRE。 Tunnel的接口模式:r1(config-if)#tunnel mode aurp    AURP TunnelTalk AppleTalk encapsulationcaymanCayman TunnelTalk AppleTalk encapsulationdvmrp   DVMRP multicast tunneleon   EON compatible CLNS tunnelgre   generic route encapsulation protocolipip    IP over IP encapsulationipsec   IPSec tunnel encapsulationiptalkApple IPTalk encapsulationipv6    Generic packet tunneling in IPv6ipv6ipIPv6 over IP encapsulationmpls    MPLS encapsulationsnos   IP over IP encapsulation (KA9Q/NOS compatible)rbscp   RBSCP in IP tunnelr1(config-if)#tunnel mode ipv6ip在6to4隧道中使用 设置Tunnel接口校验:r1(config-if)#tunnel checksum 设置接口的KEY值在一定程度上可以确保Tunnel 两段安全性,同时也可以防范来自外部的恶意探测与攻击。知识在Tunnel 封装格式为GRE的情况下,Tunnel接口的Key设置才起作用,因此此时在每一个GRE数据包中都会包含设置Tunnel接口key.r1(config-if)#tunnel key    <0-4294967295>keyr1(config-if)#tunnel key 0 注意:接口两端必须使用相同的key值。 如果负载协议在维护数据包有序方面的功能不足(如LLC2的协议),路由器允许设置Tunnel接受规则来丢弃接受到的无序数据包。此功能有助于是先数据包有序传输:r1(config-if)#tunnel sequence-datagrams 调试信息:r1#debug tunnel 三、NULL 0 口NULL虚拟接口仅仅相当于一个可用的系统设备,永远都处于Up状态并且永远不会主动发送或者接受网络数据,任何发往NULL口的数据包都会被丢弃,且在NULL接口 上任何链路层协议封装的企图都是不会成功的。 配置:null 口只有一个:null 0r1(config)#interface null <0-0>Null interface number 开启发送ICMP不可达报文的功能r1(config)#interface null 0r1(config-if)#ip unreachables 可以将发送ICMP不可达报文设为默认的行为r1(config-if)#default ip unreachables 关闭发送ICMP不可达报文r1(config-if)#no ip unreachables NULL 0 接口更多的用于网络数据流的过滤,如果使用空接口,可以通过将不希望处理的网络数据流路由给NULL接口,而不必使用访问列表,如:r1(config)#ip route 0.0.0.0 0.0.0.0 null 0   黑洞路由 由于NULL 接口在功能是一个“空”的系统设备,让不会像以太网或者其他接口一样可显示,故在show run 里是不看不到的,也不可用 no interface null 命令来删除NULL接口的。 r1(config-if)#help Help may be requested at any point in a command by enteringa question mark '?'.If nothing matches, the help list willbe empty and you must backup until entering a '?' shows theavailable options.Two styles of help are provided:1. Full help is available when you are ready to enter a   command argument (e.g. 'show ?') and describes each possible   argument.2. Partial help is provided when an abbreviated argument is entered   and you want to know what arguments match the input   (e.g. 'show pr?'.) 四、DAIL 口拨号接口。路由器支持的拨号的物理接口有同步和异步两种,通过Dialer口实现DDR(按需拨号路由)功能。 配置r1(config)#interface dialer <0-799>Dialer interface numberr1(config)#interface dialer 0 如果Dialer接口上封装了封装了链路层协议,还可以使用对应的协议的debug命令来考察通信情况。R1#show interfaces dialer ?<0-799>Dialer interface numberr1#show interfaces dialer 0Dialer0 is up (spoofing), line protocol is up (spoofing)Hardware is UnknownMTU 1500 bytes, BW 56 Kbit, DLY 20000 usec,    reliability 255/255, txload 1/255, rxload 1/255Encapsulation HDLC, loopback not setDTR is pulsed for 1 seconds on resetLast input never, output never, output hang neverLast clearing of "show interface" counters neverInput queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0Queueing strategy: weighted fairOutput queue: 0/1000/64/0 (size/max total/threshold/drops)    Conversations0/0/16 (active/max active/max total)   Reserved Conversations 0/0 (allocated/max allocated)   Available Bandwidth 42 kilobits/sec5 minute input rate 0 bits/sec, 0 packets/sec5 minute output rate 0 bits/sec, 0 packets/sec   0 packets input, 0 bytes   0 packets output, 0 bytes 五、路由器子接口所谓子接口,是指从单一物理口上衍生出来并依附于物理口的逻辑接口,允许在单个物理接口上配置多个子接口,并为应用提供高灵活性。路由器支持子接口的物理接口:非交换式以太网接口封装帧中继的广域网接口封装X.25的广域网接口单臂路由实验 配置子接口是要注意,主接口一定要激活!R1(config)#int    f0/0                no sh                int f0/0.X

王娜 发表于 2013-10-24 11:13:52

{:6_267:}{:6_267:}

菲菲猫 发表于 2013-10-27 09:55:29

{:6_290:}

爱比熊 发表于 2013-10-27 10:00:23

{:6_273:}

爱比熊 发表于 2013-10-27 10:01:04

{:6_267:}
页: [1]
查看完整版本: 【合肥清默】cisco逻辑接口