路由器接口的配置
1.路由器接口基本配置
configure terminal ——进入全局配置
interface f0/1 ——进入接口f0/1
bandwidth 100000 ——配置接口带宽(单位:kb/s)100000kb/s = 100Mb/s
description To - lab1 ——配置接口描述信息
ip address 192.168.1.254 255.255.255.0 ——配置接口地址 格式:ip address <IP地址> <子网掩码>
no shutdown ——开启接口 shutdown为关闭接口
2. 回环(Loopback)接口的配置
interface loopback 0
ip address 192.168.100.1 255.255.255.255
3. 局域网接口配置
(1)标准以太网接口配置
interface Ethernet1
description To - lab1
ip address 192.168.1.1 255.255.255.0
bankwidth 10000
no shutdown
exit
(2)快速以太网接口配置
interface FastEthernet0/1 注:FastEthernet可简写为f
description To-lab2
ip address 192.168.1.1 255.255.255.0
bankwidth 10000
duplex half ——设置工作模式为半双工
no ip directed-broadcast ——禁止转发主机位全为1的广播包
no ip proxy - arp ——关闭代理ARP(Address Resolution Protocol,地址解析协议)
no shutdown
exit
(3)千兆以太网接口配置
interface GigabitEthernet0/1 注:GigabitEthernet 可简写为g
description To-lab2
ip address 192.168.1.1 255.255.255.0
bankwidth 10000
duplex half ——设置工作模式为半双工
no ip directed - broadcast ——禁止转发主机位全为1的广播包
no ip proxy - arp ——关闭代理ARP(Address Resolution Protocol,地址解析协议)
no shutdown
exit
4. 广域网接口配置
(1)异步串行接口配置
interface Async1 注:Async 可简写为a
ip unnumbered ethernet0
encapsulation ppp ——封装协议为ppp
async default ip address 192.168.1.1
async dynamic routing
async mode interactive
no shutdown
exit
(2)高速同步串行接口配置
interface Serial0/0 注:Serial 可简写为s
description To-lab4
ip address 192.168.4.1 255.255.255.252
bankwidth 2048
encapsulation ppp ——封装协议为ppp
no ip directed-broadcast ——禁止转发主机位全为1的广播包
no ip proxy-arp ——关闭代理ARP(Address Resolution Protocol,地址解析协议)
no shutdown
exit
(3)POS接口的配置
interface POS0/1
description To-lab5
bandwidth 10000000 ——单位:kb/s 10Gb/s
ip address 192.168.5.1 255.255.255.252
crc16 ——可选的crc校验位是16和32
pos framing sonet ——可选的帧格式是sdh和sonet
no ip directed-broadcast
pos flag s1 s0 0 ——s1 s0 0 表示是 sonet 帧的数据;s1 s0 2 表示是 sdh 帧的数据
no shutdown
exit
路由器静态路由器配置
静态路由是指网络管理员手工配置的路由信息。静态路由由“ip route” 命令在全局配置模式下配置,使用“no ip route” 命令删除静态路由配置。
格式:ip route <目的网络地址> <子网掩码> <下一跳路由器的IP地址> ip route 10.0.0.0 255.0.0.0 192.168.1.1 其中默认路由的静态配置为 ip route 0.0.0.0 0.0.0.0 下一跳地址