通過路由器接口配置命令,可以配置:
接口的描述信息接口的傳輸速率接口的ip地址給接口封裝進入接口配置模式,使用description命令: 說明該接口連接到北京外國語大學
Router (config)#int g6/0Router (config-if) # description To-Beijing UniversityRouter (config-if) #進入接口配置模式,使用bandwidth命令設置接口帶寬,帶寬單位是kbps
Router (config)#interface POS3/0Router (config-if) # bandwidth 2500000 (設置接口帶寬為2.5Gbps)Router (config-if) #進入接口配置模式,使用ip address命令配置接口的IP地址 命令格式: ip address
Router (config)#interface f2/3Router (config-if) # ip address 202.112.7.249 255.255.255.252Router (config-if) #進入接口配置模式,使用shutdown、no shutdown命令關閉和開啟接口:
Router (config)#interface f2/3Router (config-if) # shutdown (關閉接口)Router (config-if) #Router (config-if) # no shutdown (開啟接口)Router (config-if) #可配置的局域網接口類型有以太網、FDDI、ATM和Token Ring等。目前,以太網應用最為廣泛,因此這里只介紹幾種以太網標準的接口配置方法。
標準以太網的接口類型為Ethernet,可簡寫為e
Router (config) #interface Ethernet0標準以太網的接口類型為FastEthernet,可簡寫為f
Router (config) #interface f2/1標準以太網的接口類型為GigabitEthernet,可簡寫為f
Router (config) #interface g0/1異步串行接口的接口類型為Async,可簡寫為a。Async接口主要用于連接Modem設備,為網絡用戶提供撥號上網服務。
Async接口配置如下:
Router (config) #interface a1高速同步串行接口的接口類型是Serial,可簡寫為s。Serial接口主要用于DDN專線、幀中繼、衛星、微博等廣域網連接。Serial接口需要配置的參數有接口帶寬、接口協議和接口的IP地址等。
Router (config) #interface s1/1POS是Packet over SONET/SDH的縮寫,這是一種利用SONET/SDH 提供的高速傳輸通道直接傳送IP數據包的技術。POS使用的鏈路層協議主要有PPP和HDLC。POS接口的配置參數有接口帶寬、接口地址、接口的鏈路層協議、接口的幀格式、接口的CRC校驗和flag等。 在全局配置模式下:
Router(config)#interface POS3/0Router(config-if)#description To TianJingDaXueRouter(config-if)#bandwidth 2500000Router(config-if)#ip address 212.12.37.18 255.255.255.252Router(config-if)#crc 32(可選的校驗位是16和32)Router(config-if)#pos framing sdh (可選的幀格式是sdh和sonet)Router(config-if)#no ip directed-broadcastRouter(config-if)#pos flag s1s0 2 (s1s0=00 表示是SONET幀的數據)Router(config-if)#no shutdownRouter(config-if)#exitRouter(config)#exitRouter#環回(loopback)接口是一種應用最為廣泛的虛接口。loopback接口的主要作用有,它作為一臺路由器的管理地址,使網絡管理員可以隨時登錄到路由器上,對路由器進行配置管理。它還可以作為動態路由協議OSPF和BGP的router id,使路由功能更穩定可靠。網絡管理員為loopback接口分配一個IP地址作為管理地址,其掩碼應為255.255.255.255 在全局配置模式下:
Router(config)# int loopback 0Router(config-if)#ip address 192.167.167.6 255.255.255.255Router(config-if)#no ip route-cacheRouter(config-if)#no ip mroute-cacheRouter(config-if)#exitRouter(config)#exitRouter#新聞熱點
疑難解答