交换机
园区网交换机
数据中心与云计算交换机
中小网络精简型交换机
工业交换机
意图网络指挥官
无线
放装型无线接入点
墙面型无线接入点
智分无线接入点
室外无线接入点
场景化无线
无线控制器
小锐A系列
统一运维
身份管理
服务产品
运营商
政府
金融
互联网
电力能源
制造业
高教/职教
医疗卫生
交通
地产酒店文旅·连锁服务
公共安全
拓扑:PC1---g0/23--SW1--g0/1------------g0/2--SW2-----PC2
SW1交换机配置如下:
interface GigabitEthernet 0/1------->与SW2互联口配置
no switchport
no ip proxy-arp
ip address 1.1.1.1 255.255.255.0
!
interface GigabitEthernet 0/23----->连用户的端口
no switchport
no ip proxy-arp
ip address 192.168.1.1 255.255.255.0
!
interface Loopback 0 ----->GRE的源接口
ip address 11.11.11.11 255.255.255.0
!
interface Tunnel 0 ----->隧道口配置
ip address 12.1.1.1 255.255.255.0
tunnel mode gre ip ----->默认是ipv6ip,必须配置为gre模式
tunnel source Loopback 0 ---->设置gre的源口
tunnel destination 22.22.22.22 ----->设置gre的目的
!
ip route 22.22.22.0 255.255.255.0 1.1.1.2 ---->两个GRE的源口之间必须路由可达
ip route 192.168.2.0 255.255.255.0 Tunnel 0 ------->用户之间的路由
SW2交换机配置如下:
interface GigabitEthernet 0/1
no switchport
no ip proxy-arp
ip address 1.1.1.2 255.255.255.0
!
interface GigabitEthernet 0/23
no switchport
no ip proxy-arp
ip address 192.168.2.1 255.255.255.0
!
interface Loopback 0
ip address 22.22.22.22 255.255.255.0
!
interface Loopback 1
ip address 192.168.10.1 255.255.255.0
!
interface Tunnel 0
ip address 12.1.1.2 255.255.255.0
tunnel mode gre ip
tunnel source Loopback 0
tunnel destination 11.11.11.11
!
ip route 11.11.11.0 255.255.255.0 1.1.1.1
ip route 192.168.1.0 255.255.255.0 Tunnel 0