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

1.R1上配置单臂路由
[R1]int GigabitEthernet 0/0/0.10 配置标识为.10的子接口
[R1-GigabitEthernet0/0/0.10]dot1q termination vid 10 标识vlan id的tag
[R1-GigabitEthernet0/0/0.10]ip address 10.1.1.100 24 配置vlan10的网关
[R1-GigabitEthernet0/0/0.10]arp broadcast enable 开启子接口主动发送ARP请求报文
[R1-GigabitEthernet0/0/0.10]quit

[R1]int GigabitEthernet 0/0/0.20
[R1-GigabitEthernet0/0/0.20]dot1q termination vid 20
[R1-GigabitEthernet0/0/0.20]ip address 10.1.2.100 24
[R1-GigabitEthernet0/0/0.20]arp broadcast enable
[R1-GigabitEthernet0/0/0.20]quit

2.S1上创建vlan 10 20,并把连接用户的接口划分到对应的vlan10和vlan20
[S1]vlan batch 10 20

[S1]interface Ethernet 0/0/2
[S1-Ethernet0/0/2]port link-type access
[S1-Ethernet0/0/2]port default vlan 10
[S1-Ethernet0/0/2]quit

[S1]interface Ethernet 0/0/3
[S1-Ethernet0/0/3]port link-type access
[S1-Ethernet0/0/3]port default vlan 20
[S1-Ethernet0/0/3]quit

3.S1上把连接路由器的接口配为trunk:
[S1]int Ethernet0/0/1
[S1-Ethernet0/0/1]port link-type trunk
[S1-Ethernet0/0/1]port trunk allow-pass vlan all
[S1-Ethernet0/0/1]quit