请问各位大佬,我要192.168.12.x访问10.155.1.x走10.10.11.2。其余的默认网关10.10.12.2, 这个怎么设置, 能给个配置或者配置文档吗?谢谢。
(0)
先生您好,麻烦参考下:
目录
本案例适用于如S7000E、S7500E等的V7交换机,V5、V7交换机具体分类及型号可以参考“1.1 Comware V5、V7平台交换机分类说明”。
交换机SW1上配置一条静态路由,使终端访问114.114.114.114的时候通过R2,其中192.168.2.0这个网段,访问114.114.114.114 的时候匹配策略路由从R3去访问。
一.交换机和路由器上ip地址基本配置
#在SW1上进图系统视图
<H3C>system-view
System View: return to User View with Ctrl+Z.
#创建vlan 1-4
[H3C]vlan 1 to 4
#配置vlan 1-vlan 4虚接口IP地址
[H3C]interface Vlan-interface 1
[H3C-Vlan-interface1] ip address 192.168.1.1 255.255.255.0
[H3C-Vlan-interface1]quit
[H3C]interface Vlan-interface 2
[H3C-Vlan-interface2] ip address 192.168.2.1 255.255.255.0
[H3C-Vlan-interface2]quit
[H3C]interface Vlan-interface 3
[H3C-Vlan-interface3] ip address 10.10.10.1 255.255.255.0
[H3C-Vlan-interface3]quit
[H3C]interface Vlan-interface 4
[H3C-Vlan-interface4] ip address 20.20.20.1 255.255.255.0
[H3C-Vlan-interface4]quit
#将端口分别划分到所属vlan,端口1属于vlan 3,端口4属于vlan 4,端口5属于默人vlan 1,端口6属于vlan 2。
[H3C]interface GigabitEthernet 1/0/1
[H3C-GigabitEthernet1/0/1] port access vlan 3
[H3C-GigabitEthernet1/0/1]quit
[H3C]interface GigabitEthernet 1/0/4
[H3C-GigabitEthernet1/0/4] port access vlan 4
[H3C-GigabitEthernet1/0/4]quit
[H3C]interface GigabitEthernet 1/0/6
[H3C-GigabitEthernet1/0/6] port access vlan 2
[H3C-GigabitEthernet1/0/6]quit
#配置到114.114.114.0网段的静态路由
[H3C] ip route-static 114.114.114.0 24 10.10.10.2
[H3C]save force
#在R1上进图系统视图
<H3C>system-view
System View: return to User View with Ctrl+Z.
#创建环回接口LoopBack 0用来模拟主机,地址是114.114.114.114/24
[H3C]interface LoopBack 0
[H3C-LoopBack0]ip address 114.114.114.114 255.255.255.0
[H3C-LoopBack0]quit
#为路由器1口和2口分别配置IP地址。
[H3C]int GigabitEthernet 0/1
[H3C-GigabitEthernet0/1] ip address 30.30.30.1 255.255.255.0
[H3C]int GigabitEthernet 0/2
[H3C-GigabitEthernet0/2] ip address 40.40.40.1 255.255.255.0
[H3C-GigabitEthernet0/2]quit
#配置到192.168.1.0网段的静态路由
[H3C]ip route-static 192.168.1.0 24 30.30.30.2
#配置到192.168.2.0网段的静态路由
[H3C]ip route-static 192.168.2.0 24 40.40.40.2
#开启设备的ICMP目的不可达报文的发送功能
[H3C]ip unreachables enable
#开启ICMP超时报文发送功能
[H3C]ip ttl-expires enable
[H3C]save force
#在R2上进图系统视图
<H3C>system-view
System View: return to User View with Ctrl+Z.
#为路由器1口和2口分别配置IP地址。
[H3C]int GigabitEthernet 0/0
[H3C-GigabitEthernet0/0] ip address 30.30.30.2 255.255.255.0
[H3C]int GigabitEthernet 0/1
[H3C-GigabitEthernet0/1] ip address 10.10.10.2 255.255.255.0
#配置到114.114.114.0网段的静态路由
[H3C] ip route-static 114.114.114.0 24 30.30.30.1
#配置到192.168.1.0网段的静态路由
[H3C] ip route-static 192.168.1.0 24 10.10.10.1
#配置到192.168.2.0网段的静态路由
[H3C] ip route-static 192.168.2.0 24 10.10.10.1
#开启设备的ICMP目的不可达报文的发送功能
[H3C]ip unreachables enable
#开启ICMP超时报文发送功能
[H3C]ip ttl-expires enable
[H3C]save force
#在R3上进图系统视图
<H3C>system-view
System View: return to User View with Ctrl+Z.
#为路由器1口和2口分别配置IP地址。
[H3C]int GigabitEthernet 0/0
[H3C-GigabitEthernet0/0] ip address 40.40.40.2 255.255.255.0
[H3C]int GigabitEthernet 0/1
[H3C-GigabitEthernet0/1] ip address 20.20.20.2 255.255.255.0
#配置到114.114.114.0网段的静态路由
[H3C] ip route-static 114.114.114.0 24 40.40.40.1
#配置到192.168.1.0网段的静态路由
[H3C] ip route-static 192.168.1.0 24 20.20.20.1
#配置到114.114.114.0网段的静态路由
[H3C] ip route-static 192.168.2.0 24 20.20.20.1
#开启设备的ICMP目的不可达报文的发送功能
[H3C]ip unreachables enable
#开启ICMP超时报文发送功能
[H3C]ip ttl-expires enable
[H3C]save force
二.交换机策略路由配置
<H3C>system-view
System View: return to User View with Ctrl+Z.
#定义访问控制列表3000,用来匹配内网源地址为192.168.2.0/24网段的数据流
[H3C]acl advanced 3000
[H3C-acl-ipv4-adv-3000]rule permit ip source 192.168.2.0 0.0.0.255
[H3C-acl-ipv4-adv-3000]quit
# 定义访问控制列表3001,用来匹配内网192.168.2.0/24网段去访问内网192.168.1.0/24网段的数据流。
[H3C]acl advanced 3001
[H3C-acl-adv-3001]rule permit ip source 192.168.2.0 0.0.0.255 destination 192.168.1.0 0.0.0.255
[H3C-acl-adv-3001]quit
# 创建策略路由,名称为aaa,节点为10,匹配acl 3001的数据流,不设置apply动作(如果不设置动作,则匹配到的数据转发时根据路由表来进行转,且不再匹配下一节点,配置这个节点的作用是实现内网不同网段之间互访的流量不匹配策略路由,达到可以互访的目的。备注:默认情况下,网关在路由器上的不同网段是可以互相访问的)。
[H3C]policy-based-route aaa permit node 10
[H3C-pbr-aaa-10]if-match acl 3001
[H3C-pbr-aaa-10]quit
#创建策略路由aaa的节点20,匹配acl 3000的数据流,设置apply动作,指定数据的下一跳为20.20.20.2。
[H3C]policy-based-route aaa permit node 20
[H3C-pbr-aaa-20]if-match acl 3000
[H3C-pbr-aaa-20]apply next-hop 20.20.20.2
[H3C-pbr-aaa-20]quit
#在内网VLAN虚接口(网关)上应用策略路由
[H3C]interface vlan 2
[H3C-Vlan-interface2]ip policy-based-route aaa
[H3C-Vlan-interface2]quit
[H3C]save force
(0)
https://zhiliao.h3c.com/Theme/details/74479 - S7000/S7500E/10500系列交换机策略路由配置案例
(0)
好的谢谢
好的谢谢
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明