cisco 路由配置

Cisco路由配置基础

刚刚接触cisco路由配置,下面是学习的笔记,感觉命令还是多敲才能熟悉
一、 所处状态各类
  1. router>
    1. 用户处于用户命令状态,可以查看网络和主机
  2. router#
    1. 用户处于特权模式,可以查看状态,还可以看到和更改路由器的设置内容
  3. router(config)#
    1. 全局配置状态,可以设置路由的全局参数
  4. router(config-if)#;router(config-line)#;router(config-router)#.....
    1. 处于局部配置状态,可以设置路由的局部参数
二、配置端口ip
  1. 命令
    1. en
    2. config t   //全局模式
    3. interface f0/0
    4. ip address 192.168.1.1 255.255.255.0 //设置端口ip
    5. no shu   //生效
    6. exit
    7. interface f0/1
    8. ip address 192.168.10.1 255.255.255.0  
    9. no shu
    10. exit
    11. end
    12. disable
三、配置静态路由
  1. 命令
    1. en
    2. config t   //全局模式
    3. ip route 192.168.100.0 255.255.255.0 192.168.10.2    //到192.168.100.0/24通过192.168.10.2接口
    4. end
    5. show ip route //可以看到前面标明S,即为静态路由
四、配置动态路由(RIP)
  1. 命令
    1. en
    2. config t   //全局模式
    3. no route rip      //禁止rip协议
    4. route rip
    5. network 192.168.1.0      //network参数为路由的两个端口对应的网络地址
    6. network 192.168.10.0
    7. exit
    8. end
    9. disable
五、配置DHCP
  1. 命令
    1. en
    2. config t   //全局模式
    3. ip dhcp excluded-address 192.168.1.1   //需要排除的ip地址
    4. ip dhcp pool gr-dhcp-pool   //ip地址池名
    5. default-server   192.168.1.1  //指定dhcp服务器
    6. network  192.168.1.0 255.255.255.0   //配置网络
    7. dns-server 61.177.7.1   //配置dns服务器
    8. exit
    9. end
    10. disable
  2. 可以通过 ip helper-address指定 DHCP中继代理
    1. interface FastEthernet0/1
    2. ip address 192.168.1.1 255.255.255.0
    3. ip helper-address 192.168.10.2                 \配置DHCP中继代理,DHCP
六、配置NAT
         
  1. 命令
    1. en
    2. config t   //全局模式
    3. interface f0/0
    4. ip address 192.168.1.1 255.255.255.0
    5. ip nat inside   //内部端口
    6. no shu
    7. exit
    8. interface f0/1
    9. ip address 192.168.10.1 255.255.255.0
    10. ip nat outside   //外部端口
    11. no shu
    12. exit
    13. access-list 1 permit any   //设置一个可访问列表
    14. ip nat pool gr-nat-pool  192.168.10.3 192.168.10.254 netmask 255.255.255.0  //设置分配池
    15. ip nat inside resource list 1 pool gr-nat-pool overload
    16. show ip nat traslations
    17. clear ip nat traslation *
七、其它
    1. sh running-config    //显示当前运行配置
    2. sh startup-config     //显示开机配置
    3. sh ip route             //显示路由
    4. sh nat traslations    //显示nat当前情况
原文地址:https://www.cnblogs.com/bluedy1229/p/3486778.html