使用的设备是
SecPath-F1030
现在的配置大概如下,现在预期对于内网192.168.1.*用户,访问47.96.123.76走特定的出口g1/0/15,默认的流量保持现状不变,请大家给个帮助。
dhcp server ip-pool 192.168.1.0/24
gateway-list 192.168.1.1
network 192.168.1.0 mask 255.255.255.0
dns-list 114.114.114.114 223.5.5.5
interface Vlan-interface1
ip address 192.168.1.1 255.255.255.0
# interface Vlan-interface2
ip address 192.168.2.1 255.255.255.0
# interface GigabitEthernet1/0/0
port link-mode route
ip address 192.168.0.1 255.255.255.0
# interface GigabitEthernet1/0/1
port link-mode route
# interface GigabitEthernet1/0/13
port link-mode route
bandwidth 1000000
pppoe-client dial-bundle-number 0
# interface GigabitEthernet1/0/14
port link-mode route
bandwidth 1000000
pppoe-client dial-bundle-number 1
# interface GigabitEthernet1/0/15
port link-mode route
bandwidth 1000000
ip address 10.20.30.40 255.255.255.0 ip last-hop hold gateway 10.20.30.1
#
ip route-static 0.0.0.0 0 Dialer0
ip route-static 0.0.0.0 0 Dialer1
(0)
最佳答案
现在预期对于内网192.168.1.*用户,访问47.96.123.76走特定的出口g1/0/15
用PBR就行了,ACL匹配源赫目的,丢给1、0、15
==========案例===========
<H3C>system-view
[H3C]acl advanced 3000
[H3C-acl-ipv4-adv-3000]rule 0 permit ip source 192.168.1.0 0.0.0.255
[H3C-acl-ipv4-adv-3000]quit
3.2.2 创建ACL匹配需要由联通链路转发的数据 创建ACL 3001匹配192.168.2.0网段数据
[H3C]acl advanced 3001
[H3C-acl-ipv4-adv-3001]rule 0 permit ip source 192.168.2.0 0.0.0.255
[H3C-acl-ipv4-adv-3001]quit
3.3 创建策略路由
3.3.1 创建移动策略路由节点 创建策略路由neiwang节点5匹配192.168.1.0网段的数据由移动线路转发。
[H3C]policy-based-route neiwang node 5
[H3C-pbr-neiwang-5]if-match acl 3000
[H3C-pbr-neiwang-5]apply next-hop 1.1.1.2
[H3C-pbr-neiwang-5]quit
注:next-hop后的地址为移动线路的网关
3.3.2 创建移动策略路由节点 创建策略路由neiwang节点10匹配192.168.2.0网段的数据由联通线路转发。
[H3C]policy-based-route neiwang node 10
[H3C-pbr-neiwang-10]if-match acl 3001
[H3C-pbr-neiwang-10]apply next-hop 2.2.2.2
[H3C-pbr-neiwang-10]quit
注:next-hop后的地址为联通线路的网关
3.4 应用策略 在防火墙连接内网的接口GigabitEthernet 1/0/4口调用策略路由
[H3C]interface GigabitEthernet 1/0/4
[H3C-GigabitEthernet1/0/4]ip policy-based-route neiwang
[H3C-GigabitEthernet1/0/4]quit
注:策略路由必须调用在内网接口才能生效。
(0)
配置pbr可以是此案,参考
如图1所示,缺省情况下,Device的VLAN接口2上收到的所有访问Server的报文根据路由表转发的下一跳均为10.4.1.2。
现要求在Device上配置IPv4策略路由,对于访问Server的报文实现如下要求:
(1) 首先匹配Vlan-interface2上收到的源IP地址为10.2.1.1的报文,将该报文的下一跳重定向到10.5.1.2;
(2) 其次匹配Vlan-interface2上收到的HTTP报文,将该报文的下一跳重定向到10.3.1.2。
图1 IPv4策略路由特性典型配置组网图
· 为了确保能同时满足对于两种不同类型的报文重定向到不同的下一跳,需要配置两个访问控制列表,一个用于匹配Vlan-interface2上收到的源IP地址为10.2.1.1的报文,另一个用于匹配Vlan-interface2上收到的HTTP报文,并在策略路由中创建两个节点,分别对匹配上的报文进行重定向;
· 同一条策略路由中,创建的节点编号越小,优先级越高。为了确保Vlan-interface2上收到源IP地址为10.2.1.1的HTTP报文下一跳能优先被重定向到10.5.1.2,需要在策略路由中配置该策略使用较小的节点编号(本例中使用0号节点,另一策略使用1号节点)。
#配置Vlan-interface2的IP地址。
<Device> system-view
[Device] interface vlan-interface 2
[Device-Vlan-interface2] ip address 10.1.2.1 255.255.255.0
[Device-Vlan-interface2] quit
#请参考以上方法配置图1中其它接口的IP地址,配置步骤这里省略。
# 配置静态路由,保证三条路径都可达,并且缺省下一跳为10.4.1.2。
[Device] ip route-static 192.168.1.0 24 10.3.1.2
[Device] ip route-static 192.168.1.0 24 10.4.1.2 preference 40
[Device] ip route-static 192.168.1.0 24 10.5.1.2
# 定义访问控制列表ACL 3005,用于匹配源IP地址为10.2.1.1的报文。
[Device] acl advanced 3005
[Device-acl-ipv4-adv-3005] rule 0 permit ip source 10.2.1.1 0
[Device-acl-ipv4-adv-3005] quit
# 定义访问控制列表ACL 3006,用于匹配HTTP报文。
[Device] acl advanced 3006
[Device-acl-ipv4-adv-3006] rule 0 permit tcp destination-port eq www
[Device-acl-ipv4-adv-3006] quit
# 创建策略路由pbr1的0号节点,将匹配ACL 3005的报文下一跳重定向到10.5.1.2。
[Device] policy-based-route pbr1 permit node 0
[Device-pbr-pbr1-0] if-match acl 3005
[Device-pbr-pbr1-0] apply next-hop 10.5.1.2
[Device-pbr-pbr1-0] quit
# 创建策略路由pbr1的1号节点,将匹配ACL 3006的报文下一跳重定向到10.3.1.2。
[Device] policy-based-route pbr1 permit node 1
[Device-pbr-pbr1-1] if-match acl 3006
[Device-pbr-pbr1-1] apply next-hop 10.3.1.2
[Device-pbr-pbr1-1] quit
# 在Device的接口Vlan-interface2上应用策略。
[Device] interface vlan-interface 2
[Device-Vlan-interface2] ip policy-based-route pbr1
[Device-Vlan-interface2] quit
通过display ip policy-based-route命令可以查看到当前策略路由配置已经配置成功:
[Device] display ip policy-based-route policy pbr1
Policy name: pbr1
node 0 permit:
if-match acl 3005
apply next-hop 10.5.1.2
node 1 permit:
if-match acl 3006
apply next-hop 10.3.1.2
# 通过tracert命令查看以下报文的转发路径(使用Tracert功能需要在中间设备上开启ICMP超时报文发送功能,在目的端开启ICMP目的不可达报文发送功能):
源IP为10.1.1.1的非HTTP报文,重定向到10.4.1.2进行转发。
<Switch> tracert -a 10.1.1.1 192.168.1.1
traceroute to 192.168.1.1 (192.168.1.1) from 10.1.1.1, 30 hops at most, 40 bytes
each packet, press CTRL_C to break
1 10.1.2.1 (10.1.2.1) 2.178 ms 1.364 ms 1.058 ms
2 10.4.1.2 (10.4.1.2) 1.548 ms 1.248 ms 1.112 ms
3 192.168.1.1 (192.168.1.1) 1.594 ms 1.321 ms 1.093 ms
源IP为10.2.1.1的报文,重定向到10.5.1.2进行转发。
<Switch> tracert -a 10.2.1.1 192.168.1.1
traceroute to 192.168.1.1 (192.168.1.1) from 10.2.1.1, 30 hops at most, 40 bytes
each packet, press CTRL_C to break
1 10.1.2.1 (10.1.2.1) 1.721 ms 1.226 ms 1.050 ms
2 10.5.1.2 (10.5.1.2) 4.494 ms 1.385 ms 1.170 ms
3 192.168.1.1 (192.168.1.1) 1.448 ms 1.304 ms 1.093 ms
#
vlan 1
#
vlan 2 to 5
#
policy-based-route pbr1 permit node 0
if-match acl 3005
apply next-hop 10.5.1.2
#
policy-based-route pbr1 permit node 1
if-match acl 3006
apply next-hop 10.3.1.2
#
interface Vlan-interface2
ip address 10.1.2.1 255.255.255.0
ip policy-based-route pbr1
#
interface Vlan-interface3
ip address 10.3.1.1 255.255.255.0
#
interface Vlan-interface4
ip address 10.4.1.1 255.255.255.0
#
interface Vlan-interface5
ip address 10.5.1.1 255.255.255.0
#
interface Ten-GigabitEthernet3/0/1
port link-mode bridge
port access vlan 2
#
interface Ten-GigabitEthernet3/0/3
port link-mode bridge
port access vlan 3
#
interface Ten-GigabitEthernet3/0/4
port link-mode bridge
port access vlan 4
#
interface Ten-GigabitEthernet3/0/5
port link-mode bridge
port access vlan 5
#
ip route-static 192.168.1.0 24 10.3.1.2
ip route-static 192.168.1.0 24 10.4.1.2 preference 40
ip route-static 192.168.1.0 24 10.5.1.2
#
acl advanced 3005
rule 0 permit ip source 10.2.1.1 0
#
acl advanced 3006
rule 0 permit tcp destination-port eq www
(0)
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
能否贴点示例命令呢?说实话这个东西,之前没接触过。。
参考