Perform the following base configurations such as ACL, UDF, hw-module, NetFlow configuration, and SSH manually on the NCS
540 router:
Configure UDF
router(config)#udf udf-gtp header outer l4 offset 12 length 4
The user-defined field, allows you to define a custom key by specifying the location and size of the field to match.
For example, this command helps in matching the TEID value in the GTP header which is a 4-byte value at the 12th offset from the outer L4 header (UDP L4 header).
Configure the hardware module or TCAM
router(config)#hw-module profile tcam format access-list ipv4 src-addr dst-addr src-port dst-port proto frag-bit enable-capture udf1 udf-gtp location <location>
Reload the router (as hw-module profile and UDF configuration is performed).
Configure Loopback
RP/0/RP0/CPU0:ios(config)#interface Loopback100
RP/0/RP0/CPU0:ios(config-if)# ipv4 address 10.1.1.1 255.255.255.255
RP/0/RP0/CPU0:ios(config)#interface Loopback101
RP/0/RP0/CPU0:ios(config-if)# ipv4 address 10.10.10.2 255.255.255.255
RP/0/RP0/CPU0:ios(config-if)#
Configure ACL
RP/0/RP0/CPU0:ios(config)#ipv4 access-list gtp
RP/0/RP0/CPU0:ios(config-ipv4-acl)# 2000 permit udp any any eq 2152 capture
RP/0/RP0/CPU0:ios(config-ipv4-acl)# 2010 permit ipv4 any any
Note
|
Ensure that you configure the ACL name as gtp. This option is applicable only for Cisco IOS XR 7.7.1 or later.
|
For more information on implementing access lists and prefix lists, see Understanding Access Lists.
If there is any DDoS attack, the controller performs the mitigation action using the ACL rule automatically. The controller
pushes the ACL deny rules to block the traffic coming with the DDoS attacker TEID values.
Note
|
The GTP TEID value of 0x1 varies based on the GTP Tunnel ID.
|
The following is a sample configuration to deny the ACE rule that denies DDoS attacker traffic with TEID value of 0x1:
10 deny ipv4 any any udf udf-gtp 0x1 0xffffffff
The controller pushes the configuration to the router.
Configure SSH
router(config)#ssh server v2
router(config)#ssh server netconf
router(config)#netconf agent tty
router(config)#netconf-yang agent ssh
router(config)#netconf agent tty
!
router(config)#ssh timeout 120
router(config)#ssh server rate-limit 600
router(config)#ssh server session-limit 110
router(config)#ssh server v2
router(config)#ssh server vrf default
router(config)#ssh server netconf vrf default
To configure TPA (until 7.8.1), perform the following steps:
RP/0/RP0/CPU0:ios(config)#tpa
RP/0/RP0/CPU0:ios(config-tpa)#vrf default
RP/0/RP0/CPU0:ios(config-tpa-vrf)#east-west Loopback101
RP/0/RP0/CPU0:ios(config-tpa-vrf)#address-family ipv4
RP/0/RP0/CPU0:ios(config-tpa-vrf-afi)#default-route mgmt
RP/0/RP0/CPU0:ios(config-tpa-vrf-afi)#update-source dataports Loopback100
RP/0/RP0/CPU0:ios(config-tpa-vrf-afi)#
To configure TPA from 7.9.1 or later on NCS 540, perform the following steps:
RP/0/RP0/CPU0:ios(config)#linux networking
RP/0/RP0/CPU0:ios(config-lnx-net)#vrf default
RP/0/RP0/CPU0:ios(config-lnx-vrf)#east-west Loopback101
RP/0/RP0/CPU0:ios(config-lnx-vrf)#address-family ipv4
RP/0/RP0/CPU0:ios(config-lnx-af)#default-route software-forwarding
RP/0/RP0/CPU0:ios(config-lnx-af)#source-hint default-route interface MgmtEth0/RP0/CPU0/0
RP/0/RP0/CPU0:ios(config-lnx-af)#