网络描述:客户内部电脑分为内网和互联网;由于预算有限,只有一台核心交换机,分别连接互联网和集团内网;客户想要内网交换机的终端只能访问集团内网,接互联网的交换机只访问互联网,看看有啥办法?
分析:一种你通过部署ACL、策略路由;还有一种种是采用VRF,可扩展性高,关键是真香!下面采用VRF配置。
拓扑如下:
关键配置:
AR1:
interface LoopBack0 //环回口测试网络用
ip address 1.1.1.1 255.255.255.255
interface GigabitEthernet0/0/0
ip address 10.10.10.1 255.255.255.0
ip route-static 192.168.100.0 255.255.255.0 10.10.10.2
AR2:
interface LoopBack0 //环回口测试网络用
ip address 2.2.2.2 255.255.255.255
interface GigabitEthernet0/0/0
ip address 10.10.20.1 255.255.255.0
ip route-static 172.16.200.0 255.255.255.0 10.10.20.2
核心配置Core:
ip vpn-instance jituan //创建vpn实例
ipv4-family
route-distinguisher 20:1
interface Vlanif10 //连接互联网路由器
ip address 10.10.10.2 255.255.255.0
#
interface Vlanif20 //连接集团内网路由器
ip binding vpn-instance jituan //绑定vpn实例
ip address 10.10.20.2 255.255.255.0
#
interface Vlanif30 //连接互联网交换机
ip address 192.168.100.254 255.255.255.0
#
interface Vlanif40 //连接内网交换机
ip binding vpn-instance jituan //绑定vpn实例
ip address 172.16.200.254 255.255.255.0
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 30
#
interface GigabitEthernet0/0/4
port link-type access
port default vlan 40
ip route-static 0.0.0.0 0.0.0.0 10.10.10.1
ip route-static vpn-instance jituan 0.0.0.0 0.0.0.0 10.10.20.1 //VPN实例jituan路由
测试:
PC1可以ping通1.1.1.1,ping不通2.2.2.2,满足要求
PC2可以ping通2.2.2.2 ,ping不通1.1.1.1,满足要求