路由器基础配置

 

实验

设置各路由器与交换机名称(每次修改参数都需使用save命令保存

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname S1
[S1]
# ctrl+z 退出,并保存
<S1>save
  • 建立实验拓扑

    路由器实验拓扑如上,S1.S2选择S5700,R1选择AR1200,连线为copper,连接到设备时选择GE或Ethernet接口

    设备接口IP地址子网掩码默认网关
    PC1Ethernet0/0/110.0.1.1255.255.255.010.0.1.254
    PC2Ethernet0/0/110.0.2.1255.255.255.010.0.2.254
    R1GE 0/0/010.0.1.254255.255.255.0N/A
    GE 0/0/110.0.2.254255.255.255.0N/A
  • 基础配置

    设置两台PC的IP地址和子网掩码

  • 配置路由器接口IP地址

    双击进入路由器系统视图进行配置

    <Huawei>system-view 
    Enter system view, return user view with Ctrl+Z.
    # 进入GE0/0/0接口视图
    [Huawei]interface GigabitEthernetb 0/0/0
    # 配置IP地址和掩码
    [Huawei-GigabitEthernet0/0/0]ip add 10.0.1.254 24
    Mar 16 2023 08:42:10-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
     IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
    # 同样方法进入GE0/0/1接口的配置
    [Huawei-GigabitEthernet0/0/0]int G0/0/1
    [Huawei-GigabitEthernet0/0/1]ip add 10.0.2.254 24
    ​
    # 配置完成,查看接口与IP相关信息
    [Huawei]display ip interface brief
    *down: administratively down
    ^down: standby
    (l): loopback
    (s): spoofing
    The number of interface that is UP in Physical is 3
    The number of interface that is DOWN in Physical is 0
    The number of interface that is UP in Protocol is 3
    The number of interface that is DOWN in Protocol is 0
    ​
    Interface                         IP Address/Mask      Physical   Protocol  
    GigabitEthernet0/0/0              10.0.1.254/24        up         up        
    GigabitEthernet0/0/1              10.0.2.254/24        up         up        
    NULL0                             unassigned           up         up(s)
    ​
    # 配置完成要进行保存(ctrl+z退出)
    <Huawei>save
      The current configuration will be written to the device. 
      Are you sure to continue? (y/n)[n]:y
      It will take several minutes to save configuration file, please wait........
  • 查看路由器配置信息

    display ip routing-table :查看ipv4路由表信息

  • 测试连通性

    直连网段连通性测试完毕后,再测试非直连设备(PC)能否ping通

    # 路由器ping
    <Huawei>ping 10.0.1.1
      PING 10.0.1.1: 56  data bytes, press CTRL_C to break
        Reply from 10.0.1.1: bytes=56 Sequence=1 ttl=128 time=100 ms
        Reply from 10.0.1.1: bytes=56 Sequence=2 ttl=128 time=70 ms
        Reply from 10.0.1.1: bytes=56 Sequence=3 ttl=128 time=60 ms
        Reply from 10.0.1.1: bytes=56 Sequence=4 ttl=128 time=40 ms
        Reply from 10.0.1.1: bytes=56 Sequence=5 ttl=128 time=40 ms
    ​
      --- 10.0.1.1 ping statistics ---
        5 packet(s) transmitted
        5 packet(s) received
        0.00% packet loss
        round-trip min/avg/max = 40/62/100 ms
    ​
    <Huawei>ping 10.0.2.1
      PING 10.0.2.1: 56  data bytes, press CTRL_C to break
        Reply from 10.0.2.1: bytes=56 Sequence=1 ttl=128 time=40 ms
    ​
      --- 10.0.2.1 ping statistics ---
        5 packet(s) transmitted
        5 packet(s) received
        0.00% packet loss
        round-trip min/avg/max = 30/42/60 ms
    # 通过PC1和PC2命令行来测试其连通性
    PC>ping 10.0.2.1
    ​
    Ping 10.0.2.1: 32 data bytes, Press Ctrl_C to break
    From 10.0.2.1: bytes=32 seq=1 ttl=127 time=78 ms
    From 10.0.2.1: bytes=32 seq=2 ttl=127 time=78 ms
    From 10.0.2.1: bytes=32 seq=3 ttl=127 time=47 ms
    From 10.0.2.1: bytes=32 seq=4 ttl=127 time=62 ms
    From 10.0.2.1: bytes=32 seq=5 ttl=127 time=47 ms
    ​
    --- 10.0.2.1 ping statistics ---
      5 packet(s) transmitted
      5 packet(s) received
      0.00% packet loss
      round-trip min/avg/max = 47/62/78 ms

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

透明瞳孔

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值