路由器的基本配置.docx

上传人:b****3 文档编号:26462754 上传时间:2023-06-19 格式:DOCX 页数:12 大小:117.80KB
下载 相关 举报
路由器的基本配置.docx_第1页
第1页 / 共12页
路由器的基本配置.docx_第2页
第2页 / 共12页
路由器的基本配置.docx_第3页
第3页 / 共12页
路由器的基本配置.docx_第4页
第4页 / 共12页
路由器的基本配置.docx_第5页
第5页 / 共12页
点击查看更多>>
下载资源
资源描述

路由器的基本配置.docx

《路由器的基本配置.docx》由会员分享,可在线阅读,更多相关《路由器的基本配置.docx(12页珍藏版)》请在冰豆网上搜索。

路由器的基本配置.docx

路由器的基本配置

 

路由器配置总结

路由的基本配置

1、路由器模式配置概述

router>用户模式,通常用来查看统计信息,但不能更改路由器的设置

router#特权模式,可以查看并修改路由器的配置,通常在这里运行show命令

router(config)#全局配置模式,从这里开始对路由器进行配置

router(config-if)#接口模式,用来配置路由器的物理接口或者环回接口

router(config-subif)#子接口模式,用来配置路由器的虚拟子接口

router(config-line)#线路模式,通常用来配置console口、telnet的登陆密码

2、登陆路由器的基本配置

Router>enable(从用户模式进入到特权模式)

Router#configureterminal(从特权模式进入全局模式)

Router(config)#noipdomain-lookup(关闭动态的域名解析)

Router(config)#lineconsole0(进入console口)

Router(config-line)#exec-timeout00(关闭控制台的会话超时)

Router(config-line)#loggingsynchronous(重新显示被阻断的输出)

Router(config-line)#exit

Router(config)#

3、路由器基本配置

Router(config)#hostnameeasthome(设置路由器的名称)

Router(config)#interfaceE0(进入E0接口)

Router(config-if)#ipaddress10.5.5.11255.255.255.0(给E0口配置IP地址)

Router(config-if)#noshutdown(启动E0接口)

Router(config)#interfaces0(进入s0接口)

Router(config-if)#clockrate64000(如果该接口是DCE接口)

Router(config-if)#ipaddress100.5.5.11255.255.255.0(给s0口配置IP地址)

Router(config-if)#noshutdown(启动s0接口)

Router(config-if)#exit

Router#copyrunning-configstartup-config(保存当前的配置到NVRAM)

4、路由器信息的查看

Router#showversion(显示系统硬件、软件、IOS版本、系统启动时间、接口数量类型等信息)

Router#showrunning-config(显示路由器当前正在运行的配置文件)

Router#showinterface(显示路由器接口的配置和其他状态)

5、配置路由器的密码

Router(config)#lineconsole0(进入console口)

Router(config-line)#passwordeasthome(设置console登陆密码)

Router(config-line)#login(启用console上的密码验证)

Router(config)#linevty0X(进入vty接口)

Router(config-line)#passwordeasthome(设置vty登陆密码)

Router(config-line)#login(启用vty上的密码验证)

Router(config)#enablepasswordeasthome(设置特权模式明文密码)

Router(config)#enablesecretsutongyue(设置特权模式密文密码)

Router(config)#servicepassword-encryption(启动路由器上密码加密服务)

Router(config)#noservicepassword-encryption(关闭路由器上的密码加密服务)

6、配置路由器的登陆提示

Router#bannermotd##(配置路由器上每日登陆提示信息,#号内是要提示的内容信息)

7、配置路由器支持SSH远程连接

Router(config)#linevty04(进入vty接口)

Router(config-line)#loginlocal(启用vty接口登陆的本地验证)

Router(config-line)#transportinputssh(允许vty接口接受ssh登陆)

 

静态路由配置

1、给路由器接口配置IP地址

R1(config)#ints2

R1(config-if)#clockrate64000

