全球最实用的IT互联网信息网站!

AI人工智能P2P分享&下载搜索网页发布信息网站地图

当前位置:诺佳网 > 电子/半导体 > 通信网络 >

华为路由器实现单臂路由的编程分享

时间:2023-03-06 10:01

人气:

作者:admin

标签: 端口  路由器  华为 

导读:华为路由器实现单臂路由的编程分享-R1配置。注意:如果在实验过程中某个端口配置错了,可以使用undo shutdown初始化端口配置。...

实验拓扑

9f726850-bb5d-11ed-bfe3-dac502259ad0.png

SWH1配置

The device is running!


sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys swh
 
[swh]vlan batch 10 20

[swh]int g0/0/1
[swh-GigabitEthernet0/0/1]port link-type acc 
[swh-GigabitEthernet0/0/1]port default vlan 10


[swh-GigabitEthernet0/0/1]int g0/0/2
[swh-GigabitEthernet0/0/2]port link-type acc
[swh-GigabitEthernet0/0/2]port default vlan 20
[swh-GigabitEthernet0/0/2]q

[swh]dis vlan
The total number of vlans is : 3
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan; 网络技术干货圈
--------------------------------------------------------------------------------

VID  Type    Ports                                                          
--------------------------------------------------------------------------------
1    common  UT:GE0/0/3(D)      GE0/0/4(D)      GE0/0/5(D)      GE0/0/6(D)      
                GE0/0/7(D)      GE0/0/8(D)      GE0/0/9(D)      GE0/0/10(D)     
                GE0/0/11(D)     GE0/0/12(D)     GE0/0/13(D)     GE0/0/14(D)     
                GE0/0/15(D)     GE0/0/16(D)     GE0/0/17(D)     GE0/0/18(D)     
                GE0/0/19(D)     GE0/0/20(D)     GE0/0/21(D)     GE0/0/22(D)     
                GE0/0/23(D)     GE0/0/24(U)                                     

10   common  UT:GE0/0/1(U)                                                      

20   common  UT:GE0/0/2(U)                                                      


VID  Status  Property      MAC-LRN Statistics Description      
--------------------------------------------------------------------------------

1    enable  default       enable  disable    VLAN 0001                         
10   enable  default       enable  disable    VLAN 0010                         
20   enable  default       enable  disable    VLAN 0020                         


[swh]int g0/0/24 
[swh-GigabitEthernet0/0/24]port link-type trunk 
[swh-GigabitEthernet0/0/24]port trunk allow-pass vlan 10 20
[swh-GigabitEthernet0/0/24]q
[swh]

R1配置

注意:如果在实验过程中某个端口配置错了,可以使用undo shutdown初始化端口配置。

sys
Enter system view, return user view with Ctrl+Z.
[Huawei]
[Huawei]sys R1
[R1]

[R1]int g0/0/0.10     #子接口10用来和接受vlan10
[R1-GigabitEthernet0/0/0.10]dot1q termination vid 10   #意思是这个接口接在vlan10上面
[R1-GigabitEthernet0/0/0.10]ip add 192.168.10.254 24
Oct 22 2020 2338-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0.10 has entered the UP state. 
[R1-GigabitEthernet0/0/0.10] 
[R1-GigabitEthernet0/0/0.10]arp broadcast enable    #启用子接口的ARP广播功能,公众号:wljsghq
[R1-GigabitEthernet0/0/0.10]q

[R1]int g0/0/0.20
[R1-GigabitEthernet0/0/0.20]dot1q termination vid 20
[R1-GigabitEthernet0/0/0.20]ip add 192.168.20.254 24
Oct 22 2020 2319-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/0.20 has entered the UP state. 

[R1-GigabitEthernet0/0/0.20]arp broadcast enable

[R1-GigabitEthernet0/0/0.20]dis this
[V200R003C00]
#
interface GigabitEthernet0/0/0.20
 dot1q termination vid 20
 ip address 192.168.20.254 255.255.255.0 
 arp broadcast enable
#
return
[R1-GigabitEthernet0/0/0.20]

查看路由器的配置

[R1]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              unassigned           up         down      
GigabitEthernet0/0/0.10           192.168.10.254/24    up         up        
GigabitEthernet0/0/0.20           192.168.20.254/24    up         up        
GigabitEthernet0/0/1              unassigned           down       down      
NULL0                             unassigned           up         up(s)     
[R1]
编辑:黄飞

 

 

 

温馨提示:以上内容整理于网络,仅供参考,如果对您有帮助,留下您的阅读感言吧!
相关阅读
本类排行
相关标签
本类推荐

CPU | 内存 | 硬盘 | 显卡 | 显示器 | 主板 | 电源 | 键鼠 | 网站地图

Copyright © 2025-2035 诺佳网 版权所有 备案号:赣ICP备2025066733号
本站资料均来源互联网收集整理,作品版权归作者所有,如果侵犯了您的版权,请跟我们联系。

关注微信