路由器常用配置命令

配置路由器的方法:Console 端口配置、Telnet远程登录配置。

路由器配置模式。

1. 用户模式。Router>

2. 特权模式。Router>#  。用户模式下输入enable即可。

3. 全局配置模式。Routerconfig。特权模式下输入 configure terminal即可。

3.1 Routerconfig-if#         接口配置

3.2 Routerconfig-line#       线路配置

3.3 Routerconfig-router#     路由配置

在任何一种模式下,用“exit”返回到上一级模式;用“end”直接返回到特权模式。

 一些简单命令示例。仿真软件:Cisco Packet Tracer。

Router>

Router>enable 

Router#configure terminal 

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#interface fastEthernet 0/1

Router(config-if)#ip address 192.168.1.1 255.255.255.0

Router(config-if)#no shutdown 

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

Router(config-if)#exit

Router(config)#hostname cc_router

cc_router(config)#exit

cc_router#

%SYS-5-CONFIG_I: Configured from console by console

cc_router#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

       * - candidate default, U - per-user static route, o - ODR

       P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.1.0/24 is directly connected, FastEthernet0/1

cc_router#

-------------------------------------------------------------------------------------------------------------------------------------------

 保存设置

对于配置文件来说,参数值run表示存放在DRAM中的配置。start表示存放在NVRAM中的配置。所有的配置命令只要键入后马上存在DRAM并运行,但掉电后会马上丢失。而NVRAM中配置只有在重新启动之后才会被复制到DRAM中运行,掉电后不会丢失,因此,必须养成好的配置习惯。在确认配置正确无误后将配置文件复制到NVRAM中去。其命令为
copy run start

ip access-group 命令将已定义的access-list用在某一个接口的in或则out方向。

 

  • 4
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值