R1(config-if)#ipadd13.0.0.1255.0.0.0

R1(config-if)#noshutdown

……其他接口地址依次类推

2、配置静态路由

R1(config)#iproute23.0.0.0255.0.0.0s3(配置到网络23.0.0.0/8的静态路由,出口为s3)

3、默认路由

R1(config)#iproute0.0.0.00.0.0.0s3(配置配置到网络0.0.0.0/0的静态路由,出口为s3)

4、查看路由配置

R1#showrun(查看静态路由配置)

R1#showiproute(查看路由器上的路由表)

 

VLAN间路由

1、在路由器上配置VLAN间路由

Router(config)#interfacefastethernet0/0(选择物理接口)

Router(config-if)#ipaddress10.1.1.1255.255.255.0(给物理接口配置IP地址、做为native(本征VLAN)的网关)

Router(config)#interfacefastethernet0/0.2(创建虚拟子接口)

Router(config-subif)#ipaddress10.2.2.1255.255.255.0(给虚拟子接口配置IP地址)

Router(config-subif)#encapsulationdot1q2(指定虚拟子接口做为VLAN2的网关)

2、测试

在PC上使用ping命令。

 

RIP路由配置

1、给路由器接口配置IP地址

R1(config)#ints2

R1(config-if)#clockrate64000

R1(config-if)#ipadd13.0.0.1255.0.0.0

R1(config-if)#noshutdown

……其他接口地址依次类推

3、配置rip路由协议

R1(config)#routerrip(启动RIP路由协议)

R1(config-router)#version2(升级RIP协议版本到2,默认是版本是1)

R1(config-router)#network13.0.0.0(通告直联的网段)

R1(config-router)#network12.0.0.0(通告直联的网段)

……其他路由器依次类推

4、查看路由配置

R1#showrunning-config

R1#showipprotocol(查看路由器上正在运行的路由协议)

R1#showiproute(查看路由表)

R1#debugiprip(查看RIP的更新过程)

 

OSPF试验

1、给路由器接口配置IP地址

R1(config)#ints2

R1(config-if)#clockrate64000

R1(config-if)#ipadd13.0.0.1255.0.0.0

R1(config-if)#noshutdown

……其他接口地址依次类推

2、配置ospf路由协议

R1(config)#routerospf200(启动OSPF进程200)

R1(config-router)#network13.0.0.10.0.0.0area0(通告直联的网段)

R1(config-router)#network12.0.0.10.0.0.0area0(通告直联的网段)

……其他路由器依次类推

3、查看路由配置

R1#showrunning-config

R1#showipospf(查看OSPF进程的详细信息)

R1#showipospfneighbor(查看OSPF邻居表)

R1#debugipospfevent(查看OSPF更新事件)

R1#showiproute(查看路由表)

4、配置OSPF负载均衡

R1(config-router)#maximum-paths6(调节最大负载均衡路径数量为6,默认为4)

R1(config)#interfaceinterface

R1(config-if)#ipospfcost5(设置接口的cost值为5)

……其他接口依次类推

5、OPSF密码认证

明文认证:

R1(config)#interfaceinterface

R1(config-if)#ipospfauthentication(启用OSPF明文链路验证)

R1(config-if)#ipospfauthentication-keyeasthome(配置链路验证密码)

……链路对端路由器也使用同样的配置密码即可

EIGRP路由配置

1、给路由器接口配置IP地址

R1(config)#ints2

R1(config-if)#clockrate64000

R1(config-if)#ipadd13.0.0.1255.0.0.0

R1(config-if)#noshutdown

……其他接口地址依次类推

2、配置rip路由协议

R1(config)#routereigrp100(启动eigrp路由器协议,100为自治系统号码)

R1(config-router)#network13.0.0.0(通告直联的网段)

R1(config-router)#network12.0.0.0(通告直联的网段)

……其他路由器依次类推

3、查看路由配置

R1#showrunning-config(查看路由器配置文件)

