HCIP的静态路由复习

VRP设置用户名+密码登录

[R1]aaa
[R1-aaa]local-user TMG password cipher huawei      #创建一个名TMG的用户,密码huawei
Info: Add a new user.

[R1-aaa]local-user TMG privilege level 15          #设置权限
[R1-aaa]local-user TMG service-type terminal       #设为本地登录,还可以设为远程登录telnet


[R1]user-in co 0	                               #进入console口
[R1-ui-console0]authentication-mode aaa            #调用aaa

重新登录

路由器的作用:

        1.划分广播域

        2.连接不同的网络

        3.路由---选路

在R3上写静态路由:

        传统写法:
[R3]ip route-static 192.168.1.0 24 192.168.4.1
[R3]ip route-static 192.168.2.0 24 192.168.4.1
[R3]ip route-static 192.168.3.0 24 192.168.4.1

[R3]dis ip ro pr s
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
         Destinations : 3        Routes : 3        Configured Routes : 3

Static routing table status : <Active>
         Destinations : 3        Routes : 3

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

    192.168.1.0/24  Static  60   0          RD   192.168.4.1     GigabitEthernet
0/0/1
    192.168.2.0/24  Static  60   0          RD   192.168.4.1     GigabitEthernet
0/0/1
    192.168.3.0/24  Static  60   0          RD   192.168.4.1     GigabitEthernet
0/0/1

        汇总写法:
[R3]ip route-static 192.168.0.0 22 192.168.4.1

[R3]dis ip ro pr s             #查看静态路由表
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
         Destinations : 1        Routes : 1        Configured Routes : 1

Static routing table status : <Active>
         Destinations : 1        Routes : 1

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

    192.168.0.0/22  Static  60   0          RD   192.168.4.1     GigabitEthernet
0/0/1

[R3]ip route-static  192.168.0.0 22 NULL 0         #最后在写上空接口防环路由

        到达R3上的缺省路由写法:
[R1]ip route-static 0.0.0.0 0 192.168.3.2
[R2]ip route-static 0.0.0.0 0 192.168.4.2

        浮动静态路由(通过修改优先级的方法,达到路由备份的效果):

让下面那条路作为备份

能看见这个缺省有两条路,一个192.168.4.2,和34.1.1.2,我们把下面那个优先级改大,就达到了备份的效果

[R2]ip route-static 0.0.0.0 0 34.1.1.2 preference 80

当我们把上面那个路断了后,下面这个路径就会从备用(不常用)里面进入使用状态

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值