实验目的:简单小型网络的单臂路由配置方法。
实验拓扑:小型局域网,由二层交换机连接三个不同VLAN网段,通过一台路由器上网。
实验配置:
PC配置 192.168.1-3.1/24/192.168.1-3.254
交换机配置:
sysname SW
VLAN 10 20 30
interface GigabitEthernet1/0/2
port link-type trunk
port trunk permit vlan all
//上联端口配置为TRUNK,放行所有VLAN
interface GigabitEthernet1/0/3
port access vlan 10
interface GigabitEthernet1/0/4
port access vlan 20
interface GigabitEthernet1/0/4
port access vlan 30
路由器配置
sysname R1
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
//配置环回口模拟外网
interface GigabitEthernet0/2.10
ip address 192.168.1.254 255.255.255.0
vlan-type dot1q vid 10
vlan-termination broadcast enable
interface GigabitEthernet0/2.20
ip address 192.168.2.254 255.255.255.0
vlan-type dot1q vid 20
vlan-termination broadcast enable
interface GigabitEthernet0/2.30
ip address 192.168.3.254 255.255.255.0
vlan-type dot1q vid 30
vlan-termination broadcast enable
//配置子接口,终结对应VLAN
配置完成后,查看路由器路由表正常
PC之间、PC与外网互通访问正常