通常路由器一个接口只能配置 一个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
来源:51CTO
作者:2944496863
链接:https://blog.51cto.com/13566951/2063339