7506x怎配置流量重定向到准入设备
7506x怎么配置流量重定向到准入
(0)
最佳答案
您好,请知:
可以配置策略路由来实现。
以下是配置案例,请参考:
3 配置步骤
#在SW1上进图系统视图
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上进图系统视图
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
#配置到114.114.114.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上进图系统视图
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
#配置到114.114.114.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上进图系统视图
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 10.10.10.2
#配置到114.114.114.0网段的静态路由
[H3C] ip route-static 192.168.2.0 24 10.10.10.
#开启设备的ICMP目的不可达报文的发送功能
[H3C]ip unreachables enable
#开启ICMP超时报文发送功能
[H3C]ip ttl-expires enable
[H3C]save force
二.交换机策略路由配置
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 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
4 验证配置
# 交换机上没有配置策略路由的时候,在两台终端上tracert路径的结果如下:
192.168.1.2:
192.168.2.2:
# 配置了策略路由以后
192.168.1.2:
192.168.2.2:
(0)
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论