cisco路由配置常用命令

  • 格式:docx
  • 大小:12.64 KB
  • 文档页数:3

下载文档原格式

  / 3
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

刚刚接触cisco路由配置,下面是学习的笔记,感觉命令还是多敲才能熟悉

复位

router>en

router#erase startup-config

router#reload

一、所处状态各类

router>

用户处于用户命令状态,可以查看网络和主机

router#

用户处于特权模式,可以查看状态,还可以看到和更改路由器的设置内容router(config)#

全局配置状态,可以设置路由的全局参数

router(config-if)#;router(config-line)#;router(config-router)#.....

处于局部配置状态,可以设置路由的局部参数

二、配置端口ip

命令

en

config t //全局模式

interface f0/0

ip address 192.168.1.1 255.255.255.0 //设置端口ip

no shu //生效

exit

interface f0/1

ip address 192.168.10.1 255.255.255.0

no shu

exit

end

disable

三、配置静态路由

命令

en

config t //全局模式

ip route 192.168.100.0 255.255.255.0 192.168.10.2 //到192.168.100.0/24通过192.168.10.2接口

end

show ip route //可以看到前面标明S,即为静态路由

四、配置动态路由(RIP)

命令

en

config t //全局模式

no route rip //禁止rip协议

route rip

network 192.168.1.0 //network参数为路由的两个端口对应的网络地址

network 192.168.10.0

exit

end

disable

五、配置DHCP

命令

en

config t //全局模式

ip dhcp excluded-address 192.168.1.1 //需要排除的ip地址

ip dhcp pool gr-dhcp-pool //ip地址池名

default-server 192.168.1.1 //指定dhcp服务器

network 192.168.1.0 255.255.255.0 //配置网络

dns-server 61.177.7.1 //配置dns服务器

exit

end

disable

可以通过ip helper-address指定DHCP中继代理

interface FastEthernet0/1

ip address 192.168.1.1 255.255.255.0

ip helper-address 192.168.10.2 //配置DHCP中继代理,DHCP

六、配置NAT

命令

en

config t //全局模式

interface f0/0

ip address 192.168.1.1 255.255.255.0

ip nat inside //内部端口

no shu

exit

interface f0/1

ip address 192.168.10.1 255.255.255.0

ip nat outside //外部端口

no shu

exit

access-list 1 permit any //设置一个可访问列表

ip nat pool gr-nat-pool 192.168.10.3 192.168.10.254 netmask 255.255.255.0 //设置分配池

ip nat inside resource list 1 pool gr-nat-pool overload

show ip nat traslations

clear ip nat traslation *

七、其它

sh running-config //显示当前运行配置sh startup-config //显示开机配置

sh ip route //显示路由

sh nat traslations //显示nat当前情况