今天讲解了三层交换的应用案例
以下TOP中模拟一家小型企业的网络结构,有三台交换机,一台核心交换机,两台接入交换机。其中路由器的LOOP 0接口模拟外网中的一台服务器。请你通过VLANIF和静态路由配置,使这个企业的用户既可以内网互通,也可以访问外网地址。
运行环境
实验思路:
先配置vlan,trunk
在配置vlanif 先实现内网互通
在配置默认路由 静态路由实现全网互通
SW2:
//配置vlan trunk
interface Ethernet0/0/1
port link-type access
port default vlan 20
interface Ethernet0/0/2
port link-type access
port default vlan 30
interface Ethernet0/0/5
port link-type trunk
port trunk allow-pass vlan 20 30
SW3:
//配置vlan trunk
interface Ethernet0/0/1
port link-type access
port default vlan 20
interface Ethernet0/0/2
port link-type access
port default vlan 30
interface Ethernet0/0/5
port link-type trunk
port trunk allow-pass vlan 20 30
SW1:
//配置vlan trunk
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
interface GigabitEthernet0/0/2
port link-type access
port default vlan 10
interface GigabitEthernet0/0/5
port link-type trunk
port trunk allow-pass vlan 20 30
interface GigabitEthernet0/0/6
port link-type trunk
port trunk allow-pass vlan 20 30
//配置vlanif
interface Vlanif10
ip address 192.168.5.100 255.255.255.0
interface Vlanif20
ip address 192.168.1.100 255.255.255.0
interface Vlanif30
ip address 192.168.2.100 255.255.255.0
现在可以实现内网互通
配置路由器
AR1:
interface GigabitEthernet0/0/0
ip address 172.168.1.1 255.255.255.0
interface LoopBack0
ip address 1.1.1.1 255.255.255.0
//配置静态路由(回去的)
ip route-static 192.168.0.0 21 g0/0/0 172.168.1.100
SW1:
//配置vlan vlanif
vlan 172
interface GigabitEthernet0/0/10
port link-type access
port default vlan 172
interface Vlanif172
ip address 172.168.1.100 255.255.255.0
//配置默认路由
ip route-static 0.0.0.0 0 vlanif 172 172.168.1.1
现在可以实现全网互通