通常路由器一个接口只能配置 一个ip地址,但是有些时候需要配置多个ip,就用到了单臂路由
这是就需要在接口配置子接口

#路由器配置
[Huawei]inter gi0/0/0.1
[Huawei-GigabitEthernet0/0/0.1]dot1q termination vid 10 封装协议
[Huawei-GigabitEthernet0/0/0.1]ip add 192.168.10.254 255.255.255.0 字接口配置ip
[Huawei-GigabitEthernet0/0/0.1]arp broadcast enable 开启ARP广播
[Huawei]inter gi0/0/0.2
[Huawei-GigabitEthernet0/0/0.2]dot1q termination vid 20
[Huawei-GigabitEthernet0/0/0.2]ip add 192.168.20.254 255.255.255.0
[Huawei-GigabitEthernet0/0/0.2]
[Huawei-GigabitEthernet0/0/0.2]inte gi0/0/0.3
[Huawei]inter gi0/0/0.3
[Huawei-GigabitEthernet0/0/0.3]dot1q termination vid 30
[Huawei-GigabitEthernet0/0/0.3]ip add 192.168.30.254 255.255.255.0
[Huawei-GigabitEthernet0/0/0.3]arp broadcast en
[Huawei-GigabitEthernet0/0/0.3]inte gi0/0/0.4
[Huawei]inter gi0/0/0.4
[Huawei-GigabitEthernet0/0/0.4]dot1q termination vid 40
[Huawei-GigabitEthernet0/0/0.4]ip add 192.168.40.254 255.255.255.0
[Huawei-GigabitEthernet0/0/0.4]arp broadcast en

#交换机配置
[Huawei]vla batch 10 20 30 40 批量创建VLAN 10 20 30 40
[Huawei]inter gi0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type access
[Huawei-GigabitEthernet0/0/1]port default vla 10

    [Huawei-GigabitEthernet0/0/1]inter gi0/0/2  
    [Huawei-GigabitEthernet0/0/2]port link-type access  
    [Huawei-GigabitEthernet0/0/2]port default vla 20

    [Huawei-GigabitEthernet0/0/2]inter gi0/0/3  
    [Huawei-GigabitEthernet0/0/3]port link-type  access
    [Huawei-GigabitEthernet0/0/3]port default vla 30

    [Huawei-GigabitEthernet0/0/3]inter gi0/0/4
    [Huawei-GigabitEthernet0/0/4]port link-type access
    [Huawei-GigabitEthernet0/0/4]port default vla 40

    [Huawei-GigabitEthernet0/0/4]inter gi0/0/5  
    [Huawei-GigabitEthernet0/0/5]port link-type trunk   
    [Huawei-GigabitEthernet0/0/5]port trunk allow-pass vl all

单臂路由器配置_第1张图片