R1#showipprotocol(查看路由器上正在运行的路由协议)

R1#showiproute(查看路由表)

R1#showipeigrpneighbors(查看eigrp邻居表)

R1#showipeigrptopology(查看eigrp拓扑表)

R1#showipeigrptraffic(查看eigrp更新流量)

4、配置EIGRP认证

配置密钥

R1(config)#keychaineasthome(设置密钥串名字为easthome)

R1(config-keychain)#key1(创建钥匙1)

R1(config-keychain-key)#key-stringfirstkey(给钥匙1设置密码为firstkey)

R1(config-keychain-key)#accept-lifetime04:

00:

00Jan12006infinite(设置密码在接收方向的有效期)

R1(config-keychain-key)#send-lifetime04:

00:

00Jan1200604:

01:

00Jan12006(设置密码在发送方向的有效期)

R1(config-keychain-key)#exit(推出钥匙1配置)

R1(config-keychain)#key2(创建钥匙2)

R1(config-keychain-key)#key-stringsecondkey(给钥匙2设置密码为secondkey)

R1(config-keychain-key)#accept-lifetime04:

00:

00Jan12006infinite(设置密码在接收方向的有效期)

R1(config-keychain-key)#send-lifetime04:

00:

00Jan12006infinite(设置密码在发送方向的有效期)

R1(config-keychain-key)#end

在接口上应用密钥

R1(config)#interfaceSerial0/0/1

R1(config-if)#ipauthenticationmodeeigrp100md5(启动EIGRP链路验证)

R1(config-if)#ipauthenticationkey-chaineigrp100easthome(调用钥匙串easthome到接口)

……对端路由器配置类似

5、查看密钥配置

R1#showrunning-config

网络地址转换试验

1、配置r3模拟成一个PC

R3(config)#noiprouting(关闭路由器的路由功能)

R3(config)#interfacee0

R3(config-if)#ipadd192.168.1.3255.255.255.0(给路由器的接口配置IP地址,相当于计算机的网卡配置IP)

R3(config-if)#noshutdown

R3(config)#ipdefault-gateway192.168.1.1给路由器配置默认网关)

2、配置r1成为一个internet设备

R1(config)#ints2

R1(config-if)#ipadd202.96.0.1255.255.255.0(给路由器配置一个公共IP地址)

R1(config-if)#clockrate64000

R1(config-if)#noshutdown

3、配置r2上的NAT配置

R2(config)#interfaceEthernet0

R2(config-if)#ipaddress192.168.1.2255.255.255.0

R2(config-if)#ipnatinside(定义该接口为内部接口)

R2(config-if)#exit

R2(config)#interfaces1

R2(config-if)#ipaddress202.96.0.2255.255.255.0

R2(config-if)#ipnatoutside(定义该接口为外部接口)

R2(config-if)#exit

R2(config)#access-list1permit192.168.1.00.0.0.255(定义要转换的内部私有地址)

R2(config)#iproute0.0.0.00.0.0.0Serial1(配置到达公共网络的默认路由)

R2(config)#ipnatinsidesourcelist1interfaceSerial1overload(关联内部私有地址和外部接口上的公有地址,并启用PAT)

PPP配置

1、给接口配置IP地址

R1(config)#ints2

R1(config-if)#clockrate64000

R1(config-if)#ipadd10.0.0.1255.0.0.0

R1(config-if)#noshutdown

……其他接口地址依次类推

2、配置PPP

Router(config)#hostnameRouterX(定义路由器名称)

RouterX(config)#usernameRouterYpasswordeasthome(创建用户名和密码)

RouterX(config)#intserial0

RouterX(config-if)#encapsulationppp(启用PPP封装协议)

RouterX(config-if)#pppauthenticationchap(启用PPP的链路CHAP验证)

……对端路由器配置类似

3、查看PPP配置

RouterX#showinterfaces0

RouterX#debugpppauthentication(查看PPP的认证过程)

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 人文社科 > 视频讲堂

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1