首页 > 编程知识 正文

思科路由器和华为路由器配置tunnel,思科路由器配置聚合路由

时间:2023-05-04 06:29:25 阅读:261221 作者:73

环境拓扑图

R1配置 接口配置 R1#configure terminalR1(config)#interface ethernet 1/0R1(config-if)#no shutdownR1(config-if)#ip address 30.1.1.2 255.255.255.0R1(config-if)#exitR1(config)#interface ethernet 1/1R1(config-if)#no shutdownR1(config-if)#ip address 172.16.1.193 255.255.255.0R1(config-if)#exit IPSec配置 # ike密钥配置R1(config)#crypto ikev2 keyring ike_key # 生成ike密钥名称R1(config-ikev2-keyring)#peer 20.1.1.1 # 对端IPR1(config-ikev2-keyring-peer)#address 20.1.1.1 # 添加对端IPR1(config-ikev2-keyring-peer)#pre-shared-key 123456 # 配置预共享密钥R1(config-ikev2-keyring-peer)#exitR1(config-ikev2-keyring)#exit# IKEv2一阶段配置R1(config)#crypto ikev2 profile ike_pro # 生成ike概要名称R1(config-ikev2-profile)#match identity remote address 20.1.1.1 255.255.255.255 # 配置对端ike IP地址R1(config-ikev2-profile)#authentication remote pre-share # 设置对端认证方式为预共享密钥R1(config-ikev2-profile)#authentication local pre-share # 设置本端认证方式为预共享密钥R1(config-ikev2-profile)#keyring local ike_key # 关联预共享密钥配置R1(config-ikev2-profile)#exit# IKEv2二阶段配置R1(config)#crypto ipsec profile ipsec_pro # 配置IPSec名称并进入配置R1(ipsec-profile)#set ikev2-profile ike_pro # 关联ike配置R1(ipsec-profile)#set pfs group2 # 设置pfs为2R1(ipsec-profile)#exit# tunnel口配置R1(config)#interface tunnel 0 # 进入tunnel口R1(config-if)#ip address 30.30.30.2 255.255.255.0 # 关闭tunnel口IPR1(config-if)#tunnel source ethernet 1/0 # 配置本端为接口R1(config-if)#tunnel destination 20.1.1.1 # 配置对端为IPR1(config-if)#tunnel protection ipsec profile ipsec_pro # 关联IPSec配置R1(config-if)#exit 路由配置 R1(config)#ip route 20.1.1.0 255.255.255.0 30.1.1.1R1(config)#ip route 10.1.1.0 255.255.255.0 tunnel 0 # 配置路由进入tunnel口 R2配置 接口配置 R2#configure terR2(config)#interface ethernet 1/0R2(config-if)#ip address 30.1.1.1 255.255.255.0R2(config-if)#no shutdownR2(config-if)#exitR2(config)#interface ethernet 1/1R2(config-if)#ip address 20.1.1.2 255.255.255.0R2(config-if)#no shutdown R3配置 接口配置 R3#configure terminalR3(config)#interface ethernet 1/1R3(config-if)#no shutdownR3(config-if)#ip address 20.1.1.1 255.255.255.0R3(config-if)#exitR3(config)#interface ethernet 1/0R3(config-if)#no shutdownR3(config-if)#ip address 10.1.1.2 255.255.255.0R3(config-if)#exit IPSec配置 # ike密钥配置R3(config)#crypto ikev2 keyring ike_key # 生成ike密钥名称R3(config-ikev2-keyring)#peer 30.1.1.2 # 对端IPR3(config-ikev2-keyring-peer)#address 30.1.1.2 # 添加对端IPR3(config-ikev2-keyring-peer)#pre-shared-key 123456 # 配置预共享密钥R3(config-ikev2-keyring-peer)#exitR3(config-ikev2-keyring)#exit# IKEv2一阶段配置R3(config)#crypto ikev2 profile ike_pro # 生成ike概要名称R3(config-ikev2-profile)#match identity remote address 30.1.1.2 255.255.255.255 # 配置对端ike IP地址R3(config-ikev2-profile)#authentication remote pre-share # 设置对端认证方式为预共享密钥R3(config-ikev2-profile)#authentication local pre-share # 设置本端认证方式为预共享密钥R3(config-ikev2-profile)#keyring local ike_key # 关联预共享密钥配置R3(config-ikev2-profile)#exit# IKEv2二阶段配置R3(config)#crypto ipsec profile ipsec_pro # 配置IPSec名称并进入配置R3(ipsec-profile)#set ikev2-profile ike_pro # 关联ike配置R3(ipsec-profile)#set pfs group2 # 设置pfs为2R3(ipsec-profile)#exit# tunnel口配置R3(config)#interface tunnel 0 # 进入tunnel口R3(config-if)#ip address 30.30.30.1 255.255.255.0 # 关闭tunnel口IPR3(config-if)#tunnel source ethernet 1/1 # 配置本端为接口R3(config-if)#tunnel destination 30.1.1.2 # 配置对端为IPR3(config-if)#tunnel protection ipsec profile ipsec_pro # 关联IPSec配置R3(config-if)#exit 路由配置 R3(config)#ip route 30.1.1.0 255.255.255.0 20.1.1.2R3(config)#ip route 172.16.1.0 255.255.255.0 tunnel 0 # 配置路由进入tunnel口R3(config)#end R4配置 接口配置 R4#conf terminalR4(config)#interface ethernet 1/0R4(config-if)#ip address 10.1.1.1 255.255.255.0R4(config-if)#no shutdownR4(config-if)#exit 路由配置 R4(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.2R4(config)#end 结果截图

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。