XGS-5240-Series User Manual

Table Of Contents
Configuration Guide of XGS-5240-Series
26-3
segment, and set the next-hop as 218.31.1.119, meanwhile the local network IP of this
network ranges within 192.168.0.0/16. To assure normal communication in local network,
messages from 192.168.1.0/24 to local IP 192.168.0.0/16 are not applied with policy routing.
The interface address of 192.168.1.0/24 of this device is 192.168.1.1.
Configuration procedure is as follows:
Switch#config
Switch(config)#ip access-list extended a1
Switch(Config-IP-Ext-Nacl-a1)# permit ip 192.168.1.0 0.0.0.255 192.168.0.0 0.0.255.255
Switch(Config-IP-Ext-Nacl-a1)#exit
Switch(config)#ip access-list extended a2
Switch(Config-IP-Ext-Nacl-a1)# permit ip 192.168.1.0 0.0.0.255 any-destination
Switch(Config-IP-Ext-Nacl-a1)#exit
Switch(config)#mls qos
Switch(config)#class-map c1
Switch(Config-ClassMap-c1)#match access-group a1
Switch(Config-ClassMap-c1)# exit
Switch(config)#class-map c2
Switch(Config-ClassMap-c2)#match access-group a2
Switch(Config-ClassMap-c2)# exit
Switch(config)#policy-map p1
Switch(Config-PolicyMap-p1)#class c1
Switch(Config-PolicyMap-p1-Class-c1)#set ip nexthop 192.168.1.1
Switch(Config-PolicyMap-p1-Class-c1)#exit
Switch(Config-PolicyMap-p1)#class c2
Switch(Config-PolicyMap-p1-Class-c2)#set ip nexthop 218.31.1.119
Switch(Config-PolicyMap-p1-Class-c2)#exit
Switch(config)#interface ethernet 1/0/1
Switch(Config-If-Ethernet1/0/1)#service-policy input p1
Configuration results:
First set ACL a1 and a2. a1 matches source IP segments 192.168.1.0/24 and destination
IP segments 192.168.0.0/16. a2 matches source IP segments 192.168.1.0/24. Turn on QoS
function in global mode and create two class-maps: c1 in which matches ACL a1 and c2 in
which matches ACL a2. And create a policy-map in which quote c1. Set the interface address
of 192.168.1.0/24 of this device as 192.168.1.1. Set the next-hop IP as 218.31.1.119 and apply
the policy-map at port ethernet1/0/1. After that, all messages on port ethernet 1/0/1 from
segment 192.168.1.0/24 will be transmitted through 218.31.1.119 except those from