今天主要掌握了路由的RIP、OSPF、BGP、VPN、IPSec等协议的配置,现将它分别总结如下:
一、基本路由配置
Router>en #开特权模式
Router>conf term #开全局配置模式,可简写
Router(config)#hostname R1 #设置该路由为R1
R1(config)#interface e0
R1(config-if)#ip address 192.168.1.2 255.25.255.0 #分配IP地址给该端口
R1(config-if)#no shutdown
R1(config-if)#clock rate 5600 #设置系统时钟
R1(config-if)#exti
R1(config)#ip routing
R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.2.2
R1(config)#ip classless #若无法找到目的地址,则将其转发到超网,而不是简单丢弃数据包
R1(config)#exit
R1#copy run start #将配置写入NVRAM中,以免下次需重新配置
二、RIP协议配置
R1(config)#ip routing #启动路由配置
R1(config)#router rip #应用RIP协议
R1(config-router)#network 192.168.1.0 #该网络直连
R1(config-router)#exit
三、OSPF协议配置
R1(config)# router ospf <ospfid>
R1(config-router)#network 192.1.1.0.0.0.0.255 area 0 #子网掩码反码,即子网掩码取反
R1(config-router)#exit
四、BGP协议配置
R1(config)# router bgp<process ID> #进去bgp协议
R1(config-router)#no synchronization #关闭同步
R1(config-router)# bgp router-id 3.3.3.3
R1(config-router)#neightbor 1.1.1.1 remote-as 100 #设置邻居路由及其所在AS
R1(config-router)#neighbor 1.1.1.1 update-source loopback0 #指定更新源为环回接口,以增强BGP稳健性
R1(config-router)#neighbor 1.1.1.1 next-hop-self #将自己作为发送BGP更新的下一跳来通知给邻居
R1(config-router)# no suto-summary #关闭自动汇总
R1(config-router)# exit
五、VPN协议配置
router>en #开特权模式
router# config terminal #开全局配置模式
router(config)#enable secret cisco #设置特权口令
router(config)#line vty 0 4
router(config-line)#password goodbad #设置远程登录明文密码
router(config-line)#exit
router(config)#interface eht0/0
router(config-if)#ip address 201.118.0.1 255.255.255.0
router(config-if)#bandwith 256 #设置带宽
router(config-if)#encapsulation ppp #设置数据包封装形式为PPP
router(config-if)#no cdp enable #不使用CDP协议,节省带宽
router(config-if)#no shutdown #激活接口
router(config-if)#exit
六、IPSec协议配置
crypto isakmp key mcns address 192.12.2.1 #mcns为你指定的预共享秘钥
crypto isakmp policy 100 #创建标示号为100的IKE策略
hash md5 #在建立连接IKE协商过程中使用MD5哈希散列算法
authentication pre-share #设置认证方式为预共享认证
crypto ipsec transform-set exp-dex #指定IPSec交换集为EXP-DEX
access-list 10 permit ip host 192.1682.1 host 192.168.3.4 #配置加密访问列表
crypto map shaf 10 ipsec-isakmp #建立加密图名称为shaf ,序号为10
set peer 172.16.3.2 #设置于IPSec对等体的IP
set transform-set exp-dex
match address 141
crypto map shaf #将加密映射图应用在该端口
end
命令比较多,还有很多需要掌握跟学习的,晚安。