VLAN间路由的配置
举例:完成VLAN10、VLAN20、VLAN30三个VLAN之间的通信一、利用路由器实现VLAN间的路由1、路由器配置创建第一个子端口:对应VLAN10R1co
figi
terfaceFastEther
et001R1co
figsubife
capsulatio
dot1Q10R1co
figsubifipaddress192168101002552552550IP地址创建第二个子端口:对应VLAN20R1co
figi
terfaceFastEther
et002R1co
figsubife
capsulatio
dot1Q20R1co
figsubifipaddress192168201002552552550创建第三个子端口:对应VLAN30R1co
figi
terfaceFastEther
et003R1co
figsubife
capsulatio
dot1Q30R1co
figsubifipaddress192168301002552552550打开物理端口,使所有逻辑子端口成为UP状态R1co
figi
terfaceFastEther
et00R1co
figif
oshuodow
2、二层交换机的配置与路由器相连接的二层交换机的端口必须设置为TRUNK端口。SwitchCo
figI
tf05SwitchCo
figifSwitchportmodetru
k3、终端PC的配置每一台终端PC都要将网关设置为:属于本VLAN的路由器子接口的IP地址。二、利用三层交换机实现VLAN间路由1、三层交换机的配置创建相应的VLANSwitchCo
figvla
10
第1页共1页
建立子端口封装所属的VLAN配置所属VLAN的
fSwitchCo
figvla
20SwitchCo
figvla
30创建VLAN接口并设置IP地址;SwitchCo
figi
terfacevla
10SwitchCo
figIfVla
10ipaddress192168101002552552550SwitchCo
figi
terfacevla
20SwitchCo
figIfVla
20ipaddress192168201002552552550SwitchCo
figi
terfacevla
30SwitchCo
figIfVla
30ipaddress192168301002552552550设置TRUNK端口与二层交换机相连接的三层交换机的端口必须设置为TRUNK端口。SwitchCo
figI
tf01SwitchCo
figifSwitchportmodetru
k2、二层交换机的配置与三层交换机连接的二层交换机的端口也必须设置为TRUNK端口。SwitchCo
figI
tf05SwitchCo
figifSwitchportmodetru
k3、终端PC的配置每一台终端PC都要将网关设置为:属于本VLAN的三层交换机VLAN接口的IP地址。
第2页共2页
fr