HP MSR Router Series. Layer 3 - IP Services Configuration Guide(V7)
|
|
|
- Millicent Sims
- 9 years ago
- Views:
Transcription
1 HP MSR Router Series Layer 3 - IP Services Configuration Guide(V7) Part number: Software version: CMW710-R0106 Document version: 6PW
2 Legal and notice information Copyright 2014 Hewlett-Packard Development Company, L.P. No part of this documentation may be reproduced or transmitted in any form or by any means without prior written consent of Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. HEWLETT-PACKARD COMPANY MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Hewlett-Packard shall not be liable for errors contained herein or for incidental or consequential damages in connection with the furnishing, performance, or use of this material. The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein. i
3 Contents Legal and notice information i Configuring ARP 1 Overview 1 ARP message format 1 ARP operating mechanism 1 ARP table 2 Configuring a static ARP entry 3 Setting the maximum number of dynamic ARP entries for a device 4 Setting the maximum number of dynamic ARP entries for an interface 4 Setting the aging timer for dynamic ARP entries 5 Enabling dynamic ARP entry check 5 Enabling ARP logging 6 Displaying and maintaining ARP 6 ARP configuration example 7 Configuring gratuitous ARP 9 Overview 9 Gratuitous ARP packet learning 9 Periodic sending of gratuitous ARP packets 9 Configuration procedure 10 Enabling IP conflict notification 10 Configuring proxy ARP 12 Enabling common proxy ARP 12 Enabling local proxy ARP 12 Displaying proxy ARP 13 Common proxy ARP configuration example 13 Network requirements 13 Configuration procedure 13 Verifying the configuration 14 Configuring IP addressing 15 Overview 15 IP address classes 15 Special IP addresses 16 Subnetting and masking 16 Assigning an IP address to an interface 17 Configuration guidelines 17 Configuration procedure 17 Configuring IP unnumbered 17 Configuration guidelines 18 Configuration prerequisites 18 Configuration procedure 18 Displaying and maintaining IP addressing 18 Configuration examples 19 IP address configuration example 19 IP unnumbered configuration example 20 DHCP overview 22 DHCP address allocation 22 i
4 Allocation mechanisms 22 IP address allocation process 23 IP address lease extension 23 DHCP message format 24 DHCP options 25 Common DHCP options 25 Custom DHCP options 25 Protocols and standards 27 Configuring the DHCP server 29 Overview 29 DHCP address pool 29 IP address allocation sequence 31 DHCP server configuration task list 31 Configuring an address pool on the DHCP server 32 Configuration task list 32 Creating a DHCP address pool 32 Specifying IP address ranges for a DHCP address pool 32 Specifying gateways for the client 35 Specifying a domain name suffix for the client 36 Specifying DNS servers for the client 36 Specifying WINS servers and NetBIOS node type for the client 36 Specifying BIMS server information for the client 37 Specifying the TFTP server and boot file name for the client 37 Specifying a server for the DHCP client 38 Configuring Option 184 parameters for the client 38 Customizing DHCP options 39 Enabling DHCP 40 Enabling the DHCP server on an interface 40 Applying an address pool on an interface 41 Configuring IP address conflict detection 41 Enabling handling of Option Configuring DHCP server compatibility 42 Configuring the DHCP server to broadcast all responses 42 Configure the DHCP server to ignore BOOTP requests 42 Configuring the DHCP server to send BOOTP responses in RFC 1048 format 43 Setting the DSCP value for DHCP packets sent by the DHCP server 43 Displaying and maintaining the DHCP server 43 DHCP server configuration examples 44 Static IP address assignment configuration example 44 Dynamic IP address assignment configuration example 46 DHCP user class configuration example 47 Primary and secondary subnets configuration example 49 DHCP option customization configuration example 50 Troubleshooting DHCP server configuration 51 Symptom 51 Analysis 51 Solution 51 Configuring the DHCP relay agent 52 Overview 52 Operation 52 DHCP relay agent support for Option DHCP relay agent configuration task list 53 Enabling DHCP 54 ii
5 Enabling the DHCP relay agent on an interface 54 Specifying DHCP servers on a relay agent 54 Configuring the DHCP relay agent security functions 55 Enabling the DHCP relay agent to record relay entries 55 Enabling periodic refresh of dynamic relay entries 55 Enabling DHCP starvation attack protection 56 Configuring the DHCP relay agent to release an IP address 57 Configuring Option Setting the DSCP value for DHCP packets sent by the DHCP relay agent 58 Displaying and maintaining the DHCP relay agent 58 DHCP relay agent configuration examples 59 DHCP relay agent configuration example 59 Option 82 configuration example 60 Troubleshooting DHCP relay agent configuration 60 Symptom 60 Analysis 60 Solution 61 Configuring the DHCP client 62 Enabling the DHCP client on an interface 62 Configuring a DHCP client ID for an interface 62 Enabling duplicated address detection 63 Setting the DSCP value for DHCP packets sent by the DHCP client 63 Displaying and maintaining the DHCP client 64 DHCP client configuration example 64 Network requirements 64 Configuration procedure 64 Verifying the configuration 65 Configuring DHCP snooping 67 Overview 67 Application of trusted and untrusted ports 67 DHCP snooping support for Option Feature and hardware compatibility 69 DHCP snooping configuration task list 69 Configuring basic DHCP snooping 69 Configuring Option Saving DHCP snooping entries 71 Enabling DHCP starvation attack protection 72 Enabling DHCP-REQUEST attack protection 73 Setting the maximum number of DHCP snooping entries 73 Displaying and maintaining DHCP snooping 74 DHCP snooping configuration examples 74 Basic DHCP snooping configuration example 74 Option 82 configuration example 75 Configuring the BOOTP client 77 BOOTP application 77 Obtaining an IP address dynamically 77 Protocols and standards 77 Configuring an interface to use BOOTP for IP address acquisition 78 Displaying and maintaining BOOTP client 78 BOOTP client configuration example 78 Network requirements 78 Configuration procedure 78 iii
6 Configuring DNS 79 Overview 79 Static domain name resolution 79 Dynamic domain name resolution 79 DNS proxy 80 DNS spoofing 81 DNS configuration task list 82 Configuring the IPv4 DNS client 83 Configuring static domain name resolution 83 Configuring dynamic domain name resolution 83 Configuring the IPv6 DNS client 84 Configuring static domain name resolution 84 Configuring dynamic domain name resolution 85 Configuring the DNS proxy 86 Configuring DNS spoofing 86 Specifying the source interface for DNS packets 87 Configuring the DNS trusted interface 87 Setting the DSCP value for outgoing DNS packets 88 Displaying and maintaining IPv4 DNS 88 IPv4 DNS configuration examples 89 Static domain name resolution configuration example 89 Dynamic domain name resolution configuration example 89 DNS proxy configuration example 92 IPv6 DNS configuration examples 94 Static domain name resolution configuration example 94 Dynamic domain name resolution configuration example 94 DNS proxy configuration example 99 Troubleshooting IPv4 DNS configuration 100 Symptom 100 Solution 100 Troubleshooting IPv6 DNS configuration 100 Symptom 100 Solution 100 Configuring DDNS 102 Overview 102 DDNS application 102 DDNS client configuration task list 103 Configuring a DDNS policy 103 Configuration prerequisites 104 Configuration procedure 104 Applying the DDNS policy to an interface 105 Setting the DSCP value for outgoing DDNS packets 106 Displaying DDNS 106 DDNS configuration examples 106 DDNS configuration example with ( 106 DDNS configuration example with PeanutHull server 108 Configuring NAT 110 Terminology 110 NAT device 110 NAT interface 110 NAT address 111 NAT entry 111 Easy IP 111 iv
7 NAT types 111 Traditional NAT 111 Bidirectional NAT 111 Twice NAT 111 NAT hairpin 111 NAT translation control 112 NAT implementations 112 Static NAT 112 Dynamic NAT 112 NAT Server 113 NAT NAT entries 116 NAT session entry 116 EIM entry 116 NO-PAT entry 116 NAT444 entry 116 Using NAT with other features 117 NAT with multiple VPN instances 117 NAT with DNS mapping 117 NAT with ALG 118 NAT configuration task list 118 Configuring static NAT 118 Configuration prerequisites 119 Configuring outbound one-to-one static NAT 119 Configuring outbound net-to-net static NAT 119 Configuring inbound one-to-one static NAT 120 Configuring inbound net-to-net static NAT 120 Configuring dynamic NAT 121 Configuration restrictions and guidelines 121 Configuration prerequisites 121 Configuring outbound dynamic NAT 122 Configuring inbound dynamic NAT 122 Configuring NAT Server 123 Configuring common NAT Server 123 Configuring load sharing NAT Server 124 Configuring NAT Configuring static NAT Configuring dynamic NAT Configuring NAT with DNS mapping 127 Configuring NAT hairpin 127 Configuring NAT with ALG 127 Configuring NAT logging 128 Configuring NAT session logging 128 Configuring NAT444 user logging 128 Configuring NAT444 alarm logging 129 Displaying and maintaining NAT 130 NAT configuration examples 131 One-to-one static NAT for internal-to-external access 131 Outbound dynamic NAT for internal-to-external access (non-overlapping addresses) 132 Bidirectional NAT for internal-to-external access 135 NAT Server for external-to-internal access 138 NAT Server for external-to-internal access through domain name 141 Bidirectional NAT for external-to-internal access through NAT Server 144 NAT hairpin in C/S mode 147 v
8 NAT hairpin in P2P mode for access between internal users 150 Twice NAT for access between two VPNs with overlapping addresses 153 Load sharing NAT Server configuration example 155 NAT with DNS mapping configuration example 157 Static NAT444 configuration example 160 Dynamic NAT444 configuration example 162 Basic IP forwarding on the device 165 FIB table 165 Displaying FIB table entries 165 Configuring fast forwarding 167 Overview 167 Configuration procedure 167 Displaying and maintaining fast forwarding 167 Fast forwarding configuration example 168 Network requirements 168 Configuration procedure 168 Verifying the configuration 169 Configuring flow classification 170 Feature and hardware compatibility 170 Specifying a flow classification policy 170 Displaying the adjacency table 171 Configuring IRDP 173 Overview 173 IRDP operation 173 Basic concepts 173 Protocols and standards 174 Configuration procedure 174 IRDP configuration example 175 Network requirements 175 Configuration procedure 176 Verifying the configuration 176 Optimizing IP performance 178 Enabling an interface to receive and forward directed broadcasts destined for the directly connected network 178 Configuration procedure 178 Configuration example 179 Configuring MTU for an interface 179 Configuring TCP MSS for an interface 180 Configuring TCP path MTU discovery 180 Enabling TCP SYN Cookie 181 Configuring the TCP buffer size 182 Configuring TCP timers 182 Enabling sending ICMP error messages 182 Configuring rate limit for ICMP error messages 184 Specifying the source address for ICMP packets 184 Displaying and maintaining IP performance optimization 185 Configuring UDP helper 187 Overview 187 Configuration restrictions and guidelines 187 Configuring UDP helper to convert broadcast to unicast 187 vi
9 Configuring UDP helper to convert broadcast to multicast 188 Configuring UDP helper to convert multicast to broadcast or unicast 189 Displaying and maintaining UDP helper 190 UDP helper configuration examples 190 Configuring UDP helper to convert broadcast to unicast 190 Configuring UDP helper to convert broadcast to multicast 191 Configuring UDP helper to convert multicast to broadcast 192 Configuring basic IPv6 settings 194 Overview 194 IPv6 features 194 IPv6 addresses 195 IPv6 ND protocol 198 IPv6 path MTU discovery 200 IPv6 transition technologies 200 Dual stack 201 Tunneling 201 NAT-PT 201 6PE 201 Protocols and standards 201 IPv6 basics configuration task list 202 Assigning IPv6 addresses to interfaces 203 Configuring an IPv6 global unicast address 203 Configuring an IPv6 link-local address 205 Configuring an IPv6 anycast address 206 Configuring IPv6 ND 206 Configuring a static neighbor entry 207 Setting the maximum number of dynamic neighbor entries 207 Setting the aging timer for ND entries in stale state 208 Minimizing link-local ND entries 208 Setting the hop limit 208 Configuring parameters for RA messages 209 Configuring the maximum number of attempts to send an NS message for DAD 211 Enabling ND proxy 211 Configuring path MTU discovery 213 Configuring the interface MTU 213 Configuring a static path MTU for an IPv6 address 213 Configuring the aging time for dynamic path MTUs 214 Controlling sending ICMPv6 messages 214 Configuring the rate limit for ICMPv6 error messages 214 Enabling replying to multicast echo requests 215 Enabling sending ICMPv6 destination unreachable messages 215 Enabling sending ICMPv6 time exceeded messages 215 Enabling sending ICMPv6 redirect messages 216 Specifying the source address for ICMPv6 packets 216 Displaying and maintaining IPv6 basics 217 IPv6 basics configuration example 219 Network requirements 219 Configuration procedure 219 Verifying the configuration 220 Troubleshooting IPv6 basics configuration 223 Symptom 223 Solution 223 vii
10 DHCPv6 overview 224 DHCPv6 address/prefix assignment 224 Rapid assignment involving two messages 224 Assignment involving four messages 224 Address/prefix lease renewal 225 Stateless DHCPv6 226 Protocols and standards 226 Configuring the DHCPv6 server 227 Overview 227 IPv6 address assignment 227 IPv6 prefix assignment 227 Concepts 228 DHCPv6 address pool 229 IPv6 address/prefix allocation sequence 230 Configuration task list 230 Configuring IPv6 prefix assignment 231 Configuration guidelines 231 Configuration procedure 231 Configuring IPv6 address assignment 232 Configuration guidelines 232 Configuration procedure 232 Configuring network parameters assignment 233 Configuring network parameters in a DHCPv6 address pool 234 Configuring network parameters in a DHCPv6 option group 234 Configuring the DHCPv6 server on an interface 235 Configuration guidelines 235 Configuration procedure 235 Setting the DSCP value for DHCPv6 packets sent by the DHCPv6 server 236 Displaying and maintaining the DHCPv6 server 236 DHCPv6 server configuration examples 237 Dynamic IPv6 prefix assignment configuration example 237 Dynamic IPv6 address assignment configuration example 239 Configuring the DHCPv6 relay agent 241 Configuration guidelines 242 Configuration procedure 242 Displaying and maintaining the DHCPv6 relay agent 243 DHCPv6 relay agent configuration example 243 Network requirements 243 Configuration procedure 243 Verifying the configuration 244 Configuring the DHCPv6 client 245 Overview 245 Configuration restrictions and guidelines 245 DHCPv6 client configuration task list 245 Configuring IPv6 address acquisition 245 Configuring IPv6 prefix acquisition 246 Configuring stateless DHCPv6 246 Setting the DSCP value for DHCPv6 packets sent by the DHCPv6 client 247 Displaying and maintaining DHCPv6 client 247 DHCPv6 client configuration examples 247 IPv6 address acquisition configuration example 247 IPv6 prefix acquisition configuration example 249 Stateless DHCPv6 configuration example 251 viii
11 Configuring DHCPv6 snooping 253 Overview 253 Application of trusted and untrusted ports 253 Feature and hardware compatibility 254 HP implementation of Option 18 and Option Option 18 for DHCPv6 snooping 254 DHCPv6 snooping support for Option DHCPv6 snooping configuration task list 256 Configuring basic DHCPv6 snooping 256 Configuring Option 18 and Option Saving DHCPv6 snooping entries 257 Setting the maximum number of DHCPv6 snooping entries 258 Enabling DHCPv6-REQUEST check 258 Displaying and maintaining DHCPv6 snooping 259 DHCPv6 snooping configuration example 259 Network requirements 259 Configuration procedure 260 Verifying the configuration 260 Configuring IPv6 fast forwarding 261 Overview 261 Configuration procedure 261 Displaying and maintaining IPv6 fast forwarding 261 IPv6 fast forwarding configuration example 262 Network requirements 262 Configuration procedure 262 Verifying the configuration 263 Configuring tunneling 265 Overview 265 IPv6 over IPv4 tunneling 265 IPv4 over IPv4 tunneling 268 IPv4 over IPv6 tunneling 269 IPv6 over IPv6 tunneling 272 Protocols and standards 272 Tunneling configuration task list 273 Configuring a tunnel interface 273 Configuring an IPv6 over IPv4 manual tunnel 275 Configuration example 276 Configuring an automatic IPv4-compatible IPv6 tunnel 277 Configuration example 278 Configuring a 6to4 tunnel 279 6to4 tunnel configuration example 280 6to4 relay configuration example 282 Configuring an ISATAP tunnel 284 Configuration example 285 Configuring an IPv4 over IPv4 tunnel 287 Configuration example 288 Configuring an IPv4 over IPv6 manual tunnel 290 Configuration example 291 Configuring a DS-Lite tunnel 292 Configuration example 294 Configuring an IPv6 over IPv6 tunnel 295 Configuration example 297 Displaying and maintaining tunneling configuration 298 ix
12 Troubleshooting tunneling configuration 299 Symptom 299 Analysis 299 Solution 299 Configuring GRE 300 Overview 300 GRE encapsulation format 300 GRE tunnel operating principle 301 GRE security mechanisms 301 GRE application scenarios 302 Protocols and standards 303 Configuring a GRE over IPv4 tunnel 304 Configuring a GRE over IPv6 tunnel 306 Displaying and maintaining GRE 307 GRE configuration examples 308 GRE over IPv4 tunnel configuration example 308 GRE over IPv6 tunnel configuration example 310 Troubleshooting GRE 313 Symptom 313 Analysis 313 Solution 313 Configuring ADVPN 314 Overview 314 ADVPN structures 314 How ADVPN operates 316 ADVPN configuration task list 319 Configuring AAA 319 Configuring the VAM server 319 Creating an ADVPN domain 320 Enabling the VAM server 320 Configuring a pre-shared key for the VAM server 320 Configuring hub groups 321 Configuring the port number of the VAM server 323 Specifying authentication and encryption algorithms for the VAM server 323 Configuring an authentication method 324 Configuring keepalive parameters 324 Configuring the retry timer 325 Configuring the VAM client 325 Creating a VAM client 325 Enabling VAM clients 325 Specifying VAM servers 326 Specifying an ADVPN domain for a VAM client 326 Specifying a pre-shared key for a VAM client 326 Setting the retry timer and retry times for a VAM client 327 Setting the dumb timer for a VAM client 327 Configuring a username and password for a VAM client 327 Configuring an ADVPN tunnel interface 328 Configuring routing 330 Configuring IPsec for ADVPN tunnels 330 Displaying and maintaining ADVPN 330 ADVPN configuration examples 332 IPv4 full-mesh ADVPN configuration example 332 IPv6 full-mesh ADVPN configuration example 340 x
13 IPv4 hub-spoke ADVPN configuration example 348 IPv6 hub-spoke ADVPN configuration example 355 IPv4 multi-hub-group ADVPN configuration example 363 IPv6 multi-hub-group ADVPN configuration example 377 IPv4 full-mesh NAT traversal ADVPN configuration example 392 Support and other resources 401 Contacting HP 401 Subscription service 401 Related information 401 Documents 401 Websites 401 Conventions 402 Index 404 xi
14 Configuring ARP In this chapter, "MSR1000" refers to MSR "MSR2000" refers to MSR2003, MSR , MSR "MSR3000" collectively refers to MSR3012, MSR3024, MSR3044, MSR3064. "MSR4000" collectively refers to MSR4060 and MSR4080. Overview ARP resolves IP addresses into MAC addresses on Ethernet networks. ARP message format ARP uses two types of messages: ARP request and ARP reply. Figure 1 shows the format of ARP request/reply messages. Numbers in the figure refer to field lengths. Figure 1 ARP message format Hardware type Hardware address type. The value 1 represents Ethernet. Protocol type Type of the protocol address to be mapped. The hexadecimal value 0x0800 represents IP. Hardware address length and protocol address length Length, in bytes, of a hardware address and a protocol address. For an Ethernet address, the value of the hardware address length field is 6. For an IPv4 address, the value of the protocol address length field is 4. OP Operation code, which describes the type of ARP message. Value 1 represents an ARP request, and value 2 represents an ARP reply. Sender hardware address Hardware address of the device sending the message. Sender protocol address Protocol address of the device sending the message. Target hardware address Hardware address of the device to which the message is being sent. Target protocol address Protocol address of the device to which the message is being sent. ARP operating mechanism As shown in Figure 2, Host A and Host B are on the same subnet. Host A sends a packet to Host B as follows: 1
15 1. Host A looks through the ARP table for an ARP entry for Host B. If one entry is found, Host A uses the MAC address in the entry to encapsulate the IP packet into a data link layer frame. Then Host A sends the frame to Host B. 2. If Host A finds no entry for Host B, Host A buffers the packet and broadcasts an ARP request. The payload of the ARP request contains the following information: Sender IP address and sender MAC address Host A's IP address and MAC address. Target IP address Host B's IP address. Target MAC address An all-zero MAC address. All hosts on this subnet can receive the broadcast request, but only the requested host (Host B) processes the request. 3. Host B compares its own IP address with the target IP address in the ARP request. If they are the same, Host B: a. Adds the sender IP address and sender MAC address into its ARP table. b. Encapsulates its MAC address into an ARP reply. c. Unicasts the ARP reply to Host A. 4. After receiving the ARP reply, Host A: a. Adds the MAC address of Host B into its ARP table. b. Encapsulates the MAC address into the packet and sends the packet to Host B. Figure 2 ARP address resolution process ARP table If Host A and Host B are on different subnets, Host A sends a packet to Host B as follows: 5. Host A broadcasts an ARP request where the target IP address is the IP address of the gateway. 6. The gateway responds with its MAC address in an ARP reply to Host A. 7. Host A uses the gateway's MAC address to encapsulate the packet, and then sends the packet to the gateway. 8. If the gateway has an ARP entry for Host B, it forwards the packet to Host B directly. If not, the gateway broadcasts an ARP request, in which the target IP address is the IP address of Host B. 9. After the gateway gets the MAC address of Host B, it sends the packet to Host B. An ARP table stores dynamic and static ARP entries. 2
16 Dynamic ARP entry Static ARP entry ARP automatically creates and updates dynamic entries. A dynamic ARP entry is removed when its aging timer expires or the output interface goes down. In addition, a dynamic ARP entry can be overwritten by a static ARP entry. A static ARP entry is manually configured and maintained. It does not age out and cannot be overwritten by any dynamic ARP entry. Static ARP entries protect communication between devices because attack packets cannot modify the IP-to-MAC mapping in a static ARP entry. The device supports the following types of static ARP entries: Long static ARP entry It contains the IP address, MAC address, VLAN, and output interface. It is directly used for forwarding packets. Short static ARP entry It contains only the IP address and MAC address. If the output interface is a Layer 3 Ethernet interface, the short ARP entry can be directly used to forward packets. If the output interface is a VLAN interface, the device first sends an ARP request whose target IP address is the IP address of the short entry. If the sender IP and MAC addresses in the received ARP reply match the short static ARP entry, the device performs the following tasks: Adds the interface that received the ARP reply to the short static ARP entry. Uses the resolved short static ARP entry to forward IP packets. To communicate with a host by using a fixed IP-to-MAC mapping, configure a short static ARP entry on the device. To communicate with a host by using a fixed IP-to-MAC mapping through an interface in a VLAN, configure a long static ARP entry on the device. Configuring a static ARP entry A static ARP entry is effective when the device functions correctly. If a VLAN or VLAN interface is deleted, any long static ARP entry in the VLAN is deleted, and any resolved short static ARP entry in the VLAN becomes unresolved. A resolved short static ARP entry becomes unresolved upon certain events. For example, it becomes unresolved when the resolved output interface goes down. A long static ARP entry is ineffective in either of the following situations: The IP address in the entry conflicts with a local IP address. No local interface has an IP address in the same subnet as the IP address in the ARP entry. Follow these guidelines when you configure a static ARP entry: The vlan-id argument must be the ID of an existing VLAN where the ARP entry resides. The specified Ethernet interface must belong to that VLAN. The VLAN interface of the VLAN must be created. The IP address of the VLAN interface of the VLAN specified by the vlan-id argument must belong to the same subnet as the IP address specified by the ip-address argument. To configure a static ARP entry: 3
17 Step Command Remarks 1. Enter system view. system-view N/A 2. Configure a static ARP entry. Configure a long static ARP entry: arp static ip-address mac-address vlan-id interface-type interface-number [ vpn-instance vpn-instance-name ] Configure a short static ARP entry: arp static ip-address mac-address [ vpn-instance vpn-instance-name ] Use either command. By default, no static ARP entry is configured. Setting the maximum number of dynamic ARP entries for a device A device can dynamically learn ARP entries. To prevent a device from holding too many ARP entries, you can set the maximum number of dynamic ARP entries that the device can learn. When the maximum number is reached, the device stops learning ARP entries. If you set a value lower than the number of existing dynamic ARP entries, the device does not remove the existing entries unless they are aged out. The device also stops learning ARP entries until the number of dynamic ARP entries is below the configured value. To set the maximum number of dynamic ARP entries for a device: Step Command Remarks 3. Enter system view. system-view N/A 4. Set the maximum number of dynamic ARP entries for the device. arp max-learning-number number By default: An MSR1000, MSR2000 or MSR3000 router can learn a maximum of 4096 dynamic ARP entries. An MSR4000 router can learn a maximum of dynamic ARP entries. If the value for the number argument is set to 0, the device is disabled from learning dynamic ARP entries. Setting the maximum number of dynamic ARP entries for an interface An interface can dynamically learn ARP entries. To prevent an interface from holding too many ARP entries, you can set the maximum number of dynamic ARP entries that the interface can learn. When the maximum number is reached, the interface stops learning ARP entries. The Layer 2 interface can learn an ARP entry only when both its maximum number and the VLAN interface's maximum number are not reached. 4
18 To set the maximum number of dynamic ARP entries for an interface: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Set the maximum number of dynamic ARP entries for the interface. interface interface-type interface-number arp max-learning-num number N/A By default: On the MSR1000, MSR2000 or MSR3000 routers, an interface can learn a maximum of 4096 dynamic ARP entries. On the MSR4000 routers, an interface can learn a maximum of dynamic ARP entries. If the value of the number argument is set to 0, the interface is disabled from learning dynamic ARP entries. Setting the aging timer for dynamic ARP entries Each dynamic ARP entry in the ARP table has a limited lifetime, called an aging timer. The aging timer of a dynamic ARP entry is reset each time the dynamic ARP entry is updated. A dynamic ARP entry that is not updated before its aging timer expires is deleted from the ARP table. To set the aging timer for dynamic ARP entries: Step Command Remarks 1. Enter system view. system-view N/A 2. Set the aging timer for dynamic ARP entries. arp timer aging aging-time By default, the aging time for dynamic ARP entries is 20 minutes. Enabling dynamic ARP entry check The dynamic ARP entry check function disables the device from supporting dynamic ARP entries that contain multicast MAC addresses. The device cannot learn dynamic ARP entries containing multicast MAC addresses, and you cannot manually add static ARP entries containing multicast MAC addresses. When dynamic ARP entry check is disabled, ARP entries containing multicast MAC addresses are supported. The device can learn dynamic ARP entries containing multicast MAC addresses obtained from the ARP packets sourced from a unicast MAC address. You can also manually add static ARP entries containing multicast MAC addresses. To enable dynamic ARP entry check: Step Command Remarks 1. Enter system view. system-view N/A 5
19 Step Command Remarks 2. Enable dynamic ARP entry check. arp check enable By default, dynamic ARP entry check is enabled. Enabling ARP logging This function enables a device to log ARP events when ARP cannot resolve IP addresses correctly. The device can log the following events: On a proxy ARP-disabled interface, the target IP address of a received ARP packet is not one of the following IP addresses: The IP address of the receiving interface. The virtual IP address of the VRRP group. The NATed external address. The sender IP address of a received ARP reply conflicts with one of the following IP addresses: The IP address of the receiving interface. The virtual IP address of the VRRP group. The NATed external address. The device sends ARP log messages to the information center. You can use the info-center source command to specify the log output rules for the information center. For more information about information center, see Network Management and Monitoring Configuration Guide. To enable the ARP logging function: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable the ARP logging function. arp check log enable By default, ARP logging is disabled. Displaying and maintaining ARP IMPORTANT: Clearing ARP entries from the ARP table might cause communication failures. Make sure the entries to be cleared do not affect current communications. Execute display commands in any view and reset commands in user view. Task Display ARP entries (MSR1000/MSR2000/MSR3000). Display ARP entries (MSR4000). Command display arp [ [ all dynamic static ] vlan vlan-id interface interface-type interface-number ] [ count verbose ] display arp [ [ all dynamic static ] [ slot slot-number ] vlan vlan-id interface interface-type interface-number ] [ count verbose ] 6
20 Task Display the ARP entry for an IP address (MSR1000/MSR2000/MSR3000). Display the ARP entry for an IP address (MSR4000). Command display arp ip-address [ verbose ] display arp ip-address [ slot slot-number ] [ verbose ] Display the ARP entries for a VPN instance. display arp vpn-instance vpn-instance-name [ count ] Display the aging timer of dynamic ARP entries. Clear ARP entries from the ARP table (MSR1000/MSR2000/MSR3000). Clear ARP entries from the ARP table (MSR4000). display arp timer aging reset arp { all dynamic interface interface-type interface-number static } reset arp { all dynamic interface interface-type interface-number slot slot-number static } ARP configuration example Network requirements As shown in Figure 3, hosts are connected to Router B, which is connected to Router A through interface GigabitEthernet 2/1/1 in VLAN 10. To ensure secure communications between the routers, configure a static ARP entry for Router A on Router B. Figure 3 Network diagram Configuration procedure # Create VLAN 10. <RouterB> system-view [RouterB] vlan 10 [RouterB-vlan10] quit # Add interface GigabitEthernet 2/1/1 to VLAN 10. [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] port access vlan 10 7
21 [RouterB-GigabitEthernet2/1/1] quit # Create VLAN-interface 10 and configure its IP address. [RouterB] interface vlan-interface 10 [RouterB-vlan-interface10] ip address [RouterB-vlan-interface10] quit # Configure a static ARP entry that has IP address , MAC address 00e0-fc , and output interface GigabitEthernet 2/1/1 in VLAN 10. [RouterB] arp static e0-fc gigabitethernet 2/1/1 # Display information about static ARP entries. [RouterB] display arp static Type: S-Static D-Dynamic O-Openflow M-Multiport I-Invalid IP address MAC address VLAN Interface Aging Type e0-fc GE2/1/1 N/A S 8
22 Configuring gratuitous ARP Overview In a gratuitous ARP packet, the sender IP address and the target IP address are the IP address of the sending device. A device sends a gratuitous ARP packet for either of the following purposes: Determine whether its IP address is already used by another device. If the IP address is already used, the device is informed of the conflict by an ARP reply. Inform other devices of a MAC address change. Gratuitous ARP packet learning This feature enables a device to create or update ARP entries by using the sender IP and MAC addresses in received gratuitous ARP packets. When this feature is disabled, the device uses received gratuitous ARP packets to update existing ARP entries only. ARP entries are not created based on the received gratuitous ARP packets, which saves ARP table space. Periodic sending of gratuitous ARP packets Enabling a device to periodically send gratuitous ARP packets helps downstream devices update ARP entries or MAC entries in a timely manner. This feature can implement the following functions: Prevent gateway spoofing. Gateway spoofing occurs when an attacker uses the gateway address to send gratuitous ARP packets to the hosts on a network. The traffic destined for the gateway from the hosts is sent to the attacker instead. As a result, the hosts cannot access the external network. To prevent such gateway spoofing attacks, you can enable the gateway to send gratuitous ARP packets containing its primary IP address and manually configured secondary IP addresses at intervals. Hosts can then learn correct gateway address information. Prevent ARP entries from aging out. If network traffic is heavy or if the host CPU usage is high, received ARP packets can be discarded or are not promptly processed. Eventually, the dynamic ARP entries on the receiving host age out. The traffic between the host and the corresponding devices is interrupted until the host re-creates the ARP entries. To prevent this problem, you can enable the gateway to send gratuitous ARP packets periodically. The gratuitous ARP packets contain the gateway's primary IP address or one of its manually configured secondary IP addresses, so the receiving hosts can update ARP entries in a timely manner. Prevent the virtual IP address of a VRRP group from being used by a host. 9
23 The master router of a VRRP group can periodically send gratuitous ARP packets to the hosts on the local network. The hosts can then update local ARP entries and avoid using the virtual IP address of the VRRP group. The sender MAC address in the gratuitous ARP packet is the virtual MAC address of the virtual router. For more information about VRRP, see High Availability Configuration Guide. Configuration procedure The following conditions apply to the gratuitous ARP configuration: You can enable periodic sending of gratuitous ARP packets on up to 1024 interfaces. Periodic sending of gratuitous ARP packets takes effect only when the link of the enabled interface goes up and an IP address has been assigned to the interface. If you change the interval for sending gratuitous ARP packets, the configuration is effective at the next sending interval. The frequency of sending gratuitous ARP packets might be much lower than the sending interval set by the user in any of the following circumstances: This function is enabled on multiple interfaces. Each interface is configured with multiple secondary IP addresses. A small sending interval is configured when the previous two conditions exist. To configure gratuitous ARP: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable learning of gratuitous ARP packets. 3. Enable the device to send gratuitous ARP packets upon receiving ARP requests whose sender IP address belongs to a different subnet. gratuitous-arp-learning enable gratuitous-arp-sending enable By default, learning of gratuitous ARP packets is enabled. By default, a device does not send gratuitous ARP packets upon receiving ARP requests whose sender IP address belongs to a different subnet. 4. Enter interface view. 5. Enable periodic sending of gratuitous ARP packets and set the sending interval. interface interface-type interface-number arp send-gratuitous-arp [ interval milliseconds ] N/A By default, periodic sending of gratuitous ARP packets is disabled. Enabling IP conflict notification By default, if the sender IP address of an ARP packet is being used by the receiving device, the receiving device sends a gratuitous ARP request. It also displays an error message after it receives an ARP reply about the conflict. You can use this command to enable the device to display error messages before sending a gratuitous ARP reply or request for conflict confirmation. 10
24 To enable IP conflict notification: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable IP conflict notification. arp ip-conflict log prompt By default, IP conflict notification is disabled. 11
25 Configuring proxy ARP Proxy ARP enables a device on one network to answer ARP requests for an IP address on another network. With proxy ARP, hosts in different broadcast domains can communicate with each other as they do in the same broadcast domain. Proxy ARP includes common proxy ARP and local proxy ARP. Common proxy ARP Allows communication between hosts that connect to different Layer 3 interfaces and reside in different broadcast domains. Local proxy ARP Allows communication between hosts that connect to the same Layer 3 interface and reside in different broadcast domains. Enabling common proxy ARP You can enable common proxy ARP in VLAN interface view, Layer 3 Ethernet interface view, Layer 3 Ethernet subinterface view, and Layer 3 aggregate interface view. To enable common proxy ARP: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. interface interface-type interface-number N/A 3. Enable common proxy ARP. proxy-arp enable By default, common proxy ARP is disabled. Enabling local proxy ARP You can enable local proxy ARP in VLAN interface view, Layer 3 Ethernet interface view, Layer 3 Ethernet subinterface view, and Layer 3 aggregate interface view. To enable local proxy ARP: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Enable local proxy ARP. interface interface-type interface-number local-proxy-arp enable [ ip-range startip to endip ] N/A By default, local proxy ARP is disabled. 12
26 Displaying proxy ARP Execute display commands in any view. Task Command Display common proxy ARP status. display proxy-arp [ interface interface-type interface-number ] Display local proxy ARP status. display local-proxy-arp [ interface interface-type interface-number ] Common proxy ARP configuration example Network requirements As shown in Figure 4, Host A and Host D have the same prefix and mask, but they are located on different subnets. No default gateway is configured on Host A and Host D. Configure common proxy ARP on the router to enable communication between Host A and Host D. Figure 4 Network diagram Configuration procedure # Configure the IP address of interface GigabitEthernet 2/1/2. <Router> system-view [Router] interface gigabitethernet 2/1/2 [Router-GigabitEthernet2/1/2] ip address # Enable common proxy ARP on interface GigabitEthernet 2/1/2. [Router-GigabitEthernet2/1/2] proxy-arp enable [Router-GigabitEthernet2/1/2] quit 13
27 # Configure the IP address of interface GigabitEthernet 2/1/1. [Router] interface gigabitethernet 2/1/1 [Router-GigabitEthernet2/1/1] ip address # Enable common proxy ARP on interface GigabitEthernet 2/1/1. [Router-GigabitEthernet2/1/1] proxy-arp enable [Router-GigabitEthernet2/1/1] quit Verifying the configuration # Verify that Host A and Host D can ping each other. 14
28 Configuring IP addressing The IP addresses in this chapter refer to IPv4 addresses unless otherwise specified. This chapter describes IP addressing basic and manual IP address assignment for interfaces. Dynamic IP address assignment (BOOTP and DHCP) and PPP address negotiation are beyond the scope of this chapter. Overview This section describes the IP addressing basics. IP addressing uses a 32-bit address to identify each host on an IPv4 network. To make addresses easier to read, they are written in dotted decimal notation, each address being four octets in length. For example, address in binary is written as IP address classes Each IP address breaks down into the following sections: Net ID Identifies a network. The first several bits of a net ID, known as the class field or class bits, identify the class of the IP address. Host ID Identifies a host on a network. IP addresses are divided into five classes, as shown in Figure 5. The shaded areas represent the address class. The first three classes are most commonly used. Figure 5 IP address classes Table 1 IP address classes and ranges Class Address range Remarks A to The IP address is used by a host at startup for temporary communication. This address is never a valid destination address. Addresses starting with 127 are reserved for loopback test. Packets destined to these addresses are processed locally as input packets rather than sent to the link. B to N/A 15
29 Class Address range Remarks C to N/A D to Multicast addresses. E to Reserved for future use, except for the broadcast address Special IP addresses The following IP addresses are for special use and cannot be used as host IP addresses: IP address with an all-zero net ID Identifies a host on the local network. For example, IP address indicates the host with a host ID of 16 on the local network. IP address with an all-zero host ID Identifies a network. IP address with an all-one host ID Identifies a directed broadcast address. For example, a packet with the destination address of will be broadcast to all the hosts on the network Subnetting and masking Subnetting divides a network into smaller networks called subnets by using some bits of the host ID to create a subnet ID. Masking identifies the boundary between the host ID and the combination of net ID and subnet ID. Each subnet mask comprises 32 bits that correspond to the bits in an IP address. In a subnet mask, consecutive ones represent the net ID and subnet ID, and consecutive zeros represent the host ID. Before being subnetted, Class A, B, and C networks use these default masks (also called natural masks): , , and , respectively. Figure 6 Subnetting a Class B network Subnetting increases the number of addresses that cannot be assigned to hosts. Therefore, using subnets means accommodating fewer hosts. For example, a Class B network without subnetting can accommodate 1022 more hosts than the same network subnetted into 512 subnets. Without subnetting hosts (2 16 2). (The two deducted addresses are the broadcast address, which has an all-one host ID, and the network address, which has an all-zero host ID.) With subnetting Using the first nine bits of the host-id for subnetting provides 512 (2 9 ) subnets. However, only seven bits remain available for the host ID. This allows 126 (2 7 2) hosts in each subnet, a total of hosts ( ). 16
30 Assigning an IP address to an interface An interface must have an IP address to communicate with other hosts. You can either manually assign an IP address to an interface, or configure the interface to obtain an IP address through BOOTP, DHCP, or PPP address negotiation. If you change the way an interface obtains an IP address, the new IP address will overwrite the previous address. An interface can have one primary address and multiple secondary addresses. Typically, you need to configure a primary IP address for an interface. If the interface connects to multiple subnets, configure primary and secondary IP addresses on the interface so the subnets can communicate with each other through the interface. Configuration guidelines Follow these guidelines when you assign an IP address to an interface: An interface can have only one primary IP address. A newly configured primary IP address overwrites the previous one. You cannot assign secondary IP addresses to an interface that obtains an IP address through BOOTP, DHCP, PPP address negotiation, or IP unnumbered. The primary and secondary IP addresses assigned to the interface can be located on the same network segment. Different interfaces on your device must reside on different network segments. Configuration procedure To assign an IP address to an interface: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Assign an IP address to the interface. interface interface-type interface-number ip address ip-address { mask mask-length } [ sub ] N/A By default, no IP address is assigned to the interface. Configuring IP unnumbered Typically, you assign an IP address to an interface either manually or through DHCP. If the IP addresses are not enough, or the interface is used only occasionally, you can configure an interface to borrow an IP address from other interfaces. This is called IP unnumbered, and the interface borrowing the IP address is called IP unnumbered interface. You can use IP unnumbered to save IP addresses either when available IP addresses are inadequate or when an interface is brought up only for occasional use. 17
31 Configuration guidelines Follow these guidelines when you configure IP unnumbered: Layer 3 Ethernet interfaces and loopback interfaces cannot borrow IP addresses of other interfaces, but other interfaces can borrow IP addresses of these interfaces. An interface cannot borrow an IP address from an unnumbered interface. Multiple interfaces can use the same unnumbered IP address. If an interface has multiple manually configured IP addresses, only the manually configured primary IP address can be borrowed. Configuration prerequisites Assign an IP address to the interface from which you want to borrow the IP address. Alternatively, you can configure the interface to obtain one through BOOTP, DHCP, or PPP address negotiation. Configuration procedure To configure IP unnumbered on an interface: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Specify the interface to borrow the IP address of the specified interface. interface interface-type interface-number ip address unnumbered interface interface-type interface-number N/A By default, the interface does not borrow IP addresses from other interfaces. A dynamic routing protocol cannot be enabled on the interface where IP unnumbered is configured. To enable the interface to communicate with other devices, configure a static route to the peer device on the interface. For more configuration information, see "IP unnumbered configuration example." Displaying and maintaining IP addressing Execute display commands in any view. Task Display IP configuration and statistics for the specified or all Layer 3 interfaces. Display brief IP configuration information for the specified or all Layer 3 interfaces. Command display ip interface [ interface-type interface-number ] display ip interface [ interface-type [ interface-number ] ] brief [ description ] 18
32 Configuration examples IP address configuration example Network requirements As shown in Figure 7, GigabitEthernet 2/1/1 on the router is connected to a LAN comprising two segments: /24 and /24. To enable the hosts on the two network segments to communicate with the external network through the router, and to enable the hosts on the LAN to communicate with each other: Assign a primary IP address and a secondary IP address to GigabitEthernet 2/1/1 on the router. Set the primary IP address of the router as the gateway address of the PCs on subnet /24. Set the secondary IP address of the router as the gateway address of the PCs on subnet /24. Figure 7 Network diagram Configuration procedure # Assign a primary IP address and a secondary IP address to GigabitEthernet 2/1/1. <Router> system-view [Router] interface gigabitethernet 2/1/1 [Router-GigabitEthernet2/1/1] ip address [Router-GigabitEthernet2/1/1] ip address sub # Set the gateway address to on the PCs attached to subnet /24, and to on the PCs attached to subnet /24. Verifying the configuration # Verify the connectivity between a host on subnet /24 and the router. <Router> ping Ping ( ): 56 data bytes, press CTRL_C to break 56 bytes from : icmp_seq=0 ttl=128 time=7.000 ms 19
33 56 bytes from : icmp_seq=1 ttl=128 time=2.000 ms 56 bytes from : icmp_seq=2 ttl=128 time=1.000 ms 56 bytes from : icmp_seq=3 ttl=128 time=1.000 ms 56 bytes from : icmp_seq=4 ttl=128 time=2.000 ms --- Ping statistics for packet(s) transmitted, 5 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 1.000/2.600/7.000/2.245 ms # Verify the connectivity between a host on subnet /24 and the router. <Router> ping Ping ( ): 56 data bytes, press CTRL_C to break 56 bytes from : icmp_seq=0 ttl=128 time=2.000 ms 56 bytes from : icmp_seq=1 ttl=128 time=7.000 ms 56 bytes from : icmp_seq=2 ttl=128 time=1.000 ms 56 bytes from : icmp_seq=3 ttl=128 time=2.000 ms 56 bytes from : icmp_seq=4 ttl=128 time=1.000 ms --- Ping statistics for packet(s) transmitted, 5 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 1.000/2.600/7.000/2.245 ms # Verify the connectivity between a host on subnet /24 and a host on subnet /24. The ping operation succeeds. IP unnumbered configuration example Network requirements As shown in Figure 8, two routers on an intranet are connected to each other through serial interfaces across a Digital Data Network. Each router connects to a LAN through an Ethernet interface. To save IP addresses, configure the serial interfaces to borrow IP addresses from the Ethernet interfaces. Figure 8 Network diagram DDN Router A S2/1/1 S2/1/1 Router B GE2/1/ /24 GE2/1/ /24 Configuration procedure 1. Configure Router A: # Assign a primary IP address to GigabitEthernet 2/1/1. 20
34 <RouterA> system-view [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ip address [RouterA-GigabitEthernet2/1/1] quit # Configure Serial 2/1/1 to borrow an IP address from GigabitEthernet 2/1/1. [RouterA] interface serial 2/1/1 [RouterA-Serial2/1/1] ip address unnumbered interface gigabitethernet 2/1/1 [RouterA-Serial2/1/1] quit # Configure a static route to the subnet attached to Router B, specifying Serial 2/1/1 as the outgoing interface. [RouterA] ip route-static serial 2/1/1 2. Configure Router B: # Assign a primary IP address to GigabitEthernet 2/1/1. <RouterB> system-view [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] ip address [RouterB-GigabitEthernet2/1/1] quit # Configure interface Serial 2/1/1 to borrow an IP address from GigabitEthernet 2/1/1. [RouterB] interface serial 2/1/1 [RouterB-Serial2/1/1] ip address unnumbered interface gigabitethernet 2/1/1 [RouterB-Serial2/1/1] quit # Configure a static route to the subnet attached to Router A, specifying Serial 2/1/1 as the outgoing interface. [RouterB] ip route-static serial 2/1/1 Verifying the configuration # Verify that a host attached to Router B can be pinged from Router A. [RouterA] ping Ping ( ): 56 data bytes, press CTRL_C to break 56 bytes from : icmp_seq=0 ttl=128 time=7.000 ms 56 bytes from : icmp_seq=1 ttl=128 time=2.000 ms 56 bytes from : icmp_seq=2 ttl=128 time=1.000 ms 56 bytes from : icmp_seq=3 ttl=128 time=1.000 ms 56 bytes from : icmp_seq=4 ttl=128 time=2.000 ms --- Ping statistics for packet(s) transmitted, 5 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 1.000/2.600/7.000/2.245 ms 21
35 DHCP overview The Dynamic Host Configuration Protocol (DHCP) provides a framework to assign configuration information to network devices. Figure 9 shows a typical DHCP application scenario where the DHCP clients and the DHCP server reside on the same subnet. The DHCP clients can also obtain configuration parameters from a DHCP server on another subnet through a DHCP relay agent. For more information about the DHCP relay agent, see "Configuring the DHCP relay agent." Figure 9 A typical DHCP application DHCP address allocation Allocation mechanisms DHCP supports the following allocation mechanisms: Static allocation The network administrator assigns an IP address to a client, such as a WWW server, and DHCP conveys the assigned address to the client. Automatic allocation DHCP assigns a permanent IP address to a client. Dynamic allocation DHCP assigns an IP address to a client for a limited period of time, which is called a lease. Most DHCP clients obtain their addresses in this way. 22
36 IP address allocation process Figure 10 IP address allocation process 1. The client broadcasts a DHCP-DISCOVER message to locate a DHCP server. 2. Each DHCP server offers configuration parameters such as an IP address to the client in a DHCP-OFFER message. The sending mode of the DHCP-OFFER is determined by the flag field in the DHCP-DISCOVER message. For more information, see "DHCP message format." 3. If several DHCP servers send offers to the client, the client accepts the first received offer, and broadcasts it in a DHCP-REQUEST message to formally request the IP address. (IP addresses offered by other DHCP servers can be assigned to other clients.) 4. All DHCP servers receive the DHCP-REQUEST message. However, only the server selected by the client does one of the following operations: Returns a DHCP-ACK message to confirm that the IP address has been allocated to the client. Returns a DHCP-NAK message to deny the IP address allocation. After the client receives the DHCP-ACK message, it broadcasts a gratuitous ARP packet to verify whether the IP address assigned by the server is already in use. If the client receives no response within the specified time, the client uses the assigned IP address. Otherwise, the client sends a DHCP-DECLINE message to the server to request an IP address again. IP address lease extension A dynamically assigned IP address has a lease. When the lease expires, the IP address is reclaimed by the DHCP server. To continue using the IP address, the client must extend the lease duration. When about half of the lease duration elapses, the DHCP client unicasts a DHCP-REQUEST to the DHCP server to extend the lease. Depending on the availability of the IP address, the DHCP server returns one of the following messages: A DHCP-ACK unicast confirming that the client's lease duration has been extended. A DHCP-NAK unicast denying the request. If the client receives no reply, it broadcasts another DHCP-REQUEST message for lease extension when about seven-eighths of the lease duration elapses. Again, depending on the availability of the IP address, the DHCP server returns either a DHCP-ACK unicast confirming that the client's lease duration has been extended, or a DHCP-NAK unicast denying the request. 23
37 DHCP message format Figure 11 shows the DHCP message format. DHCP uses some of the fields in significantly different ways. The numbers in parentheses indicate the size of each field in bytes. Figure 11 DHCP message format op Message type defined in options field. 1 = REQUEST, 2 = REPLY htype, hlen Hardware address type and length of the DHCP client. hops Number of relay agents a request message traveled. xid Transaction ID, a random number chosen by the client to identify an IP address allocation. secs Filled in by the client, the number of seconds elapsed since the client began address acquisition or renewal process. This field is reserved and set to 0. flags The leftmost bit is defined as the BROADCAST (B) flag. If this flag is set to 0, the DHCP server sent a reply back by unicast. If this flag is set to 1, the DHCP server sent a reply back by broadcast. The remaining bits of the flags field are reserved for future use. ciaddr Client IP address if the client has an IP address that is valid and usable. Otherwise, set to zero. (The client does not use this field to request a specific IP address to lease.) yiaddr Your IP address. It is an IP address assigned by the DHCP server to the DHCP client. siaddr Server IP address, from which the client obtained configuration parameters. giaddr Gateway IP address. It is the IP address of the first relay agent to which a request message travels. chaddr Client hardware address. sname Server host name, from which the client obtained configuration parameters. file Boot file (also called system software image) name and path information, defined by the server to the client. options Optional parameters field that is variable in length, which includes the message type, lease duration, subnet mask, domain name server IP address, and WINS IP address. 24
38 DHCP options DHCP extends the message format as an extension to BOOTP for compatibility. DHCP uses the options field to carry information for dynamic address allocation and provide additional configuration information to clients. Figure 12 DHCP option format Common DHCP options The following are common DHCP options: Option 3 Router option. It specifies the gateway address. Option 6 DNS server option. It specifies the DNS server's IP address. Option 33 Static route option. It specifies a list of classful static routes (the destination network addresses in these static routes are classful) that a client should add into its routing table. If both Option 33 and Option 121 exist, Option 33 is ignored. Option 51 IP address lease option. Option 53 DHCP message type option. It identifies the type of the DHCP message. Option 55 Parameter request list option. It is used by a DHCP client to request specified configuration parameters. The option includes values that correspond to the parameters requested by the client. Option 60 Vendor class identifier option. It is used by a DHCP client to identify its vendor, and by a DHCP server to distinguish DHCP clients by vendor class and assign specific IP addresses to the DHCP clients. Option 66 TFTP server name option. It specifies a TFTP server to be assigned to the client. Option 67 Boot file name option. It specifies the boot file name to be assigned to the client. Option 121 Classless route option. It specifies a list of classless static routes (the destination network addresses in these static routes are classless) that the requesting client should add to its routing table. If both Option 33 and Option 121 exist, Option 33 is ignored. Option 150 TFTP server IP address option. It specifies the TFTP server IP address to be assigned to the client. For more information about DHCP options, see RFC 2132 and RFC Custom DHCP options Some options, such as Option 43, Option 82, and Option 184, have no standard definitions in RFC Vendor-specific option (Option 43) DHCP servers and clients use Option 43 to exchange vendor-specific configuration information. 25
39 The DHCP client can obtain the following information through Option 43: ACS parameters, including the ACS URL, username, and password. Service provider identifier, which is acquired by the CPE from the DHCP server and sent to the ACS for selecting vender-specific configurations and parameters. For more information about CPE and ACS, see Network Management and Monitoring Configuration Guide. PXE server address, which is used to obtain the boot file or other control information from the PXE server. AC address, which is used by an AP to obtain the boot file or other control information from the AC. 1. Format of Option 43: Figure 13 Option 43 format Network configuration parameters are carried in different sub-options of Option 43 as shown in Figure 13. Sub-option type The field value can be 0x01 (ACS parameter sub-option), 0x02 (service provider identifier sub-option), or 0x80 (PXE server address sub-option). Sub-option length Excludes the sub-option type and sub-option length fields. Sub-option value The value format varies by sub-option. 2. Sub-option value field formats: ACS parameter sub-option value field Includes the ACS URL, username, and password separated by spaces (0x20) as shown in Figure 14. Figure 14 ACS parameter sub-option value field Service provider identifier sub-option value field Includes the service provider identifier. PXE server address sub-option value field Includes the PXE server type that can only be 0, the server number that indicates the number of PXE servers contained in the sub-option and server IP addresses, as shown in Figure 15. Figure 15 PXE server address sub-option value field 26
40 Relay agent option (Option 82) Option 184 Option 82 is the relay agent option. It records the location information about the DHCP client. When a DHCP relay agent or DHCP snooping device receives a client's request, it adds Option 82 to the request message and sends it to the server. The administrator can use Option 82 to locate the DHCP client and further implement security control and accounting. The DHCP server can use Option 82 to provide individual configuration policies for the clients. Option 82 can include up to 255 sub-options and must have one sub-option at least. Option 82 supports two sub-options: sub-option 1 (Circuit ID) and sub-option 2 (Remote ID). Option 82 has no standard definition. Its padding formats vary by vendor. Circuit ID has the following padding formats: String padding format Includes a character string specified by the user. Normal padding format Includes the VLAN ID and interface number of the interface that receives the client's request. Verbose padding format Includes the access node identifier specified by the user, and the VLAN ID, interface number and interface type of the interface that receives the client's request. Remote ID has the following padding formats: String padding format Includes a character string specified by the user. Normal padding format Includes the MAC address of the DHCP relay agent interface or the MAC address of the DHCP snooping device that receives the client's request. Sysname padding format Includes the device name of the device. To set the device name for the device, use the sysname command in system view. Option 184 is a reserved option. You can define the parameters in the option as needed. The device supports Option 184 carrying voice related parameters, so a DHCP client with voice functions can get voice parameters from the DHCP server. Option 184 has the following sub-options: Sub-option 1 Specifies the IP address of the primary network calling processor, which serves as the network calling control source and provides program download services. For Option 184, you must define sub-option 1 to make other sub-options take effect. Sub-option 2 Specifies the IP address of the backup network calling processor. DHCP clients contact the backup processor when the primary one is unreachable. Sub-option 3 Specifies the voice VLAN ID and the result whether or not the DHCP client takes this VLAN as the voice VLAN. Sub-option 4 Specifies the failover route that includes the IP address and the number of the target user. A SIP VoIP user uses this IP address and number to directly establish a connection to the target SIP user when both the primary and backup calling processors are unreachable. Protocols and standards RFC 2131, Dynamic Host Configuration Protocol RFC 2132, DHCP Options and BOOTP Vendor Extensions 27
41 RFC 1542, Clarifications and Extensions for the Bootstrap Protocol RFC 3046, DHCP Relay Agent Information Option RFC 3442, The Classless Static Route Option for Dynamic Host Configuration Protocol (DHCP) version 4 28
42 Configuring the DHCP server Overview The DHCP server is well suited to networks where: Manual configuration and centralized management are difficult to implement. IP addresses are limited. For example, an ISP limits the number of concurrent online users, and users must acquire IP addresses dynamically. Most hosts do not need fixed IP addresses. An MCE serving as the DHCP server can assign IP addresses not only to clients on public networks, but also to clients on private networks. The IP address ranges of public and private networks or those of private networks on the DHCP server cannot overlap each other. For more information about MCE, see MPLS Configuration Guide. DHCP address pool Each DHCP address pool has a group of assignable IP addresses and network configuration parameters. The DHCP server selects IP addresses and other parameters from the address pool and assigns them to the DHCP clients. Address assignment mechanisms Configure the following address assignment mechanisms as needed: Static address allocation Manually bind the MAC address or ID of a client to an IP address in a DHCP address pool. When the client requests an IP address, the DHCP server assigns the IP address in the static binding to the client. Dynamic address allocation Specify IP address ranges in a DHCP address pool. Upon receiving a DHCP request, the DHCP server dynamically selects an IP address from the matching IP address range in the address pool. There are two methods to specify IP address ranges in an address pool: Method 1 Specify a primary subnet in an address pool and divide the subnet into multiple address ranges, which include a common IP address range and IP address ranges for DHCP user classes. Upon receiving a DHCP request, the DHCP server finds a user class matching the client and selects an IP address in the address range of the user class for the client. A user class can include multiple matching rules, and a client matches the user class as long as it matches any of the rules. In address pool view, you can specify different address ranges for different user classes. DHCP selects an IP address for a client in the following order: a. DHCP matches the client against DHCP user classes in the order they are configured. b. If the client matches a user class, the DHCP server selects an IP address from the address range of the user class. 29
43 c. If the matching user class has no assignable addresses, the DHCP server matches the client against the next user class. If all the matching user classes have no assignable addresses, the DHCP server selects an IP address from the common address range. d. If the DHCP client does not match any DHCP user class, the DHCP server selects an address in the IP address range specified by the address range command. If the address range has no assignable IP addresses or it is not configured, the address allocation fails. NOTE: All address ranges must belong to the primary subnet. If an address range does not reside on the primary subnet, DHCP cannot assign the addresses in the address range. Method 2 Specify a primary subnet and multiple secondary subnets in an address pool. The DHCP server selects an IP address from the primary subnet first. If there is no assignable IP address on the primary subnet, the DHCP server selects an IP address from secondary subnets in the order they are configured. Principles for selecting an address pool The DHCP server observes the following principles to select an address pool for a client: 1. If there is an address pool where an IP address is statically bound to the MAC address or ID of the client, the DHCP server selects this address pool and assigns the statically bound IP address and other configuration parameters to the client. 2. If the receiving interface has an address pool applied, the DHCP server selects an IP address and other configuration parameters from this address pool. 3. If no static address pool is configured and no address pool is applied to the receiving interface, the DHCP server selects an address pool depending on the client location. Client on the same subnet as the server The DHCP server compares the IP address of the receiving interface with the primary subnets of all address pools. If a match is found, the server selects the address pool with the longest-matching primary subnet. If no match is found, the DHCP server compares the IP address with the secondary subnets of all address pools. The server selects the address pool with the longest-matching secondary subnet. Client on different subnet from the server The DHCP server compares the IP address in the giaddr field of the DHCP request with the primary subnets of all address pools. If a match is found, the server selects the address pool with the longest-matching primary subnet. If no match is found, the DHCP server compares the IP address with the secondary subnets of all address pools. The server selects the address pool with the longest-matching secondary subnet. For example, two address pools /24 and /25 are configured on the DHCP server. If the IP address of the interface receiving DHCP requests is /25 and no address pool is applied on the interface, the DHCP server selects IP addresses for clients from the address pool /25. If no IP address is available in the address pool, the DHCP server will not turn to the other primary subnets. The address allocation fails. If the IP address of the receiving interface is /25, the DHCP server selects IP addresses for clients from the address pool /24. 30
44 HP recommends that you make sure the primary subnet can be matched so the DHCP server turns to the secondary subnets only when the matching primary subnet has no assignable IP addresses. If only a secondary subnet is matched, the DHCP server does not select any IP address from other secondary subnets when the matching secondary subnet has no assignable addresses. NOTE: To make sure address allocation functions correctly, keep the IP addresses used for dynamic allocation on the subnet where the interface of the DHCP server or DHCP relay agent resides if possible. IP address allocation sequence The DHCP server selects an IP address for a client in the following sequence: 1. IP address statically bound to the client's MAC address or ID. 2. IP address that was ever assigned to the client. 3. IP address designated by the Option 50 field in the DHCP-DISCOVER message sent by the client. Option 50 is the Requested IP Address option. The client uses this option to specify the wanted IP address in a DHCP-DISCOVER message. The content of Option 50 is user defined. 4. First assignable IP address found in the way discussed in "DHCP address pool." 5. IP address that was a conflict or passed its lease duration. If no IP address is assignable, the server does not respond. NOTE: If a client moves to another subnet, the DHCP server selects an IP address in the address pool matching the new subnet instead of assigning the IP address that was once assigned to the client. Conflicted IP addresses can be assigned to other DHCP clients only after the addresses are in conflict for an hour. DHCP server configuration task list Tasks at a glance (Required.) Configuring an address pool on the DHCP server (Required.) Enabling DHCP (Required.) Enabling the DHCP server on an interface (Optional.) Applying an address pool on an interface (Optional.) Configuring IP address conflict detection (Optional.) Enabling handling of Option 82 (Optional.) Configuring DHCP server compatibility (Optional.) Setting the DSCP value for DHCP packets sent by the DHCP server 31
45 Configuring an address pool on the DHCP server Configuration task list Tasks at a glance (Required.) Creating a DHCP address pool Perform at least one of the following tasks: Specifying IP address ranges for a DHCP address pool Specifying gateways for the client Specifying a domain name suffix for the client Specifying DNS servers for the client Specifying WINS servers and NetBIOS node type for the client Specifying BIMS server information for the client Specifying the TFTP server and boot file name for the client Specifying a server for the DHCP client Configuring Option 184 parameters for the client Customizing DHCP options Creating a DHCP address pool Step Command Remarks 1. Enter system view. system-view N/A 2. Create a DHCP address pool and enter its view. dhcp server ip-pool pool-name By default, no DHCP address pool is created. Specifying IP address ranges for a DHCP address pool You can configure both static and dynamic address allocation mechanisms in a DHCP address pool. For dynamic address allocation, you can specify either a primary subnet with multiple address ranges or a primary subnet with multiple secondary subnets for a DHCP address pool. You cannot configure both. Specifying a primary subnet and multiple address ranges for a DHCP address pool Some scenarios need to classify DHCP clients on the same subnet into different address groups. To meet this need, you can configure DHCP user classes and specify different address ranges for the classes. The clients matching a user class can then get the IP addresses of a specific address range. In addition, you can specify a common address range for the clients that do not match any user class. If no common address range is specified, such clients fail to obtain IP addresses. If there is no need to classify clients, you do not need to configure DHCP user classes or their address ranges. Follow these guidelines when you specify a primary subnet and multiple address ranges for a DHCP address pool: 32
46 If you use the network or address range command multiple times for the same address pool, the most recent configuration takes effect. IP addresses specified by the forbidden-ip command are not assignable in the current address pool, but are assignable in other address pools. IP addresses specified by the dhcp server forbidden-ip command are not assignable in any address pool. To specify a primary subnet and multiple address ranges for a DHCP address pool: Step Command Remarks 1. Enter system view. system-view N/A 2. Create a DHCP user class and enter DHCP user class view. 3. Configure the match rule for the DHCP user class. dhcp class class-name if-match rule rule-number option option-code [ hex hex-string [ offset offset length length mask mask ] ] Required for client classification. By default, no DHCP user class exists. Required for client classification. By default, no match rule is specified for a DHCP user class. 4. Return to system view. quit N/A 5. Enter address pool view. dhcp server ip-pool pool-name N/A 6. Specify the primary subnet for the address pool. 7. (Optional.) Specify the common address range. 8. (Optional.) Specify an IP address range for a DHCP user class. 9. (Optional.) Specify the address lease duration. 10. (Optional.) Exclude the specified IP addresses in the address pool from dynamic allocation. network network-address [ mask-length mask mask ] address range start-ip-address end-ip-address class class-name range start-ip-address end-ip-address expired { day day [ hour hour [ minute minute [ second second ] ] ] unlimited } forbidden-ip ip-address&<1-8> By default, no primary subnet is specified. By default, no IP address range is specified. By default, no IP address range is specified for a user class. The DHCP user class must already exist. To specify address ranges for multiple DHCP user classes, repeat this step. The default setting is 1 day. By default, all the IP addresses in the DHCP address pool are assignable. To exclude multiple address ranges from dynamic allocation, repeat this step. 11. Return to system view. quit N/A 12. (Optional.) Exclude the specified IP addresses from automatic allocation globally. dhcp server forbidden-ip start-ip-address [ end-ip-address ] By default, except for the IP address of the DHCP server interface, all IP addresses in address pools are assignable. To exclude multiple IP address ranges, repeat this step. 33
47 Specifying a primary subnet and multiple secondary subnets for a DHCP address pool If an address pool has a primary subnet and multiple secondary subnets, the DHCP server assigns an IP address on a secondary subnet to a requesting client when no assignable IP address on the primary subnet is available. Follow these guidelines when you specify a primary subnet and secondary subnets for a DHCP address pool: You can specify only one primary subnet in each address pool. If you use the network command multiple times, the most recent configuration takes effect. You can specify a maximum of 32 secondary subnets in each address pool. IP addresses specified by the forbidden-ip command are not assignable in the current address pool, but are assignable in other address pools. IP addresses specified by the dhcp server forbidden-ip command are not assignable in any address pool. To specify a primary subnet and secondary subnets for a DHCP address pool: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter address pool view. dhcp server ip-pool pool-name N/A 3. Specify the primary subnet. network network-address [ mask-length mask mask ] By default, no primary subnet is specified. 4. (Optional.) Specify a secondary subnet. 5. (Optional.) Return to address pool view. 6. (Optional.) Specify the address lease duration. 7. (Optional.) Exclude the specified IP addresses from dynamic allocation. network network-address [ mask-length mask mask ] secondary quit expired { day day [ hour hour [ minute minute [ second second ] ] ] unlimited } forbidden-ip ip-address&<1-8> By default, no secondary subnet is specified. N/A The default setting is 1 day. By default, all the IP addresses in the DHCP address pool can be dynamically allocated. To exclude multiple address ranges from the address pool, repeat this step. 8. Return to system view. quit N/A 9. (Optional.) Exclude the specified IP addresses from dynamic allocation globally. dhcp server forbidden-ip start-ip-address [ end-ip-address ] Except for the IP address of the DHCP server interface, IP addresses in all address pools are assignable by default. To exclude multiple address ranges globally, repeat this step. 34
48 Configuring a static binding in a DHCP address pool Some DHCP clients, such as a WWW server, need fixed IP addresses. To provide a fixed IP address for such a client, you can statically bind the MAC address or ID of the client to an IP address in a DHCP address pool. When the client requests an IP address, the DHCP server assigns the IP address in the static binding to the client. Follow these guidelines when you configure a static binding: One IP address can be bound to only one client MAC or client ID. You cannot modify bindings that have been created. To change the binding for a DHCP client, you must delete the existing binding first. The IP address of a static binding cannot be the address of the DHCP server interface. Otherwise, an IP address conflict occurs and the bound client cannot obtain an IP address correctly. To configure static bindings for DHCP clients that reside on the same device and use the same MAC address, you must specify the client ID rather than the MAC address to identify a requesting interface. Otherwise, IP address allocation will fail. To configure a static binding: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter address pool view. dhcp server ip-pool pool-name N/A 3. Configure a static binding. static-bind ip-address ip-address [ mask-length mask mask ] { client-identifier client-identifier hardware-address hardware-address [ ethernet token-ring ] } By default, no static binding is configured. To add more static bindings, repeat this step. 4. (Optional.) Specify the lease duration for the IP address. expired { day day [ hour hour [ minute minute [ second second ] ] ] unlimited } The default setting is 1 day. Specifying gateways for the client DHCP clients send packets destined for other networks to a gateway. The DHCP server can assign the gateway address to the DHCP clients. You can specify gateway addresses in each address pool on the DHCP server. A maximum of eight gateways can be specified in DHCP address pool view or secondary subnet view. If you specify gateways in both address pool view and secondary subnet view, DHCP assigns the gateway addresses in the secondary subnet view to the clients on the secondary subnet. If you specify gateways in address pool view but not in secondary subnet view, DHCP assigns the gateway addresses in address pool view to the clients on the secondary subnet. To configure gateways in the DHCP address pool: Step Command Remarks 1. Enter system view. system-view N/A 35
49 Step Command Remarks 2. Enter DHCP address pool view. dhcp server ip-pool pool-name N/A 3. Specify gateways. gateway-list ip-address&<1-8> By default, no gateway is specified. 4. (Optional.) Enter secondary subnet view network network-address [ mask-length mask mask ] secondary N/A 5. (Optional.) Specify gateways. gateway-list ip-address&<1-8> By default, no gateway is specified. Specifying a domain name suffix for the client You can specify a domain name suffix in a DHCP address pool on the DHCP server. With this suffix assigned, the client only needs to input part of a domain name, and the system adds the domain name suffix for name resolution. For more information about DNS, see "Configuring DNS." To configure a domain name suffix in the DHCP address pool: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter DHCP address pool view. dhcp server ip-pool pool-name N/A 3. Specify a domain name suffix. domain-name domain-name By default, no domain name is specified. Specifying DNS servers for the client To access hosts on the Internet through domain names, a DHCP client must contact a DNS server to resolve names. You can specify up to eight DNS servers in a DHCP address pool. To specify DNS servers in a DHCP address pool: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter DHCP address pool view. dhcp server ip-pool pool-name N/A 3. Specify DNS servers. dns-list ip-address&<1-8> By default, no DNS server is specified. Specifying WINS servers and NetBIOS node type for the client A Microsoft DHCP client using NetBIOS protocol must contact a WINS server for name resolution. You can specify up to eight WINS servers for such clients in a DHCP address pool. In addition, you must specify a NetBIOS node type for the clients to approach name resolution. There are four NetBIOS node types: 36
50 b (broadcast)-node A b-node client sends the destination name in a broadcast message. The destination returns its IP address to the client after receiving the message. p (peer-to-peer)-node A p-node client sends the destination name in a unicast message to the WINS server and the WINS server returns the destination IP address. m (mixed)-node An m-node client broadcasts the destination name. If it receives no response, it unicasts the destination name to the WINS server to get the destination IP address. h (hybrid)-node An h-node client unicasts the destination name to the WINS server. If it receives no response, it broadcasts the destination name to get the destination IP address. To configure WINS servers and NetBIOS node type in a DHCP address pool: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter DHCP address pool view. dhcp server ip-pool pool-name N/A 3. Specify WINS servers. nbns-list ip-address&<1-8> 4. Specify the NetBIOS node type. netbios-type { b-node h-node m-node p-node } This step is optional for b-node. By default, no WINS server is specified. By default, no NetBIOS node type is specified. Specifying BIMS server information for the client Perform this task to provide the BIMS server IP address, port number, and shared key for the clients. The DHCP clients contact the BIMS server to get configuration files and perform software upgrade and backup. To configure the BIMS server IP address, port number, and shared key in the DHCP address pool: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter DHCP address pool view. dhcp server ip-pool pool-name N/A 3. Specify the BIMS server IP address, port number, and shared key. bims-server ip ip-address [ port port-number ] sharekey { cipher simple } key By default, no BIMS server information is specified. Specifying the TFTP server and boot file name for the client To implement client auto-configuration, you must specify the IP address or name of a TFTP server and the boot file name for the clients. There is no need to perform any configuration on the DHCP clients. A DHCP client obtains these parameters from the DHCP server, and uses them to contact the TFTP server to get the configuration file used for system initialization. Auto-configuration operates as follows: 1. When a router starts up without loading any configuration file, it sets an active interface (such as the interface of the default VLAN or a Layer 3 Ethernet interface) as the DHCP client to get configuration parameters from the DHCP server. The parameters include the IP address or name of a TFTP server, and the boot file name. 37
51 2. After getting the parameters, the DHCP client sends a TFTP request to obtain the configuration file from the specified TFTP server for system initialization. If the client cannot get such parameters, it performs system initialization without loading any configuration file. To configure the IP address of the TFTP server and the boot file name in a DHCP address pool: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter DHCP address pool view. dhcp server ip-pool pool-name N/A 3. Specify the IP address or the name of a TFTP server. Specify the IP address of the TFTP server: tftp-server ip-address ip-address Specify the name of the TFTP server: tftp-server domain-name domain-name By default, no TFTP server is specified. 4. Specify the boot file name. bootfile-name bootfile-name By default, no boot file name is specified. Specifying a server for the DHCP client Some DHCP clients need to obtain configuration information from a server, such as a TFTP server. You can specify the IP address of that server. The DHCP server sends the server's IP address to DHCP clients along with other configuration information. To specify the IP address of a server: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter DHCP address pool view. 3. Specify the IP address of a server. dhcp server ip-pool pool-name next-server ip-address N/A By default, no server is specified. Configuring Option 184 parameters for the client To assign calling parameters to DHCP clients with voice service, you must configure Option 184 on the DHCP server. For more information about Option 184, see "Option 184." To configure option 184 parameters in a DHCP address pool: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter DHCP address pool view. dhcp server ip-pool pool-name N/A 38
52 Step Command Remarks 3. Specify the IP address of the primary network calling processor. 4. (Optional.) Specify the IP address for the backup server. 5. (Optional.) Configure the voice VLAN. 6. (Optional.) Specify the failover IP address and dialer string. voice-config ncp-ip ip-address voice-config as-ip ip-address voice-config voice-vlan vlan-id { disable enable } voice-config fail-over ip-address dialer-string By default, no primary network calling processor is specified. After you configure this command, the other Option 184 parameters take effect. By default, no backup network calling processor is specified. By default, no voice VLAN is configured. By default, no failover IP address or dialer string is specified. Customizing DHCP options IMPORTANT: Use caution when customizing DHCP options because the configuration might affect DHCP operation. You can customize options for the following purposes: Add newly released options. Add options for which the vendor defines the contents, for example, Option 43. Add options for which the CLI does not provide a dedicated configuration command. For example, you can use the option 4 ip-address command to define the time server address for DHCP clients. Add all option values if the actual requirement exceeds the limit for a dedicated option configuration command. For example, the dns-list command can specify up to eight DNS servers. To specify more than eight DNS servers, you must use the option 6 command to define all DNS servers. To customize a DHCP option in a DHCP address pool: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter DHCP address pool view. 3. Customize a DHCP option. dhcp server ip-pool pool-name option code { ascii ascii-string hex hex-string ip-address ip-address&<1-8> } N/A By default, no DHCP option is customized. 39
53 Table 2 Common DHCP options Option Option name Corresponding command 3 Router Option gateway-list ip-address 6 Domain Name Server Option dns-list ip-address 15 Domain Name domain-name ascii Recommended option command parameters 44 NetBIOS over TCP/IP Name Server Option nbns-list ip-address 46 NetBIOS over TCP/IP Node Type Option netbios-type hex 66 TFTP server name tftp-server ascii 67 Boot file name bootfile-name ascii 43 Vendor Specific Information N/A hex Enabling DHCP You must enable DHCP to validate other DHCP configurations. To enable DHCP: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable DHCP. dhcp enable By default, DHCP is disabled. Enabling the DHCP server on an interface Perform this task to enable the DHCP server on an interface. Upon receiving a DHCP request on the interface, the DHCP server assigns an IP address and other configuration parameters from the DHCP address pool to the DHCP client. To enable the DHCP server on an interface: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. interface interface-type interface-number N/A 3. Enable the DHCP server on the interface. dhcp select server By default, the DHCP server on the interface is enabled. 40
54 Applying an address pool on an interface Perform this task to apply a DHCP address pool on an interface. Upon receiving a DHCP request from the interface, the DHCP server assigns the statically bound IP address and configuration parameters from the address pool that contains the static binding. If no static binding is found for the requesting client, the DHCP server selects the applied address pool for address and configuration parameter allocation. To apply an address pool on an interface: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Apply an address pool on the interface. interface interface-type interface-number dhcp server apply ip-pool pool-name N/A By default, no address pool is applied on an interface. If the applied address pool does not exist, the DHCP server fails to perform dynamic address allocation. Configuring IP address conflict detection Before assigning an IP address, the DHCP server pings that IP address. If the server receives a response within the specified period, it selects and pings another IP address. If it receives no response, the server continues to ping the IP address until a specific number of ping packets are sent. If still no response is received, the server assigns the IP address to the requesting client. The DHCP client uses gratuitous ARP to perform IP address conflict detection. To configure IP address conflict detection: Step Command Remarks 1. Enter system view. system-view N/A 2. (Optional.) Specify the maximum number of ping packets to be sent for conflict detection. 3. (Optional.) Configure the ping timeout time. dhcp server ping packets number dhcp server ping timeout milliseconds The default setting is one. The value 0 disables IP address conflict detection. The default setting is 500 ms. The value 0 disables IP address conflict detection. Enabling handling of Option 82 Perform this task to enable the DHCP server to handle Option 82. Upon receiving a DHCP request that contains Option 82, the DHCP server adds Option 82 into the DHCP response. If you disable the DHCP to handle Option 82, it does not add Option 82 into the response message. 41
55 You must enable handling of Option 82 on both the DHCP server and the DHCP relay agent to ensure correct processing for Option 82. For information about enabling handling of Option 82 on the DHCP relay agent, see "Configuring Option 82." To enable the DHCP server to handle Option 82: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable the server to handle Option 82. dhcp server relay information enable By default, handling of Option 82 is enabled. Configuring DHCP server compatibility Perform this task to enable the DHCP server to support DHCP clients that are incompliant with RFC. Configuring the DHCP server to broadcast all responses Typically, the DHCP server broadcasts a response only when the broadcast flag in the DHCP request is set to 1. To work with DHCP clients that set the broadcast flag to 0 but do not accept unicast responses, configure the DHCP server to ignore the broadcast flag and always broadcast a response. If a DHCP request is from a DHCP client that has an IP address (the ciaddr field is not 0), the DHCP server always unicasts a response (the destination address is ciaddr) to the DHCP client regardless of whether this command is executed. If a DHCP request is from a DHCP relay agent (the giaddr field is not 0), the DHCP server always unicasts a response (the destination address is giaddr) to the DHCP relay agent regardless of whether it is enabled to broadcast all responses. To configure the DHCP server to broadcast all responses: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable the DHCP server to broadcast all responses. dhcp server always-broadcast By default, the DHCP server looks at the broadcast flag to decide whether to broadcast or unicast a response. Configure the DHCP server to ignore BOOTP requests The lease duration of the IP addresses obtained by the BOOTP clients is unlimited. For some scenarios that do not allow unlimited leases, you can configure the DHCP server to ignore BOOTP requests. To configure the DHCP server to ignore BOOTP requests: Step Command Remarks 1. Enter system view. system-view N/A 42
56 Step Command Remarks 2. Configure the DHCP server to ignore BOOTP requests. dhcp server bootp ignore By default, the DHCP server processes BOOTP requests. Configuring the DHCP server to send BOOTP responses in RFC 1048 format Not all BOOTP clients can send requests that are compatible with RFC By default, the DHCP server does not process the Vend field of RFC 1048-incompliant requests but copies the Vend field into responses. This function enables the DHCP server to fill in the Vend field using the RFC 1048-compliant format in DHCP responses to RFC 1048-incompliant requests sent by BOOTP clients that request statically bound addresses. To configure the DHCP server to send BOOTP responses in RFC 1048 format: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable the DHCP server to send BOOTP responses in RFC 1048 format to the RFC 1048-incompliant BOOTP requests for statically bound addresses. dhcp server bootp reply-rfc-1048 By default, the DHCP server directly copies the Vend field of such requests into the responses. Setting the DSCP value for DHCP packets sent by the DHCP server The DSCP value of a packet specifies the priority level of the packet and affects the transmission priority of the packet. To set the DSCP value for DHCP packets sent by the DHCP server: Step Command Remarks 1. Enter system view. system-view N/A 2. Set the DSCP value for DHCP packets sent by the DHCP server. dhcp dscp dscp-value By default, the DSCP value in DHCP packets sent by the DHCP server is 56. Displaying and maintaining the DHCP server IMPORTANT: A restart of the DHCP server or execution of the reset dhcp server ip-in-use command deletes all lease information. The DHCP server denies any DHCP request for lease extension, and the client must request an IP address again. 43
57 Execute display commands in any view and reset commands in user view. Task Command Display information about IP address conflicts. display dhcp server conflict [ ip ip-address ] Display information about lease-expired IP addresses. Display information about assignable IP addresses. Display information about assigned IP addresses. display dhcp server expired [ ip ip-address pool pool-name ] display dhcp server free-ip [ pool pool-name ] display dhcp server ip-in-use [ ip ip-address pool pool-name ] Display DHCP server statistics. display dhcp server statistics [ pool pool-name ] Display information about DHCP address pools. display dhcp server pool [ pool-name ] Clear information about IP address conflicts. reset dhcp server conflict [ ip ip-address ] Clear information about lease-expired IP addresses. Clear information about assigned IP addresses. Clear DHCP server statistics. reset dhcp server expired [ ip ip-address pool pool-name ] reset dhcp server ip-in-use [ ip ip-address pool pool-name ] reset dhcp server statistics DHCP server configuration examples DHCP networking includes the following types: The DHCP server and clients reside on the same subnet. The DHCP server and clients are not on the same subnet and communicate with each other through a DHCP relay agent. The DHCP server configuration for the two types is identical. Static IP address assignment configuration example Network requirements As shown in Figure 16, Router A (DHCP server) assigns a static IP address, a DNS server address, and a gateway address to Router B (DHCP client) and Router C (BOOTP client). The client ID of the interface GigabitEthernet 2/1/1 on Router B is: e e d e f-30. The MAC address of the interface GigabitEthernet 2/1/1 on Router C is 000f-e200-01c0. 44
58 Figure 16 Network diagram Configuration procedure 1. Specify an IP address for GigabitEthernet 2/1/1 on Router A: <RouterA> system-view [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ip address [RouterA-GigabitEthernet2/1/1] quit 2. Configure the DHCP server: # Enable DHCP. [RouterA] dhcp enable # Enable the DHCP server on GigabitEthernet 2/1/1. [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] dhcp select server [RouterA-GigabitEthernet2/1/1] quit # Create DHCP address pool 0. [RouterA] dhcp server ip-pool 0 # Configure a static binding for Router B. [RouterA-dhcp-pool-0] static-bind ip-address client-identifier e e d e f-30 # Configure a static binding for Router C. [RouterA-dhcp-pool-0] static-bind ip-address hardware-address 000f-e200-01c0 # Specify the DNS server and gateway. [RouterA-dhcp-pool-0] dns-list [RouterA-dhcp-pool-0] gateway-list Verifying the configuration Router B can obtain IP address and other network parameters, and Router C can obtain IP address and other network parameters from Router A. You can use the display dhcp server ip-in-use command on the DHCP server to display the IP addresses assigned to the clients. 45
59 Dynamic IP address assignment configuration example Network requirements As shown in Figure 17, the DHCP server (Router A) assigns IP addresses to clients on subnet /24, which is subnetted into /25 and /25. Configure DHCP server on Router A to implement the following assignment scheme. Table 3 Assignment scheme DHCP clients IP address Lease Other configuration parameters Clients that connect to GigabitEthernet 2/1/1 IP addresses on subnet /25 10 days and 12 hours Gateway: /25 DNS server: /25 Domain name: aabbcc.com WINS server: /25 Clients that connect to GigabitEthernet 2/1/2 IP addresses on subnet /25 Five days Gateway: /25 DNS server: /25 Domain name: aabbcc.com Figure 17 Network diagram Configuration procedure 1. Specify IP addresses for interfaces. (Details not shown.) 2. Configure the DHCP server: # Enable DHCP. <RouterA> system-view [RouterA] dhcp enable # Enable the DHCP server on GigabitEthernet 2/1/1 and GigabitEthernet 2/1/2. [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] dhcp select server [RouterA-GigabitEthernet2/1/1] quit [RouterA] interface gigabitethernet 2/1/2 [RouterA-GigabitEthernet2/1/2] dhcp select server [RouterA-GigabitEthernet2/1/2] quit # Exclude addresses of the DNS server, WINS server, and gateways from dynamic allocation. 46
60 [RouterA] dhcp server forbidden-ip [RouterA] dhcp server forbidden-ip [RouterA] dhcp server forbidden-ip [RouterA] dhcp server forbidden-ip # Configure DHCP address pool 1 to assign IP addresses and other configuration parameters to clients on subnet /25. [RouterA] dhcp server ip-pool 1 [RouterA-dhcp-pool-1] network mask [RouterA-dhcp-pool-1] expired day 10 hour 12 [RouterA-dhcp-pool-1] domain-name aabbcc.com [RouterA-dhcp-pool-1] dns-list [RouterA-dhcp-pool-1] gateway-list [RouterA-dhcp-pool-1] nbns-list [RouterA-dhcp-pool-1] quit # Configure DHCP address pool 2 to assign IP addresses and other configuration parameters to clients on subnet /25. [RouterA] dhcp server ip-pool 2 [RouterA-dhcp-pool-2] network mask [RouterA-dhcp-pool-2] expired day 5 [RouterA-dhcp-pool-2] domain-name aabbcc.com [RouterA-dhcp-pool-2] dns-list [RouterA-dhcp-pool-2] gateway-list Verifying the configuration Clients on networks /25 and /25 can obtain correct IP addresses and other network parameters from Router A. You can use the display dhcp server ip-in-use command on the DHCP server to display the IP addresses assigned to the clients. DHCP user class configuration example Network requirements As shown in Figure 18, the DHCP relay agent (Router A) forwards DHCP packets between DHCP clients and the DHCP server. Enable Router A to handle Option 82 so that it can add Option 82 in the DHCP requests from the DHCP clients and convey the packets to the DHCP server. The DHCP server (Router B) assigns IP addresses and other configuration parameters to the DHCP clients. If the DHCP requests contain Option 82, the server assigns IP addresses in the range of to to the clients. Router B assigns the DNS server address /24 and the gateway address /24 to clients on subnet /24. 47
61 Figure 18 Network diagram Configuration procedure 1. Specify IP addresses for the interfaces on DHCP server. (Details not shown.) 2. Configure DHCP: # Enable DHCP and configure the DHCP server to handle Option 82. <RouterB> system-view [RouterB] dhcp enable [RouterB] dhcp server relay information enable # Enable the DHCP server on the interface GigabitEthernet 2/1/1. [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] dhcp select server [RouterB-GigabitEthernet2/1/1] quit # Create DHCP user class tt and configure a match rule to match DHCP requests that contain Option 82. [RouterB] dhcp class tt [RouterB-dhcp-class-tt] if-match rule 1 option 82 [RouterB-dhcp-class-tt] quit # Create DHCP address pool aa. [RouterB] dhcp server ip-pool aa # Specify the subnet for dynamic allocation. [RouterB-dhcp-pool-aa] network mask # Specify the address range for dynamic allocation. [RouterB-dhcp-pool-aa] address range # Specify the address range for the user class tt. [RouterB-dhcp-pool-aa] class tt range # Specify the gateway and the DNS server. [RouterB-dhcp-pool-aa] gateway-list [RouterB-dhcp-pool-aa] dns-list Verifying the configuration Clients matching the DHCP user class can obtain IP addresses in the specified range and other network configuration parameters from DHCP server (Router B). You can use the display dhcp server ip-in-use command to display the IP addresses assigned to the clients. 48
62 Primary and secondary subnets configuration example Network requirements As shown in Figure 19, the DHCP server (Router A) assigns IP addresses to DHCP clients in the LAN. Configure two subnets in the address pool on the DHCP server: /24 as the primary subnet and /24 as the secondary subnet. The DHCP server selects an IP address from the secondary subnet when the primary subnet has no assignable addresses. Router A assigns the following parameters: The default gateway /24 to clients on subnet /24. The default gateway /24 to clients on subnet /24. Figure 19 Network diagram Router A DHCP server GE2/1/ / /24 sub... DHCP client DHCP client DHCP client Gateway Configuration procedure # Enable DHCP. <RouterA> system-view [RouterA] dhcp enable # Configure the primary and secondary IP addresses of interface GigabitEthernet 2/1/1, and enable the DHCP server on GigabitEthernet 2/1/1. [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ip address [RouterA-GigabitEthernet2/1/1] ip address sub [RouterA-GigabitEthernet2/1/1] dhcp select server [RouterA-GigabitEthernet2/1/1] quit # Create DHCP address pool aa. [RouterA] dhcp server ip-pool aa # Specify the primary subnet and the gateway for dynamic allocation. [RouterA-dhcp-pool-aa] network mask [RouterA-dhcp-pool-aa] gateway-list # Specify the secondary subnet and the gateway for dynamic allocation. [RouterA-dhcp-pool-aa] network mask secondary [RouterA-dhcp-pool-aa-secondary] gateway-list [RouterA-dhcp-pool-aa-secondary] quit 49
63 [RouterA-dhcp-pool-aa] Verifying the configuration The DHCP server assigns clients IP addresses and other network configuration parameters from the secondary subnet in the address pool when no assignable address is available from the primary subnet. You can use display dhcp server ip-in-use command to display IP addresses assigned to the clients. DHCP option customization configuration example Network requirements As shown in Figure 20, the DHCP client (Router B) obtains its IP address and PXE server addresses from the DHCP server (Router A). The client IP address belongs to subnet /24. The PXE server addresses are and The DHCP server assigns PXE server addresses to DHCP clients through Option 43, a custom option. The formats of Option 43 and PXE server address sub-option are shown in Figure 13 and Figure 15. The value of Option 43 configured on the DHCP server in this example is 80 0B The number 80 is the value of the sub-option type. The number 0B is the value of the sub-option length. The numbers are the value of the PXE server type. The number 02 indicates the number of servers. The numbers indicate that the PXE server addresses are and Figure 20 Network diagram Configuration procedure 1. Specify an IP address for interface GigabitEthernet 2/1/1. (Details not shown.) 2. Configure the DHCP server: # Enable DHCP. <RouterA> system-view [RouterA] dhcp enable # Enable the DHCP server on GigabitEthernet 2/1/1. [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] dhcp select server [RouterA-GigabitEthernet2/1/1] quit # Configure DHCP address pool 0. [RouterA] dhcp server ip-pool 0 [RouterA-dhcp-pool-0] network mask [RouterA-dhcp-pool-0] option 43 hex 800B
64 Verifying the configuration Router B can obtain an IP address on the subnet /24 and the PXE server addresses from Router A. You can use the display dhcp server ip-in-use command on the DHCP server to display the IP addresses assigned to the clients. Troubleshooting DHCP server configuration Symptom Analysis Solution A client's IP address obtained from the DHCP server conflicts with another IP address. Another host on the subnet might have the same IP address. 1. Disable the client's network adapter or disconnect the client's network cable. Ping the IP address of the client from another host to check whether there is a host using the same IP address. 2. If a ping response is received, the IP address has been manually configured on a host. Execute the dhcp server forbidden-ip command on the DHCP server to exclude the IP address from dynamic allocation. 3. Enable the network adapter or connect the network cable, release the IP address, and obtain another one on the client. For example, to release the IP address and obtain another one on a Windows XP DHCP client: a. In Windows environment, execute the cmd command to enter the DOS environment. b. Enter ipconfig /release to relinquish the IP address. c. Enter ipconfig /renew to obtain another IP address. 51
65 Configuring the DHCP relay agent Overview The DHCP relay agent enables clients to get IP addresses from a DHCP server on another subnet. This feature avoids deploying a DHCP server for each subnet to centralize management and reduce investment. Figure 21 shows a typical application of the DHCP relay agent. Figure 21 DHCP relay agent application Operation An MCE device serving as the DHCP relay agent can forward DHCP packets between a DHCP server and clients on either a public network or a private network. For more information about MCE, see MPLS Configuration Guide. The DHCP server and client interact with each other in the same way regardless of whether the relay agent exists. For the interaction details, see "IP address allocation process." The following only describes steps related to the DHCP relay agent: 1. After receiving a DHCP-DISCOVER or DHCP-REQUEST broadcast message from a DHCP client, the DHCP relay agent fills the giaddr field of the message with its IP address and unicasts the message to the designated DHCP server. 2. Based on the giaddr field, the DHCP server returns an IP address and other configuration parameters in a response. 3. The relay agent conveys the response to the client. 52
66 Figure 22 DHCP relay agent operation DHCP relay agent support for Option 82 Option 82 records the location information about the DHCP client. It enables the administrator to do the following operations: Locate the DHCP client for security and accounting purposes. Assign IP addresses in a specific range to clients. For more information about Option 82, see "Relay agent option (Option 82)." If the DHCP relay agent supports Option 82, it handles DHCP requests by following the strategies described in Table 4. If a response returned by the DHCP server contains Option 82, the DHCP relay agent removes the Option 82 before forwarding the response to the client. Table 4 Handling strategies of the DHCP relay agent If a DHCP request has Handling strategy Drop The DHCP relay agent Drops the message. Option 82 Keep Forwards the message without changing Option 82. Replace Forwards the message after replacing the original Option 82 with the Option 82 padded according to the configured padding format, padding content, and code type. No Option 82 N/A Forwards the message after adding Option 82 padded according to the configured padding format, padding content, and code type. DHCP relay agent configuration task list Tasks at a glance (Required.) Enabling DHCP (Required.) Enabling the DHCP relay agent on an interface 53
67 Tasks at a glance (Required.) Specifying DHCP servers on a relay agent (Optional.) Configuring the DHCP relay agent security functions (Optional.) Configuring the DHCP relay agent to release an IP address (Optional.) Configuring Option 82 (Optional.) Setting the DSCP value for DHCP packets sent by the DHCP relay agent Enabling DHCP You must enable DHCP to validate other DHCP relay agent settings. To enable DHCP: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable DHCP. dhcp enable By default, DHCP is disabled. Enabling the DHCP relay agent on an interface With the DHCP relay agent enabled, an interface forwards incoming DHCP requests to a DHCP server. An IP address pool that contains the IP address of the DHCP relay agent interface must be configured on the DHCP server. Otherwise, the DHCP clients connected to the relay agent cannot obtain correct IP addresses. To enable the DHCP relay agent on an interface: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. interface interface-type interface-number N/A 3. Enable the DHCP relay agent. dhcp select relay By default, when DHCP is enabled, an interface operates in the DHCP server mode. Specifying DHCP servers on a relay agent To improve availability, you can specify several DHCP servers on the DHCP relay agent. When the interface receives request messages from clients, the relay agent forwards them to all DHCP servers. Follow these guidelines when you specify a DHCP server address on a relay agent: The IP address of any specified DHCP server must not reside on the same subnet as the IP address of the relay agent interface. Otherwise, the clients might fail to obtain IP addresses. You can specify a maximum of eight DHCP servers. 54
68 To specify a DHCP server address on a relay agent: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Specify a DHCP server address on the relay agent. interface interface-type interface-number dhcp relay server-address ip-address N/A By default, no DHCP server address is specified on the relay agent. Configuring the DHCP relay agent security functions Enabling the DHCP relay agent to record relay entries Perform this task to enable the DHCP relay agent to automatically record clients' IP-to-MAC bindings (relay entries) after they obtain IP addresses through DHCP. Some security functions, such as ARP address check, authorized ARP, and IP source guard, use the recorded relay entries to check incoming packets and block packets that do not match any entry. In this way, illegal hosts are not able to access external networks through the relay agent. To enable the DHCP relay agent to record relay entries: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable the relay agent to record relay entries. dhcp relay client-information record By default, the relay agent does not record relay entries. NOTE: The DHCP relay agent does not record IP-to-MAC bindings for DHCP clients running on synchronous/asynchronous serial interfaces. Enabling periodic refresh of dynamic relay entries A DHCP client unicasts a DHCP-RELEASE message to the DHCP server to release its IP address. The DHCP relay agent conveys the message to the DHCP server and does not remove the IP-to-MAC entry of the client. With this feature, the DHCP relay agent uses the following information to periodically send a DHCP-REQUEST message to the DHCP server: The IP address of a relay entry. The MAC address of the DHCP relay interface. The relay agent maintains the relay entries depending on what it receives from the DHCP server: 55
69 If the server returns a DHCP-ACK message or does not return any message within a specific interval, the DHCP relay agent removes the relay entry. In addition, upon receiving the DHCP-ACK message, the relay agent sends a DHCP-RELEASE message to release the IP address. If the server returns a DHCP-NAK message, the relay agent keeps the relay entry. To enable periodic refresh of dynamic relay entries: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable periodic refresh of dynamic relay entries. 3. Configure the refresh interval. dhcp relay client-information refresh enable dhcp relay client-information refresh [ auto interval interval ] By default, periodic refresh of dynamic relay entries is enabled. By default, the refresh interval is auto, which is calculated based on the number of total relay entries. Enabling DHCP starvation attack protection A DHCP starvation attack occurs when an attacker constantly sends forged DHCP requests using different MAC addresses in the chaddr field to a DHCP server. This exhausts the IP address resources of the DHCP server so legitimate DHCP clients cannot obtain IP addresses. The DHCP server might also fail to work because of exhaustion of system resources. The following methods are available to relieve or prevent such attacks. To relieve a DHCP starvation attack that uses DHCP packets encapsulated with different source MAC addresses, you can use one of the following methods: Limit the number of ARP entries that a Layer 3 interface can learn. Limit the number of MAC addresses that a Layer 2 port can learn. Configure an interface that has learned the maximum MAC addresses to discard packets whose source MAC addresses are not in the MAC address table. To prevent a DHCP starvation attack that uses DHCP requests encapsulated with the same source MAC address, you can enable MAC address check on the DHCP relay agent. The DHCP relay agent compares the chaddr field of a received DHCP request with the source MAC address in the frame header. If they are the same, the DHCP relay agent forwards the request to the DHCP server. If not, the relay agent discards the request. Enable MAC address check only on the DHCP relay agent directly connected to the DHCP clients. A DHCP relay agent changes the source MAC address of DHCP packets before sending them. If you enable this feature on an intermediate relay agent, it might discard valid DHCP packets. Then the sending clients will not obtain IP addresses. A MAC address check entry has an aging time. When the aging time expires, both of the following occur: The entry ages out. The DHCP relay agent rechecks the validity of DHCP requests sent from the MAC address in the entry. To enable MAC address check: 56
70 Step Command Remarks 1. Enter system view. system-view N/A 2. Configure the aging time for MAC address check entries. 3. Enter the interface view. dhcp relay check mac-address aging-time time interface interface-type interface-number The default aging time is 30 seconds. This command takes effect only after you execute the dhcp relay check mac-address command. N/A 4. Enable MAC address check. dhcp relay check mac-address By default, MAC address check is disabled. Configuring the DHCP relay agent to release an IP address Configure the relay agent to release the IP address for a relay entry. The relay agent sends a DHCP-RELEASE message to the server and meanwhile deletes the relay entry. Upon receiving the DHCP-RELEASE message, the DHCP server releases the IP address. To configure the DHCP relay agent to release an IP address: Step Command Remarks 1. Enter system view. system-view N/A 2. Configure the DHCP relay agent to release an IP address. dhcp relay release ip client-ip [ vpn-instance vpn-instance-name ] This command can release only the IP addresses in the recorded relay entries. Configuring Option 82 Follow these guidelines when you configure Option 82: To support Option 82, you must perform related configuration on both the DHCP server and relay agent. For DHCP server Option 82 configuration, see "Enabling handling of Option 82." The device name (sysname) must not include spaces if it is configured as the padding content for sub-option 1. Otherwise, the DHCP relay agent will fail to add or replace Option 82. To configure Option 82: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Enable the relay agent to handle Option 82. interface interface-type interface-number dhcp relay information enable N/A By default, handling of Option 82 is disabled. 57
71 Step Command Remarks 4. (Optional.) Configure the strategy for handling DHCP requests that contain Option 82. dhcp relay information strategy { drop keep replace } By default, the handling strategy is replace. 5. (Optional.) Configure the padding content and code type for the Circuit ID sub-option. 6. (Optional.) Configure the padding content and code type for the Remote ID sub-option. dhcp relay information circuit-id { string circuit-id { normal verbose [ node-identifier { mac sysname user-defined node-identifier } ] } [ format { ascii hex } ] } dhcp relay information remote-id { normal [ format { ascii hex } ] string remote-id sysname } By default, the padding format for Circuit ID sub-option is normal, and the code type is hex. By default, the padding format for the Remote ID sub-option is normal, and the code type is hex. Setting the DSCP value for DHCP packets sent by the DHCP relay agent The DSCP value of a packet specifies the priority level of the packet and affects the transmission priority of the packet. To set the DSCP value for DHCP packets sent by the DHCP relay agent: Step Command Remarks 1. Enter system view. system-view N/A 2. Set the DSCP value for DHCP packets sent by the DHCP relay agent. dhcp dscp dscp-value By default, the DSCP value in DHCP packets sent by the DHCP relay agent is 56. Displaying and maintaining the DHCP relay agent Execute display commands in any view and reset commands in user view. Task Display information about DHCP servers specified on the DHCP relay agent interface. Display Option 82 configuration information on the DHCP relay agent. Display relay entries on the DHCP relay agent. Display packet statistics on the DHCP relay agent. Display MAC address check entries on the DHCP relay agent. Command display dhcp relay server-address [ interface interface-type interface-number ] display dhcp relay information [ interface interface-type interface-number ] display dhcp relay client-information [ interface interface-type interface-number ip ip-address [ vpn-instance vpn-instance-name ] ] display dhcp relay statistics [ interface interface-type interface-number ] display dhcp relay check mac-address 58
72 Task Clear relay entries on the DHCP relay agent. Clear packet statistics on the DHCP relay agent. Command reset dhcp relay client-information [ interface interface-type interface-number ip ip-address [ vpn-instance vpn-instance-name ] ] reset dhcp relay statistics [ interface interface-type interface-number ] DHCP relay agent configuration examples DHCP relay agent configuration example Network requirements As shown in Figure 23, configure the DHCP relay agent on Router A so that DHCP clients can obtain IP addresses and other configuration parameters from the DHCP server on another subnet. Because the DHCP relay agent and server are on different subnets, you need to configure static or dynamic routing to make them reachable to each other. DHCP server configuration is also required to guarantee the client-server communication through the DHCP relay agent. For DHCP server configuration information, see "DHCP server configuration examples." Figure 23 Network diagram DHCP client DHCP client GE2/1/ /24 GE2/1/ /24 Router A DHCP relay agent GE1/0/ /24 Router B DHCP server DHCP client DHCP client Configuration procedure # Specify IP addresses for the interfaces. (Details not shown.) # Enable DHCP. <RouterA> system-view [RouterA] dhcp enable # Enable the DHCP relay agent on GigabitEthernet 2/1/1. [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] dhcp select relay # Specify the IP address of the DHCP server on the relay agent. [RouterA-GigabitEthernet2/1/1] dhcp relay server-address
73 Verifying the configuration DHCP clients can obtain IP addresses and other network parameters from the DHCP server through the DHCP relay agent. You can use the display dhcp relay statistics command to display the statistics of DHCP packets forwarded by the DHCP relay agent. If you enable relay entry recording on the DHCP relay agent with the dhcp relay client-information record command, you can use the display dhcp relay client-information command to display relay entries. Option 82 configuration example Network requirements As shown in Figure 23, the DHCP relay agent (Router A) replaces Option 82 in DHCP requests before forwarding them to the DHCP server (Router B). The Circuit ID sub-option is company001. The Remote ID sub-option is device001. To use Option 82, you must also enable the DHCP server to handle Option 82. Configuration procedure # Specify IP addresses for the interfaces. (Details not shown.) # Enable DHCP. <RouterA> system-view [RouterA] dhcp enable # Enable the DHCP relay agent on GigabitEthernet 2/1/1. [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] dhcp select relay # Specify the IP address of the DHCP server on the relay agent. [RouterA-GigabitEthernet2/1/1] dhcp relay server-address # Enable the DHCP relay agent to handle Option 82, and perform Option 82 related configuration. [RouterA-GigabitEthernet2/1/1] dhcp relay information enable [RouterA-GigabitEthernet2/1/1] dhcp relay information strategy replace [RouterA-GigabitEthernet2/1/1] dhcp relay information circuit-id string company001 [RouterA-GigabitEthernet2/1/1] dhcp relay information remote-id string device001 Troubleshooting DHCP relay agent configuration Symptom Analysis DHCP clients cannot obtain configuration parameters through the DHCP relay agent. Some problems might occur with the DHCP relay agent or server configuration. 60
74 Solution To locate the problem, enable debugging and execute the display command on the DHCP relay agent to view the debugging information and interface state information. Check that: DHCP is enabled on the DHCP server and relay agent. The DHCP server has an address pool on the same subnet as the DHCP clients. The DHCP server and DHCP relay agent can reach each other. The DHCP server address specified on the DHCP relay agent interface connected to the DHCP clients is correct. 61
75 Configuring the DHCP client With DHCP client enabled, an interface uses DHCP to obtain configuration parameters from the DHCP server, for example, an IP address. The DHCP client configuration is supported only on Layer 3 Ethernet interfaces (or subinterfaces), VLAN interfaces, and Layer 3 aggregate interfaces. Enabling the DHCP client on an interface Follow these guidelines when you enable the DHCP client on an interface: On some device models, if the number of IP address request failures reaches the system-defined amount, the DHCP client-enabled interface uses a default IP address. An interface can be configured to acquire an IP address in multiple ways. The new configuration overwrites the old. Secondary IP addresses cannot be configured on an interface that is enabled with the DHCP client. If the interface obtains an IP address on the same segment as another interface on the device, the interface does not use the assigned address. Instead, it requests a new IP address from the DHCP server. To enable the DHCP client on an interface: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Configure an interface to use DHCP for IP address acquisition. interface interface-type interface-number ip address dhcp-alloc N/A By default, an interface does not use DHCP for IP address acquisition. Configuring a DHCP client ID for an interface A DHCP client ID is added to the DHCP option 61. A DHCP server can specify IP addresses for clients based on the DHCP client ID. Make sure the IDs for different DHCP clients are unique. To configure a DHCP client ID for an interface: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. interface interface-type interface-number N/A 62
76 Step Command Remarks 3. Configure a DHCP client ID for the interface. 4. Verify the client ID configuration. dhcp client identifier { ascii string hex string mac interface-type interface-number } display dhcp client [ verbose ] [ interface interface-type interface-number ] By default, an interface generates the DHCP client ID based on its MAC address. If the interface has no MAC address, it uses the MAC address of the first Ethernet interface to generate its client ID. DHCP client ID includes ID type and type value. Each ID type has a fixed type value. You can check the fields for the client ID to verify which type of client ID is used: If an ASCII string is used as the client ID, the type value is 00. If a hex string is used as the client ID, the type value is the first two characters in the string. If the MAC address of a specific interface is used as the client ID, the type value is 01. Enabling duplicated address detection DHCP client detects IP address conflict through ARP packets. An attacker can act as the IP address owner to send an ARP reply, making the client unable to use the IP address assigned by the server. HP recommends you to disable duplicate address detection when ARP attacks exist on the network. To enable duplicated address detection: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable duplicate address detection. dhcp client dad enable By default, the duplicate address detection feature is enabled on an interface. Setting the DSCP value for DHCP packets sent by the DHCP client The DSCP value of a packet specifies the priority level of the packet and affects the transmission priority of the packet. To set the DSCP value for DHCP packets sent by the DHCP client: Step Command Remarks 1. Enter system view. system-view N/A 2. Set the DSCP value for DHCP packets sent by the DHCP client. dhcp client dscp dscp-value By default, the DSCP value in DHCP packets sent by the DHCP client is
77 Displaying and maintaining the DHCP client Execute display command in any view. Task Display DHCP client information. Command display dhcp client [ verbose ] [ interface interface-type interface-number ] DHCP client configuration example Network requirements As shown in Figure 25, Router B contacts the DHCP server through GigabitEthernet 2/1/1 to obtain an IP address, a DNS server address, and static route information. The DHCP client IP address resides on subnet /24. The DNS server address is The next hop of the static route to subnet /24 is The DHCP server uses Option 121 to assign static route information to DHCP clients. Figure 24 shows the Option 121 format. The destination descriptor field contains the following parts: subnet mask length and destination network address, both in hexadecimal notation. In this example, the destination descriptor is (the subnet mask length is 24 and the network address is in dotted decimal notation). The next hop address is 0A ( in dotted decimal notation). Figure 24 Option 121 format Figure 25 Network diagram GE2/1/ /24 Router A DHCP server / /24 GE2/1/1 Router C /24 DNS server Router B DHCP Client Configuration procedure 1. Configure Router A: # Specify the IP address of GigabitEthernet 2/1/1. <RouterA> system-view [RouterA] interface gigabitethernet 2/1/1 64
78 [RouterA-GigabitEthernet2/1/1] ip address [RouterA-GigabitEthernet2/1/1] quit # Enable DHCP. [RouterA] dhcp enable # Exclude an IP address from dynamic allocation. [RouterA] dhcp server forbidden-ip # Configure DHCP address pool 0. Specify the subnet, lease duration, DNS server address, and a static route to subnet /24. [RouterA] dhcp server ip-pool 0 [RouterA-dhcp-pool-0] network mask [RouterA-dhcp-pool-0] expired day 10 [RouterA-dhcp-pool-0] dns-list [RouterA-dhcp-pool-0] option 121 hex A Configure Router B: # Configure GigabitEthernet 2/1/1 to use DHCP for IP address acquisition. <RouterB> system-view [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] ip address dhcp-alloc [RouterB-GigabitEthernet2/1/1] quit Verifying the configuration # Use the display dhcp client command to display the IP address and other network parameters assigned to Router B. [RouterB] display dhcp client verbose GigabitEthernet2/1/1 DHCP client information: Current machine state: BOUND Allocated IP: Allocated lease: seconds, T1: seconds, T2: seconds Lease from May 21 19:00: to May 31 19:00: DHCP server: Transaction ID: 0xcde72232 Classless static route: Destination: , Mask: , NextHop: DNS server: Client ID type: acsii(type value=00) Client ID value: 000c.29d GE2/1/1 Client ID (with type) hex: e e d f30-2f32 T1 will timeout in 3 days 19 hours 48 minutes 43 seconds. # Use the display ip routing-table command to display the route information on Router B. The output shows that a static route to subnet /24 is added to the routing table. [RouterB] display ip routing-table Destinations : 11 Routes : 11 65
79 Destination/Mask Proto Pre Cost NextHop Interface /24 Direct GE2/1/ /32 Direct InLoop /24 Static GE2/1/ /32 Direct GE2/1/ /8 Direct InLoop /32 Direct InLoop /32 Direct InLoop /32 Direct InLoop /4 Direct NULL /24 Direct NULL /32 Direct InLoop0 66
80 Configuring DHCP snooping In this chapter, "MSR1000" refers to MSR "MSR2000" refers to MSR2003, MSR , MSR "MSR3000" collectively refers to MSR3012, MSR3024, MSR3044, MSR3064. "MSR4000" collectively refers to MSR4060 and MSR4080. Overview DHCP snooping works between the DHCP client and server, or between the DHCP client and DHCP relay agent. It guarantees that DHCP clients obtain IP addresses from authorized DHCP servers. Also, it records IP-to-MAC bindings of DHCP clients (called DHCP snooping entries) for security purposes. DHCP snooping does not work between the DHCP server and DHCP relay agent. DHCP snooping defines trusted and untrusted ports to make sure clients obtain IP addresses only from authorized DHCP servers. Trusted A trusted port can forward DHCP messages correctly to make sure the clients get IP addresses from authorized DHCP servers. Untrusted An untrusted port discards received DHCP-ACK and DHCP-OFFER messages to prevent unauthorized servers from assigning IP addresses. DHCP snooping reads DHCP-ACK messages received from trusted ports and DHCP-REQUEST messages to create DHCP snooping entries. A DHCP snooping entry includes the MAC and IP addresses of a client, the port that connects to the DHCP client, and the VLAN. The following features need to use DHCP snooping entries: ARP detection Uses DHCP snooping entries to filter ARP packets from unauthorized clients. For more information, see Security Configuration Guide. IP source guard Uses DHCP snooping entries to filter illegal packets on a per-port basis. For more information, see Security Configuration Guide. Application of trusted and untrusted ports Configure ports facing the DHCP server as trusted ports, and configure other ports as untrusted ports. As shown in Figure 26, configure the DHCP snooping device's port that is connected to the DHCP server as a trusted port. The trusted port forwards response messages from the DHCP server to the client. The untrusted port connected to the unauthorized DHCP server discards incoming DHCP response messages. 67
81 Figure 26 Trusted and untrusted ports In a cascaded network as shown in Figure 27, configure each DHCP snooping device's ports connected to other DHCP snooping devices as trusted ports. To save system resources, you can disable the untrusted ports that are not directly connected to DHCP clients from generating DHCP snooping entries. Figure 27 Trusted and untrusted ports in a cascaded network DHCP client Host A GE1/0/1 DHCP snooping Switch A GE1/0/2 DHCP server GE1/0/1 Device GE1/0/4 GE1/0/2 GE1/0/1 DHCP client Host B GE1/0/3 GE1/0/3 DHCP snooping Switch C DHCP client Host C GE1/0/1 GE1/0/4 GE1/0/3 GE1/0/2 DHCP snooping Switch B DHCP client Host D Untrusted ports enabled to record snooping entries Untrusted ports disabled from recording snooping entries Trusted ports DHCP snooping support for Option 82 Option 82 records the location information about the DHCP client so the administrator can locate the DHCP client for security and accounting purposes. For more information about Option 82, see "Relay agent option (Option 82)." DHCP snooping uses the same strategies as the DHCP relay agent to handle Option 82 for DHCP request messages, as shown in Table 5. If a response returned by the DHCP server contains Option 82, DHCP snooping removes Option 82 before forwarding the response to the client. If the response contains no Option 82, DHCP snooping forwards it directly. 68
82 Table 5 Handling strategies If a DHCP request has Handling strategy Drop DHCP snooping Drops the message. Option 82 Keep Forwards the message without changing Option 82. Replace Forwards the message after replacing the original Option 82 with the Option 82 padded according to the configured padding format, padding content, and code type. No Option 82 N/A Forwards the message after adding the Option 82 padded according to the configured padding format, padding content, and code type. Feature and hardware compatibility This feature is supported only on the following models: MSR routers that hold an Layer 2 switching module. The built-in Layer 2 interfaces of the MSR1000, MSR and MSR routers. DHCP snooping configuration task list If you configure DHCP snooping settings on a Layer 2 Ethernet interface that has been added to an aggregation group, the settings do not take effect unless the interface is removed from the aggregation group. Tasks at a glance (Required.) Configuring basic DHCP snooping (Optional.) Configuring Option 82 (Optional.) Saving DHCP snooping entries (Optional.) Enabling DHCP starvation attack protection (Optional.) Enabling DHCP-REQUEST attack protection (Optional.) Setting the maximum number of DHCP snooping entries Configuring basic DHCP snooping Follow these guidelines when you configure basic DHCP snooping: Specify the ports connected to authorized DHCP servers as trusted ports to make sure that DHCP clients can obtain valid IP addresses. The trusted ports and the ports connected to DHCP clients must be in the same VLAN. Layer 2 Ethernet interfaces can be specified as trusted ports. DHCP snooping can work with QinQ to record VLAN tags for DHCP packets received from clients. For more information about QinQ, see Layer 2 LAN Switching Configuration Guide. 69
83 To configure basic DHCP snooping: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable DHCP snooping. dhcp snooping enable By default, DHCP snooping is disabled. 3. Enter interface view. 4. Specify the port as a trusted port. interface interface-type interface-number dhcp snooping trust This interface must connect to the DHCP server. By default, all ports are untrusted ports after DHCP snooping is enabled. 5. Return to system view. quit N/A 6. Enter interface view. 7. (Optional.) Enable recording of DHCP snooping entries. interface interface-type interface-number dhcp snooping binding record This interface must connect to the DHCP client. By default, after DHCP snooping is enabled, recording of DHCP snooping entries is disabled. Configuring Option 82 Follow these guidelines when you configure Option 82: If you configure Option 82 on a Layer 2 Ethernet interface that has been added to an aggregation group, the settings do not take effect unless the interface is removed from the aggregation group. To support Option 82, you must configure Option 82 on both the DHCP server and the DHCP snooping device. For information about configuring Option 82 on the DHCP server, see "Enabling handling of Option 82." If the handling strategy is configured as replace, you must configure a padding format for Option 82. If the handling strategy is keep or drop, there is no need to configure any padding format. If Option 82 contains the device name, the device name must contain no spaces. Otherwise, DHCP snooping drops the message. You can use the sysname command to specify the device name. For more information about this command, see Fundamentals Command Reference. DHCP snooping uses "outer VLAN tag.inner VLAN tag" to fill the VLAN ID field of sub-option 1 for Option 82 in verbose padding format if either of the following is true: DHCP snooping and QinQ work together. DHCP snooping receives a DHCP packet with two VLAN tags. For example, if the outer VLAN tag is 10 and the inner VLAN tag is 20, the VLAN ID field is 000a The hexadecimal digit a represents the outer VLAN tag 10, and the hexadecimal digit 14 represents the inner VLAN tag 20. The device name (sysname) must not include spaces if it is configured as the padding content for sub-option 1. Otherwise, the DHCP snooping device will fail to add or replace Option 82. To configure DHCP snooping to support Option 82: Step Command Remarks 1. Enter system view. system-view N/A 70
84 Step Command Remarks 2. Enter interface view. interface interface-type interface-number N/A 3. Enable DHCP snooping to support Option (Optional.) Configure a handling strategy for DHCP requests that contain Option 82. dhcp snooping information enable dhcp snooping information strategy { drop keep replace } By default, DHCP snooping does not support Option 82. By default, the handling strategy is replace. 5. (Optional.) Configure the padding content and code type for the Circuit ID sub-option. dhcp snooping information circuit-id { [ vlan vlan-id ] string circuit-id { normal verbose [ node-identifier { mac sysname user-defined node-identifier } ] } [ format { ascii hex } ] } By default, the padding format is normal and the code type is hex for the Circuit ID sub-option. 6. (Optional.) Configure the padding content and code type for the Remote ID sub-option. dhcp snooping information remote-id { normal [ format { ascii hex } ] [ vlan vlan-id ] string remote-id sysname } By default, the padding format is normal and the code type is hex for the Remote ID sub-option. Saving DHCP snooping entries DHCP snooping entries cannot survive a reboot. If the DHCP snooping device is rebooted, security features (such as IP source guard) that use DHCP snooping entries to authenticate users reject requests from clients until new entries are learned. To avoid this problem, you can save DHCP snooping entries in a file so that DHCP snooping can read DHCP snooping entries from this file during a reboot. NOTE: If you disable DHCP snooping with the undo dhcp snooping enable command, the device deletes all DHCP snooping entries, including those stored in the specified file. To save DHCP snooping entries: Step Command Remarks 1. Enter system view. system-view N/A 71
85 Step Command Remarks 2. Specify a file to save DHCP snooping entries. 3. (Optional.) Manually save DHCP snooping entries to the file. 4. (Optional.) Set the amount of time to wait after a DHCP snooping entry changes before updating the database file. dhcp snooping binding database filename { filename url url [ username username [ password { cipher simple } key ] ] } dhcp snooping binding database update now dhcp snooping binding database update interval seconds By default, no file is specified. This command enables the device to immediately save DHCP snooping entries to the specified database file. If the file does not exist, the device automatically creates the file. The device does not update the file for a specified amount of time after a DHCP snooping entry changes. The default period is 300 seconds. To change the value, use the dhcp snooping binding database update interval command. DHCP snooping entries are saved to the database file each time this command is executed. The default setting is 300 seconds. When a DHCP snooping entry is learned or removed, the device does not update the database file until after the specified waiting period. All changed entries during that period will be updated. Enabling DHCP starvation attack protection A DHCP starvation attack occurs when an attacker constantly sends forged DHCP requests that contain identical or different sender MAC addresses in the chaddr field to a DHCP server. This attack exhausts the IP address resources of the DHCP server so legitimate DHCP clients cannot obtain IP addresses. The DHCP server might also fail to work because of exhaustion of system resources. For information about the fields of DHCP packet, see "DHCP message format." Protect against starvation attacks in the following ways: To relieve a DHCP starvation attack that uses DHCP requests encapsulated with different sender MAC addresses, you can limit the number of MAC addresses that a Layer 2 port can learn by using the mac-address max-mac-count command. For more information about the command, see Layer 2 LAN Switching Command Reference. To prevent a DHCP starvation attack that uses DHCP requests encapsulated with the same sender MAC address, perform this task to enable MAC address check for DHCP snooping. This function compares the chaddr field of a received DHCP request with the source MAC address field in the frame header. If they are the same, the request is considered valid and forwarded to the DHCP server. If not, the request is discarded. To enable MAC address check: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. interface interface-type interface-number N/A 72
86 Step Command Remarks 3. Enable MAC address check. dhcp snooping check mac-address By default, MAC address check is disabled. Enabling DHCP-REQUEST attack protection DHCP-REQUEST messages include DHCP lease renewal packets, DHCP-DECLINE packets, and DHCP-RELEASE packets. This function prevents the unauthorized clients that forge the DHCP-REQUEST messages from attacking the DHCP server. Attackers can forge DHCP lease renewal packets to renew leases for legitimate DHCP clients that no longer need the IP addresses. These forged messages disable the victim DHCP server from releasing the IP addresses. Attackers can also forge DHCP-DECLINE or DHCP-RELEASE packets to terminate leases for legitimate DHCP clients that still need the IP addresses. To prevent such attacks, you can enable DHCP-REQUEST check. This feature uses DHCP snooping entries to check incoming DHCP-REQUEST messages. If a matching entry is found for a message, this feature compares the entry with the message information. If they are consistent, the message is considered as valid and forwarded to the DHCP server. If they are different, the message is considered as a forged message and is discarded. If no matching entry is found, the message is considered valid and forwarded to the DHCP server. To enable DHCP-REQUEST check: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Enable DHCP-REQUEST check. interface interface-type interface-number dhcp snooping check request-message N/A By default, DHCP-REQUEST check is disabled. You can enable DHCP-REQUEST check only on Layer 2 Ethernet interfaces. Setting the maximum number of DHCP snooping entries Perform this task to prevent the system resources from being overused. To set the maximum number of DHCP snooping entries: Step Command Remarks 1. Enter system view. system-view N/A 73
87 Step Command Remarks 2. Enter interface view. 3. Set the maximum number of DHCP snooping entries for the interface to learn. interface interface-type interface-number dhcp snooping max-learning-num number N/A By default, the number of DHCP snooping entries for an interface to learn is unlimited. Displaying and maintaining DHCP snooping Execute display commands in any view, and reset commands in user view. Task Command Remarks Display DHCP snooping entries. Display Option 82 configuration information on the DHCP snooping device. Display DHCP packet statistics on the DHCP snooping device (MSR1000/MSR2000/MSR3000). Display DHCP packet statistics on the DHCP snooping device (MSR4000). Display information about trusted ports. Display information about the file that stores DHCP snooping entries. Clear DHCP snooping entries. Clear DHCP packet statistics on the DHCP snooping device (MSR1000/MSR2000/MSR3000). Clear DHCP packet statistics on the DHCP snooping device (MSR4000). display dhcp snooping binding [ ip ip-address [ vlan vlan-id ] ] display dhcp snooping information { all interface interface-type interface-number } display dhcp snooping packet statistics display dhcp snooping packet statistics [ slot slot-number ] display dhcp snooping trust display dhcp snooping binding database reset dhcp snooping binding { all ip ip-address [ vlan vlan-id ] } reset dhcp snooping packet statistics reset dhcp snooping packet statistics [ slot slot-number ] Available in any view. Available in any view. Available in any view. Available in any view. Available in any view. Available in any view. Available in user view. Available in user view. Available in user view. DHCP snooping configuration examples Basic DHCP snooping configuration example Network requirements As shown in Figure 28: Configure the port GigabitEthernet 2/1/1 connected to the DHCP server as a trusted port. Configure other ports as untrusted ports. 74
88 Enable DHCP snooping to record clients' IP-to-MAC bindings by reading DHCP-ACK messages received from the trusted port and DHCP-REQUEST messages. Figure 28 Network diagram Configuration procedure # Enable DHCP snooping. <RouterB> system-view [RouterB] dhcp snooping enable # Configure GigabitEthernet 2/1/1 as a trusted port. [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] dhcp snooping trust [RouterB-GigabitEthernet2/1/1] quit # Enable DHCP snooping to record clients' IP-to-MAC bindings on GigabitEthernet 2/1/2. [RouterB] interface gigabitethernet 2/1/2 [RouterB-GigabitEthernet2/1/2] dhcp snooping binding record [RouterB-GigabitEthernet2/1/2] quit Verifying the configuration The DHCP client can obtain an IP address and other configuration parameters only from the authorized DHCP server. You can display the DHCP snooping entry recorded for the client with the display dhcp snooping binding command. Option 82 configuration example Network requirements As shown in Figure 29, enable DHCP snooping and configure Option 82 on Router B as follows: Configure the handling strategy for DHCP requests that contain Option 82 as replace. On GigabitEthernet 2/1/2, configure the padding content for the Circuit ID sub-option as company001 and for the Remote ID sub-option as device001. On GigabitEthernet 2/1/3, configure the padding format for the Circuit ID sub-option as verbose, access node identifier as sysname, and code type as ascii, and configure the padding content for the Remote ID sub-option as device
89 Figure 29 Network diagram Configuration procedure # Enable DHCP snooping. <RouterB> system-view [RouterB] dhcp snooping enable # Configure GigabitEthernet 2/1/1 as a trusted port. [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] dhcp snooping trust [RouterB-GigabitEthernet2/1/1] quit # Configure Option 82 on GigabitEthernet 2/1/2. [RouterB] interface gigabitethernet 2/1/2 [RouterB-GigabitEthernet2/1/2] dhcp snooping information enable [RouterB-GigabitEthernet2/1/2] dhcp snooping information strategy replace [RouterB-GigabitEthernet2/1/2] dhcp snooping information circuit-id string company001 [RouterB-GigabitEthernet2/1/2] dhcp snooping information remote-id string device001 [RouterB-GigabitEthernet2/1/2] quit # Configure Option 82 on GigabitEthernet 2/1/3. [RouterB] interface gigabitethernet 2/1/3 [RouterB-GigabitEthernet2/1/3] dhcp snooping information enable [RouterB-GigabitEthernet2/1/3] dhcp snooping information strategy replace [RouterB-GigabitEthernet2/1/3] dhcp snooping information circuit-id verbose node-identifier sysname format ascii [RouterB-GigabitEthernet2/1/3] dhcp snooping information remote-id string device001 Verifying the configuration Use the display dhcp snooping information command to display Option 82 configuration information on GigabitEthernet 2/1/2 and GigabitEthernet 2/1/3 on the DHCP snooping device. 76
90 Configuring the BOOTP client BOOTP client configuration only applies to Layer 3 Ethernet interfaces (including subinterfaces), Layer 3 aggregate interfaces and VLAN interfaces. If several VLAN interfaces sharing the same MAC address obtain IP addresses through a BOOTP relay agent, the BOOTP server cannot be a Windows Server 2000 or Windows Server BOOTP application An interface that acts as a BOOTP client can use BOOTP to obtain information (such as IP address) from the BOOTP server. To use BOOTP, an administrator must configure a BOOTP parameter file for each BOOTP client on the BOOTP server. The parameter file contains information such as MAC address and IP address of a BOOTP client. When a BOOTP client sends a request to the BOOTP server, the BOOTP server searches for the BOOTP parameter file and returns the corresponding configuration information. BOOTP is usually used in relatively stable environments. In network environments that change frequently, DHCP is more suitable. Because a DHCP server can interact with a BOOTP client, you can use the DHCP server to configure an IP address for the BOOTP client, without any BOOTP server. Obtaining an IP address dynamically A BOOTP client dynamically obtains an IP address from a BOOTP server as follows: 1. The BOOTP client broadcasts a BOOTP request, which contains its own MAC address. 2. The BOOTP server receives the request and searches the configuration file for the IP address and other information according to the MAC address of the BOOTP client. 3. The BOOTP server returns a BOOTP response to the BOOTP client. 4. The BOOTP client obtains the IP address from the received response. A DHCP server can take the place of the BOOTP server in the following dynamic IP address acquisition. Protocols and standards RFC 951, Bootstrap Protocol (BOOTP) RFC 2132, DHCP Options and BOOTP Vendor Extensions RFC 1542, Clarifications and Extensions for the Bootstrap Protocol 77
91 Configuring an interface to use BOOTP for IP address acquisition Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Configure an interface to use BOOTP for IP address acquisition. interface interface-type interface-number ip address bootp-alloc N/A By default, an interface does not use BOOTP for IP address acquisition. Displaying and maintaining BOOTP client Execute display command in any view. Task Display BOOTP client information. Command display bootp client [ interface interface-type interface-number ] BOOTP client configuration example Network requirements As shown in Figure 17, GigabitEthernet 2/1/1 of Router B connects to the LAN to obtain an IP address from the DHCP server by using BOOTP. To make the BOOTP client obtain an IP address from the DHCP server, perform configuration on the DHCP server. For more information, see "DHCP server configuration examples." Configuration procedure The following describes only the configuration on Router B serving as a client. # Configure GigabitEthernet 2/1/1 to use BOOTP to obtain an IP address. <RouterB> system-view [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] ip address bootp-alloc # Use the display bootp client command to display the IP address assigned to the BOOTP client. 78
92 Configuring DNS Overview Domain Name System (DNS) is a distributed database used by TCP/IP applications to translate domain names into IP addresses. The domain name-to-ip address mapping is called a DNS entry. DNS services can be static or dynamic. After a user specifies a name, the device checks the static name resolution table for an IP address. If no IP address is available, it contacts the DNS server for dynamic name resolution, which takes more time than static name resolution. To improve efficiency, you can put frequently queried name-to-ip address mappings in the local static name resolution table. Static domain name resolution Static domain name resolution means manually creating mappings between domain names and IP addresses. For example, you can create a static DNS mapping for a device so that you can Telnet to the device by using the domain name. Dynamic domain name resolution Resolution process 1. A user program sends a name query to the resolver of the DNS client. 2. The DNS resolver looks up the local domain name cache for a match. If the resolver finds a match, it sends the corresponding IP address back. If not, it sends a query to the DNS server. 3. The DNS server looks up the corresponding IP address of the domain name in its DNS database. If no match is found, the server sends a query to other DNS servers. This process continues until a result, whether successful or not, is returned. 4. After receiving a response from the DNS server, the DNS client returns the resolution result to the user program. Figure 30 shows the relationship between the user program, DNS client, and DNS server. The DNS client includes the resolver and cache. The user program and DNS client can run on the same device or different devices, but the DNS server and the DNS client usually run on different devices. 79
93 Figure 30 Dynamic domain name resolution User program Request Response Resolver Request Response DNS server Read Save Cache DNS client DNS suffixes Dynamic domain name resolution allows the DNS client to store latest DNS entries in the dynamic domain name cache. The DNS client does not need to send a request to the DNS server for a repeated query within the aging time. To make sure the entries from the DNS server are up to date, a DNS entry is removed when its aging timer expires. The DNS server determines how long a mapping is valid, and the DNS client obtains the aging information from DNS responses. You can configure a domain name suffix list so that the resolver can use the list to supply the missing part of an incomplete name. For example, you can configure com as the suffix for aabbcc.com. The user only needs to enter aabbcc to obtain the IP address of aabbcc.com because the resolver adds the suffix and delimiter before passing the name to the DNS server. The name resolver handles the queries based on the domain names that the user enters: If the user enters a domain name without a dot (.) (for example, aabbcc), the resolver considers the domain name a host name and adds a DNS suffix before performing the query operation. If no match is found for the domain names with any configured suffix, the resolver uses the user entered domain name (for example, aabbcc) to query the IP address. If the user enters a domain name with a dot (.) among the letters (for example, the resolver directly uses this domain name for the query operation. If the query fails, the resolver adds a DNS suffix for another query operation. If the user enters a domain name with a dot (.) at the end (for example, aabbcc.com.), the resolver considers the domain name an FQDN and returns the successful or failed query result. The dot at the end of the domain name is considered a terminating symbol. The device supports static and dynamic DNS client services. If an alias is configured for a domain name on the DNS server, the device can resolve the alias into the IP address of the host. DNS proxy As shown in Figure 31, the DNS proxy performs the following operations: Forwards the request from the DNS client to the designated DNS server. Conveys the reply from the DNS server to the client. 80
94 The DNS proxy simplifies network management. When the DNS server address is changed, you can change the configuration on only the DNS proxy instead of on each DNS client. Figure 31 DNS proxy application A DNS proxy operates as follows: 1. A DNS client considers the DNS proxy as the DNS server, and sends a DNS request to the DNS proxy. The destination address of the request is the IP address of the DNS proxy. 2. The DNS proxy searches the local static domain name resolution table and dynamic domain name resolution cache after receiving the request. If the requested information is found, the DNS proxy returns a DNS reply to the client. 3. If the requested information is not found, the DNS proxy sends the request to the designated DNS server for domain name resolution. 4. After receiving a reply from the DNS server, the DNS proxy records the IP address-to-domain name mapping and forwards the reply to the DNS client. If no DNS server is designated or no route is available to the designated DNS server, the DNS proxy does not forward DNS requests. DNS spoofing DNS spoofing is applied to the dial-up network, as shown in Figure 32. The device connects to a PSTN/ISDN network through a dial-up interface. The device triggers the establishment of a dial-up connection only when packets are to be forwarded through the dial-up interface. The device serves as a DNS proxy and is specified as a DNS server on the hosts. After the dial-up connection is established, the device dynamically obtains the DNS server address through DHCP or another autoconfiguration mechanism. 81
95 Figure 32 DNS spoofing application The DNS proxy does not have the DNS server address or cannot reach the DNS server after startup. A host accesses the HTTP server in the following steps: 1. The host sends a DNS request to the device to resolve the domain name of the HTTP server into an IP address. 2. Upon receiving the request, the device searches the local static and dynamic DNS entries for a match. Because no match is found, the device spoofs the host by replying a configured IP address. The device must have a route to the IP address with the dial-up interface as the output interface. The IP address configured for DNS spoofing is not the actual IP address of the requested domain name. Therefore, the TTL field is set to 0 in the DNS reply. When the DNS client receives the reply, it creates a DNS entry and ages it out immediately. 3. Upon receiving the reply, the host sends an HTTP request to the replied IP address. 4. When forwarding the HTTP request through the dial-up interface, the device performs the following operations: Establishes a dial-up connection with the network. Dynamically obtains the DNS server address through DHCP or another autoconfiguration mechanism. 5. Because the DNS entry ages out immediately upon creation, the host sends a DNS request to the device again to resolve the HTTP server domain name into an IP address. 6. The device operates the same as a DNS proxy. For more information, see "DNS proxy." 7. After obtaining the IP address of the HTTP server, the host can access the HTTP server. Without DNS spoofing, the device forwards the DNS requests from the host to the DNS server if it cannot find a matching local DNS entry. However, the device cannot obtain the DNS server address, because no dial-up connection is established. Therefore, the device cannot forward or answer the requests from the client. DNS resolution fails, and the client cannot access the HTTP server. DNS configuration task list Tasks at a glance Perform one of the following tasks: Configuring the IPv4 DNS client Configuring the IPv6 DNS client 82
96 Tasks at a glance (Optional.) Configuring the DNS proxy (Optional.) Configuring DNS spoofing (Optional.) Specifying the source interface for DNS packets (Optional.) Configuring the DNS trusted interface (Optional.) Setting the DSCP value for outgoing DNS packets Configuring the IPv4 DNS client Configuring static domain name resolution Static domain name resolution allows applications such as Telnet to contact hosts by using host names instead of IPv4 addresses. Follow these guidelines when you configure static domain name resolution: On the public network or a VPN, each host name maps to only one IPv4 address. The most recent configuration for a host name takes effect. You can configure the following: IPv4 DNS entries for the public network and up to 1024 VPNs. A maximum of 1024 IPv4 DNS entries for the public network or each VPN. To configure static domain name resolution: Step Command Remarks 1. Enter system view. system-view N/A 2. Configure a mapping between a host name and an IPv4 address. ip host host-name ip-address [ vpn-instance vpn-instance-name ] By default, no mapping between a host name and an IPv4 address is configured. Configuring dynamic domain name resolution To use dynamic domain name resolution, configure DNS servers so that DNS queries can be sent to a correct server for resolution. A DNS server manually configured takes precedence over the one dynamically obtained through DHCP, and a DNS server configured earlier takes precedence. A name query is first sent to the DNS server that has the highest priority. If no reply is received, it is sent to the DNS server that has the second highest priority, and so on. In addition, you can configure a DNS suffix that the system automatically adds to the provided domain name for resolution. A DNS suffix manually configured takes precedence over the one dynamically obtained through DHCP, and a DNS suffix configured earlier takes precedence. The DNS resolver first uses the suffix that has the highest priority. If the name resolution fails, the DNS resolver uses the suffix that has the second highest priority, and so on. 83
97 Configuration guidelines Follow these guidelines when you configure dynamic domain name resolution: You can specify DNS server IPv4 addresses as follows: Specify DNS server IPv4 addresses for the public network and up to 1024 VPNs. Specify a maximum of six DNS server IPv4 addresses for the public network or each VPN. You can specify DNS server IPv6 addresses as follows: Specify DNS server IPv6 addresses for the public network and up to 1024 VPNs. Specify a maximum of six DNS server IPv6 addresses for the public network or each VPN. An IPv4 name query is first sent to the DNS server IPv4 addresses. If no reply is received, it is sent to the DNS server IPv6 addresses. You can specify DNS suffixes as follows: Specify DNS suffixes for the public network and up to 1024 VPNs. Specify a maximum of 16 DNS suffixes for the public network or each VPN. Configuration procedure To configure dynamic domain name resolution: Step Command Remarks 1. Enter system view. system-view N/A 2. Specify a DNS server IP address. 3. (Optional.) Configure a DNS suffix. Specify a DNS server IPv4 address: dns server ip-address [ vpn-instance vpn-instance-name ] Specify a DNS server IPv6 address: ipv6 dns server ipv6-address [ interface-type interface-number ] [ vpn-instance vpn-instance-name ] dns domain domain-name [ vpn-instance vpn-instance-name ] Use at least one command. By default, no DNS server IP address is specified. By default, no DNS suffix is configured and only the provided domain name is resolved. Configuring the IPv6 DNS client Configuring static domain name resolution Static domain name resolution allows applications such as Telnet to contact hosts by using host names instead of IPv6 addresses. Follow these guidelines when you configure static domain name resolution: For the public network or a VPN, each host name maps to only one IPv6 address. The last configuration for a host name takes effect. You can configure the following: IPv6 DNS entries for the public network and up to 1024 VPNs. A maximum of 1024 IPv6 DNS entries for the public network or each VPN. 84
98 To configure static domain name resolution: Step Command Remarks 1. Enter system view. system-view N/A 2. Configure a mapping between a host name and an IPv6 address. ipv6 host host-name ipv6-address [ vpn-instance vpn-instance-name ] By default, no mapping between a host name and an IPv6 address is configured. Configuring dynamic domain name resolution To send DNS queries to a correct server for resolution, you must enable dynamic domain name resolution and configure DNS servers. A DNS server manually configured takes precedence over the one dynamically obtained through DHCP, and a DNS server configured earlier takes precedence. A name query is first sent to the DNS server that has the highest priority. If no reply is received, it is sent to the DNS server that has the second highest priority, and so on. In addition, you can configure a DNS suffix that the system automatically adds to the provided domain name for resolution. A DNS suffix manually configured takes precedence over the one dynamically obtained through DHCP, and a DNS suffix configured earlier takes precedence. The DNS resolver first uses the suffix that has the highest priority. If the name resolution fails, the DNS resolver uses the suffix that has the second highest priority, and so on. Configuration guidelines Follow these guidelines when you configure dynamic domain name resolution: You can specify DNS server IPv4 addresses as follows: Specify DNS server IPv4 addresses for the public network and up to 1024 VPNs. Specify a maximum of six DNS server IPv4 addresses for the public network or each VPN. You can specify DNS server IPv6 addresses as follows: Specify DNS server IPv6 addresses for the public network and up to 1024 VPNs. Specify a maximum of six DNS server IPv6 addresses for the public network or each VPN. An IPv6 name query is first sent to the IPv6 DNS servers. If no reply is received, it is sent to the IPv4 DNS servers. You can specify DNS suffixes as follows: Configuration procedure Specify DNS suffixes for the public network and up to 1024 VPNs. Specify a maximum of 16 DNS suffixes for the public network or each VPN. To configure dynamic domain name resolution: Step Command Remarks 1. Enter system view. system-view N/A 85
99 Step Command Remarks 2. Specify a DNS server IP address. 3. (Optional.) Configure a DNS suffix. Specify a DNS server IPv4 address: dns server ip-address [ vpn-instance vpn-instance-name ] Specify a DNS server IPv6 address: ipv6 dns server ipv6-address [ interface-type interface-number ] [ vpn-instance vpn-instance-name ] dns domain domain-name [ vpn-instance vpn-instance-name ] Use at least one command. By default, no DNS server IP address is specified. By default, no DNS suffix is configured. Only the provided domain name is resolved. Configuring the DNS proxy You can specify multiple DNS servers. The DNS proxy forwards a request to the DNS server that has the highest priority. If having not received a reply, it forwards the request to a DNS server that has the second highest priority, and so on. A DNS proxy forwards an IPv4 name query first to IPv4 DNS servers, and if no reply is received, it forwards the request to IPv6 DNS servers. The DNS proxy forwards an IPv6 name query first to IPv6 DNS servers, and if no reply is received, it forwards the request to IPv4 DNS servers. To configure the DNS proxy: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable DNS proxy. dns proxy enable By default, DNS proxy is disabled. 3. Specify a DNS server IP address. Specify a DNS server IPv4 address: dns server ip-address [ vpn-instance vpn-instance-name ] Specify a DNS server IPv6 address: ipv6 dns server ipv6-address [ interface-type interface-number ] [ vpn-instance vpn-instance-name ] Use at least one command. By default, no DNS server IP address is specified. Configuring DNS spoofing DNS spoofing is effective only when: The DNS proxy is enabled on the device. No DNS server or route to any DNS server is specified on the device. Follow these guidelines when you configure DNS spoofing: You can configure only one replied IPv4 address and one replied IPv6 address for the public network or a VPN. If you use the command multiple times, the most recent configuration takes effect. You can configure DNS spoofing for the public network and a maximum of 1024 VPNs. To configure DNS spoofing: 86
100 Step Command Remarks 1. Enter system view. system-view N/A 2. Enable DNS proxy. dns proxy enable By default, DNS proxy is disabled. 3. Enable DNS spoofing and specify the translated IP address. Specify a translated IPv4 address: dns spoofing ip-address [ vpn-instance vpn-instance-name ] Specify a translated IPv6 address: ipv6 dns spoofing ipv6-address [ vpn-instance vpn-instance-name ] Use at least one command. By default, no translated IP address is specified. Specifying the source interface for DNS packets This task enables the device to always use the primary IP address of the specified source interface as the source IP address of outgoing DNS packets. This feature applies to scenarios in which the DNS server responds to only DNS requests sourced from a specific IP address. If no IP address is configured on the source interface, no DNS packets can be sent out. When sending an IPv6 DNS request, the device follows the method defined in RFC 3484 to select an IPv6 address of the source interface. You can configure only one source interface on the public network or a VPN. You can configure the source interface for the public network and a maximum of 1024 VPNs. To specify the source interface for DNS packets: Step Command Remarks 1. Enter system view. system-view N/A By default, no source interface for DNS packets is specified. 2. Specify the source interface for DNS packets. dns source-interface interface-type interface-number [ vpn-instance vpn-instance-name ] If you execute the command multiple times, the most recent configuration takes effect. If you specify the vpn-instance vpn-instance-name option, make sure the source interface is on the specified VPN. Configuring the DNS trusted interface By default, an interface obtains DNS suffix and domain name server information from DHCP. The network attacker might act as the DHCP server to assign wrong DNS suffix and domain name server address to the device. As a result, the device fails to get the resolved IP address or might get the wrong IP address. With the DNS trusted interface specified, the device only uses the DNS suffix and domain name server information obtained through the trusted interface to avoid attack. To configure the DNS trusted interface: 87
101 Step Command Remarks 1. Enter system view. system-view N/A 2. Specify the DNS trusted interface. dns trust-interface interface-type interface-number By default, no DNS trusted interface is specified. You can configure up to 128 DNS trusted interfaces. Setting the DSCP value for outgoing DNS packets The DSCP value of a packet specifies the priority level of the packet and affects the transmission priority of the packet. A bigger DSCP value represents a higher priority. To set the DSCP value for outgoing DNS packets: Step Command Remarks 1. Enter system view. system-view N/A 2. Set the DSCP value for outgoing DNS packets. DSCP value for IPv4 DNS packets: dns dscp dscp-value DSCP value for IPv6 DNS packets: ipv6 dns dscp dscp-value By default, the DSCP value for outgoing DNS packets is 0. The configuration is available on DNS clients and DNS proxy devices. Displaying and maintaining IPv4 DNS Execute display commands in any view and reset commands in user view. Task Display the domain name resolution table. Command display dns host [ ip ipv6 ] [ vpn-instance vpn-instance-name ] Display IPv4 DNS server information. display dns server [ dynamic ] [ vpn-instance vpn-instance-name ] Display IPv6 DNS server information. display ipv6 dns server [ dynamic ] [ vpn-instance vpn-instance-name ] Display DNS suffixes. display dns domain [ dynamic ] [ vpn-instance vpn-instance-name ] Clear information about the dynamic domain name cache. reset dns host [ ip ipv6 ] [ vpn-instance vpn-instance-name ] 88
102 IPv4 DNS configuration examples Static domain name resolution configuration example Network requirements As shown in Figure 33, the device wants to access the host by using an easy-to-remember domain name rather than an IP address. Configure static domain name resolution on the device so that the device can use the domain name host.com to access the host whose IP address is Figure 33 Network diagram Configuration procedure # Configure a mapping between host name host.com and IP address <Sysname> system-view [Sysname] ip host host.com # Use the ping host.com command to verify that the device can use static domain name resolution to resolve domain name host.com into IP address [Sysname] ping host.com Ping host.com ( ): 56 data bytes, press CTRL_C to break 56 bytes from : icmp_seq=0 ttl=255 time=1.000 ms 56 bytes from : icmp_seq=1 ttl=255 time=1.000 ms 56 bytes from : icmp_seq=2 ttl=255 time=1.000 ms 56 bytes from : icmp_seq=3 ttl=255 time=1.000 ms 56 bytes from : icmp_seq=4 ttl=255 time=2.000 ms --- Ping statistics for host.com packet(s) transmitted, 5 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 1.000/1.200/2.000/0.400 ms Dynamic domain name resolution configuration example Network requirements As shown in Figure 34, the device wants to do the following: Access the host by using an easy-to-remember domain name rather than an IP address. Ask the DNS server on the network for an IP address by using dynamic domain name resolution. The IP address of the DNS server is /16 and the DNS server has a com domain, which stores the mapping between domain name host and IP address /16. 89
103 Configure dynamic DNS and the DNS suffix com on the device that serves as a DNS client. The device can then use the domain name host to access the host with the domain name host.com and the IP address /16. Figure 34 Network diagram Configuration procedure Before performing the following configuration, make sure that: The device and the host can reach each other. The IP addresses of the interfaces are configured as shown in Figure Configure the DNS server: The configuration might vary by DNS server. The following configuration is performed on a PC running Windows Server a. Select Start > Programs > Administrative Tools > DNS. The DNS server configuration page appears, as shown in Figure 35. b. Right-click Forward Lookup Zones, select New Zone, and then follow the wizard to create a new zone named com. Figure 35 Creating a zone c. On the DNS server configuration page, right-click zone com, and select New Host. 90
104 Figure 36 Adding a host d. On the page that appears, enter host name host and IP address e. Click Add Host. The mapping between the IP address and host name is created. Figure 37 Adding a mapping between domain name and IP address 2. Configure the DNS client: 91
105 Verifying the configuration # Specify the DNS server <Sysname> system-view [Sysname] dns server # Specify com as the name suffix. [Sysname] dns domain com # Use the ping host command on the device to verify that the communication between the device and the host is normal and that the translated destination IP address is [Sysname] ping host Ping host.com ( ): 56 data bytes, press CTRL_C to break 56 bytes from : icmp_seq=0 ttl=255 time=1.000 ms 56 bytes from : icmp_seq=1 ttl=255 time=1.000 ms 56 bytes from : icmp_seq=2 ttl=255 time=1.000 ms 56 bytes from : icmp_seq=3 ttl=255 time=1.000 ms 56 bytes from : icmp_seq=4 ttl=255 time=2.000 ms --- Ping statistics for host packet(s) transmitted, 5 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 1.000/1.200/2.000/0.400 ms DNS proxy configuration example Network requirements When the IP address of the DNS server changes, you must configure the new IPv6 address of the DNS server on each device on the LAN. To simplify network management, you can use the DNS proxy function. As shown in Figure 38: Specify Device A as the DNS server of Device B (the DNS client). Device A acts as a DNS proxy. The IPv6 address of the real DNS server is Configure the IP address of the DNS proxy on Device B. DNS requests of Device B are forwarded to the real DNS server through the DNS proxy. 92
106 Figure 38 Network diagram Configuration procedure Before performing the following configuration, make sure that: Device A, the DNS server, and the host can reach each other. The IPv6 addresses of the interfaces are configured as shown in Figure Configure the DNS server: The configuration might vary by DNS server. When a PC running Windows Server 2000 acts as the DNS server, see "Dynamic domain name resolution configuration example" for configuration information. 2. Configure the DNS proxy: # Specify the DNS server <DeviceA> system-view [DeviceA] dns server # Enable DNS proxy. [DeviceA] dns proxy enable 3. Configure the DNS client: <DeviceB> system-view # Specify the DNS server [DeviceB] dns server Verifying the configuration # Use the ping host.com command on Device B to verify the connection between the device and the host is normal and that the translated destination IP address is [DeviceB] ping host.com Ping host.com ( ): 56 data bytes, press CTRL_C to break 56 bytes from : icmp_seq=0 ttl=255 time=1.000 ms 56 bytes from : icmp_seq=1 ttl=255 time=1.000 ms 56 bytes from : icmp_seq=2 ttl=255 time=1.000 ms 56 bytes from : icmp_seq=3 ttl=255 time=1.000 ms 56 bytes from : icmp_seq=4 ttl=255 time=2.000 ms 93
107 --- Ping statistics for host.com packet(s) transmitted, 5 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 1.000/1.200/2.000/0.400 ms IPv6 DNS configuration examples Static domain name resolution configuration example Network requirements As shown in Figure 39, the device wants to access the host by using an easy-to-remember domain name rather than an IPv6 address. Configure static domain name resolution on the device so that the device can use the domain name host.com to access the host whose IPv6 address is 1::2. Figure 39 Network diagram Configuration procedure # Configure a mapping between host name host.com and IPv6 address 1::2. <Device> system-view [Device] ipv6 host host.com 1::2 # Use the ping ipv6 host.com command to verify that the device can use static domain name resolution to resolve domain name host.com into IPv6 address 1::2. [Sysname] ping ipv6 host.com Ping6(56 data bytes) 1::1 --> 1::2, press CTRL_C to break 56 bytes from 1::2, icmp_seq=0 hlim=128 time=1.000 ms 56 bytes from 1::2, icmp_seq=1 hlim=128 time=0.000 ms 56 bytes from 1::2, icmp_seq=2 hlim=128 time=1.000 ms 56 bytes from 1::2, icmp_seq=3 hlim=128 time=1.000 ms 56 bytes from 1::2, icmp_seq=4 hlim=128 time=0.000 ms --- Ping6 statistics for host.com packet(s) transmitted, 5 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.000/0.600/1.000/0.490 ms Dynamic domain name resolution configuration example Network requirements As shown in Figure 40, the device wants to access the host by using an easy-to-remember domain name rather than an IPv6 address. The IPv6 address of the DNS server is 2::2/64. The server has a com domain, which stores the mapping between domain name host and IPv6 address 1::1/64. Configure dynamic DNS and the DNS suffix com on the device that serves as a DNS client. The device can then use domain name host to access the host with the domain name host.com and the IPv6 address 1::1/64. 94
108 Figure 40 Network diagram Configuration procedure Before performing the following configuration, make sure that: The device and the host can reach each other. The IPv6 addresses of the interfaces are configured as shown in Figure Configure the DNS server: The configuration might vary by DNS server. The following configuration is performed on a PC running Windows Server Make sure that the DNS server supports the IPv6 DNS function so that the server can process IPv6 DNS packets and the interfaces of the DNS server can forward IPv6 packets. a. Select Start > Programs > Administrative Tools > DNS. The DNS server configuration page appears, as shown in Figure 41. b. Right-click Forward Lookup Zones, select New Zone, and then follow the wizard to create a new zone named com. Figure 41 Creating a zone c. On the DNS server configuration page, right-click zone com, and select Other New Records. 95
109 Figure 42 Creating a record d. On the page that appears, select IPv6 Host (AAAA) as the resource record type. 96
110 Figure 43 Selecting the resource record type e. Type host name host and IPv6 address 1::1. f. Click OK. The mapping between the IPv6 address and host name is created. 97
111 Figure 44 Adding a mapping between domain name and IPv6 address 2. Configure the DNS client: # Specify the DNS server 2::2. <Device> system-view [Device] ipv6 dns server 2::2 # Configure com as the DNS suffix. [Device] dns domain com Verifying the configuration # Use the ping ipv6 host command on the device to verify that the communication between the device and the host is normal and that the translated destination IP address is 1::1. [Device] ping ipv6 host Ping6(56 data bytes) 3::1 --> 1::1, press CTRL_C to break 56 bytes from 1::1, icmp_seq=0 hlim=128 time=1.000 ms 56 bytes from 1::1, icmp_seq=1 hlim=128 time=0.000 ms 56 bytes from 1::1, icmp_seq=2 hlim=128 time=1.000 ms 56 bytes from 1::1, icmp_seq=3 hlim=128 time=1.000 ms 56 bytes from 1::1, icmp_seq=4 hlim=128 time=0.000 ms --- Ping6 statistics for host packet(s) transmitted, 5 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.000/0.600/1.000/0.490 ms 98
112 DNS proxy configuration example Network requirements When the IP address of the DNS server changes, you must configure the new IP address of the DNS server on each device on the LAN. To simplify network management, you can use the DNS proxy function. As shown in Figure 45: Specify Device A as the DNS server of Device B (the DNS client). Device A acts as a DNS proxy. The IP address of the real DNS server is 4000::1. Configure the IP address of the DNS proxy on Device B. DNS requests of Device B are forwarded to the real DNS server through the DNS proxy. Figure 45 Network diagram Configuration procedure Before performing the following configuration, make sure that: Device A, the DNS server, and the host are reachable to each other. The IP addresses of the interfaces are configured as shown in Figure Configure the DNS server: This configuration might vary by DNS server. When a PC running Windows Server 2003 acts as the DNS server, see "Dynamic domain name resolution configuration example" for configuration information. 2. Configure the DNS proxy: # Specify the DNS server 4000::1. <DeviceA> system-view [DeviceA] ipv6 dns server 4000::1 # Enable DNS proxy. [DeviceA] dns proxy enable 3. Configure the DNS client: # Specify the DNS server 2000::2. <DeviceB> system-view 99
113 Verifying the configuration [DeviceB] ipv6 dns server 2000::2 # Use the ping host.com command on Device B to verify that the connection between the device and the host is normal and that the translated destination IP address is 3000::1. [DeviceB] ping host.com Ping6(56 data bytes) 2000::1 --> 3000::1, press CTRL_C to break 56 bytes from 3000::1, icmp_seq=0 hlim=128 time=1.000 ms 56 bytes from 3000::1, icmp_seq=1 hlim=128 time=0.000 ms 56 bytes from 3000::1, icmp_seq=2 hlim=128 time=1.000 ms 56 bytes from 3000::1, icmp_seq=3 hlim=128 time=1.000 ms 56 bytes from 3000::1, icmp_seq=4 hlim=128 time=0.000 ms --- Ping6 statistics for host.com packet(s) transmitted, 5 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.000/0.600/1.000/0.490 ms Troubleshooting IPv4 DNS configuration Symptom Solution After enabling dynamic domain name resolution, the user cannot get the correct IP address. 1. Use the display dns host ip command to verify that the specified domain name is in the cache. 2. If the specified domain name does not exist, check that the DNS client can communicate with the DNS server. 3. If the specified domain name is in the cache, but the IP address is incorrect, check that the DNS client has the correct IP address of the DNS server. 4. Verify that the mapping between the domain name and IP address is correct on the DNS server. Troubleshooting IPv6 DNS configuration Symptom Solution After enabling dynamic domain name resolution, the user cannot get the correct IPv6 address. 1. Use the display dns host ipv6 command to verify that the specified domain name is in the cache. 2. If the specified domain name does not exist, check that dynamic domain name resolution is enabled, and that the DNS client can communicate with the DNS server. 3. If the specified domain name is in the cache, but the IPv6 address is incorrect, check that the DNS client has the correct IPv6 address of the DNS server. 100
114 4. Verify that the mapping between the domain name and IPv6 address is correct on the DNS server. 101
115 Configuring DDNS Overview DNS provides only the static mappings between domain names and IP addresses. When the IP address of a node changes, your access to the node fails. Dynamic Domain Name System (DDNS) can dynamically update the mappings between domain names and IP addresses for DNS servers. DDNS is supported by only IPv4 DNS, and it is used to update the mappings between domain names and IPv4 addresses. DDNS application As shown in Figure 46, DDNS works on the client-server model. DDNS client A device that needs to update the mapping between its domain name and its IP address dynamically on the DNS server when its IP address changes. An Internet user typically accesses an application layer server such as an HTTP server or an FTP server by using the server's domain name. When its IP address changes, the application layer server runs as a DDNS client. It sends a request to the DDNS server for updating the mapping between its domain name and its IP address. DDNS server Informs the DNS server of latest mappings. When receiving the mapping update request from a DDNS client, the DDNS server tells the DNS server to re-map the domain name and the IP address of the DDNS client. Therefore, the Internet users can use the same domain name to access the DDNS client even if the IP address of the DDNS client has changed. Figure 46 DDNS application DNS server IP network HTTP server DDNS client HTTP client DDNS server With the DDNS client configured, a device can dynamically update the latest mapping between its domain name and IP address on the DNS server through DDNS servers. 102
116 NOTE: The DDNS update process does not have a unified standard but varies by DDNS server that the DDNS client contacts. DDNS client configuration task list Tasks at a glance (Required.) Configuring a DDNS policy (Required.) Applying the DDNS policy to an interface (Optional.) Setting the DSCP value for outgoing DDNS packets Configuring a DDNS policy A DDNS policy contains the DDNS server address, port number, login ID, password, time interval, associated SSL client policy, and update time interval. After creating a DDNS policy, you can apply it to multiple interfaces to simplify DDNS configuration. The URL addresses configured for update requests vary by DDNS server. Table 6 Common URL addresses DDNS server ( DYNDNS DYNS ZONEEDIT TZO EASYDNS HEIPV6TB CHANGE-IP NO-IP DHS HP ODS GNUDIP PeanutHull URL addresses for DDNS update requests a> =<h> edit&hostscmdstage=2&type=1&ip=<a> ods://update.ods.org gnudip://server-name oray://phservice2.oray.net By default, the URL address does not include a username or password. To configure the username and password, use the username command and the password command. 103
117 HP and GNUDIP are common DDNS update protocols. The server-name parameter is the domain name or IP address of the service provider's server using one of the update protocols. The URL address for an update request can start with: The HTTP-based DDNS server. The HTTPS-based DDNS server. ods:// The TCP-based ODS server. gnudip:// The TCP-based GNUDIP server. oray:// The TCP-based DDNS server. members.3322.org and phservice2.oray.net are the domain names of DDNS servers. The domain names of PeanutHull DDNS servers can be phservice2.oray.net, phddns60.oray.net, client.oray.net, ph031.oray.net, and so on. Determine the domain name in the URL according to the actual situation. The port number in the URL address is optional. If no port is specified, the system uses the default port numbers: port 80 for HTTP, port 443 for HTTPS, and port 6060 for PeanutHull DDNS server. The system automatically does the following: Fills <h> with the FQDN upon a DDNS policy application to the interface. Fills <a> with the primary IP address of the interface to which the DDNS policy is applied. You can also manually specify an FQDN and an IP address in <h> and <a>. In this case, the FQDN specified upon the DDNS policy application does not take effect. You are not encouraged to manually change the <h> and <a> because your configuration might be incorrect. For more information about applying DDNS policies, see "Applying the DDNS policy to an interface." No FQDN or IP address can be specified in the URL address for update requests sent to the PeanutHull DDNS server. You can specify the FQDN when applying the DDNS policy to an interface. The IP address is the primary IP address of the interface to which the DDNS policy is applied. TIP: The FQDN is the only identification of a node in the network. An FQDN consists of a local host name and a parent domain name and can be translated into an IP address. Configuration prerequisites Visit the website of a DDNS service provider, register an account, and apply for a domain name for the DDNS client. When the DDNS client updates the mapping between the domain name and the IP address through the DDNS server, the DDNS server checks the following: Whether the account information is correct. Whether the domain name to be updated belongs to the account. Configuration procedure To configure a DDNS policy: Step Command Remarks 1. Enter system view. system-view N/A 104
118 Step Command Remarks 2. Create a DDNS policy and enter its view. 3. Specify a URL address for DDNS update requests. 4. Specify the username to be contained in the URL address. 5. Specify the password to be contained in the URL address. 6. (Optional.) Specify the parameter transmission method for sending DDNS update requests to HTTP/HTTPS-based DDNS servers. 7. (Optional.) Associate an SSL client policy with the DDNS policy. 8. (Optional.) Specify the interval for sending update requests. ddns policy policy-name url request-url username username password { cipher simple } password method { http-get http-post } ssl-client-policy policy-name interval days [ hours [ minutes ] ] By default, no DDNS policy is created. By default, no URL address is specified for DDNS update requests. By default, no username is specified. By default, no password is specified. By default, http-get is used. Use the method http-post command to specify the POST method for DDNS update with a DHS server. By default, no SSL client policy is associated with the DDNS policy. This step is only effective and a must for HTTP-based DDNS update requests. For SSL client policy configuration, see Security Configuration Guide. By default, the time interval is one hour. Applying the DDNS policy to an interface After you apply the DDNS policy to an interface and specify the FQDN for update, the DDNS client sends requests to the DDNS server to update the mapping between the domain name and the primary IP address of the interface at the specified interval. Before you apply a DDNS policy to an interface, complete the following tasks: Specify the primary IP address of the interface and make sure the DDNS server and the interface can reach each other. Configure static or dynamic domain name resolution to translate the domain name of the DDNS server into the IPv4 address. For more information, see "Configuring the IPv4 DNS client." To apply the DDNS policy to an interface: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. interface interface-type interface-number N/A 105
119 Step Command Remarks 3. Apply the DDNS policy to the interface to update the mapping between the specified FQDN and the primary IP address of the interface, and enable DDNS update. ddns apply policy policy-name [ fqdn domain-name ] By default, no DDNS policy is applied to the interface, no FQDN is specified for update, and DDNS update is disabled. The fqdn domain-name option must be specified for all DDNS servers except the PeanutHull DDNS server. NOTE: If no FQDN is specified for the PeanutHull DDNS server, the DDNS server updates all domain names of the DDNS client account. If an FQDN is specified, the DDNS server updates only the mapping between the specified FQDN and the primary IP address. Setting the DSCP value for outgoing DDNS packets The DSCP value of a packet specifies the priority level of the packet and affects the transmission priority of the packet. A bigger DSCP value represents a higher priority. To set the DSCP value for outgoing DDNS packets: Step Command Remarks 1. Enter system view. system-view N/A 2. Set the DSCP value for outgoing DDNS packets. ddns dscp dscp-value By default, the DSCP value for outgoing DDNS packets is 0. Displaying DDNS Execute display commands in any view. Task Command Display information about the DDNS policy. display ddns policy [ policy-name ] DDNS configuration examples DDNS configuration example with ( Network requirements As shown in Figure 47, Router is a Web server with the domain name whatever.3322.org. 106
120 Router acquires the IP address through DHCP. Through DDNS service provided by ( Router informs the DNS server of the latest mapping between its domain name and IP address. Router uses the DNS server to translate ( into its IP address. Figure 47 Network diagram DDNS server GE2/1/1 IP network Router DDNS client DNS server Configuration procedure Before configuring DDNS on Router, do the following: Register with username steven and password nevets at ( Add Router's host name-to-ip address mapping to the DNS server. Make sure the devices can reach each other. # Create a DDNS policy named 3322.org, and enter its view. <Router> system-view [Router] ddns policy 3322.org # Specify for DDNS update requests the URL address with the login ID steven and plaintext password nevets. [Router-ddns-policy-3322.org] url members.3322.org/dyndns/update?system=dyndns&hostname=<h>&myip=<a> [Router-ddns-policy-3322.org] username steven [Router-ddns-policy-3322.org] password simple nevets # Set the interval for sending DDNS update requests to 15 minutes. [Router-ddns-policy-3322.org] interval [Router-ddns-policy-3322.org] quit # Specify the IP address of the DNS server as [Router] dns server # Apply DDNS policy 3322.org to GigabitEthernet 2/1/1 to enable DDNS update and dynamically update the mapping between domain name whatever.3322.org and the primary IP address of GigabitEthernet 2/1/1. [Router] interface gigabitethernet 2/1/1 [Router-GigabitEthernet2/1/1] ddns apply policy 3322.org fqdn whatever.3322.org After the preceding configuration is completed, Router notifies the DNS server of its new domain name-to-ip address mapping through the DDNS server provided by ( 107
121 whenever the IP address of Router changes. Therefore, Router can always provide Web service at whatever.3322.org. DDNS configuration example with PeanutHull server Network requirements As shown in Figure 48, Router is a Web server with domain name whatever.gicp.cn. Router acquires the IP address through DHCP. Through the PeanutHull server, Router informs the DNS server of the latest mapping between its domain name and IP address. Router uses the DNS server to translate into its IP address. Figure 48 Network diagram DDNS server GE2/1/1 IP network Router DDNS client DNS server Configuration procedure Before configuring DDNS on Router, do the following: Register with username steven and password nevets at Add Router's host name-to-ip address mapping to the DNS server. Make sure the devices can reach each other. # Create a DDNS policy named oray.cn and enter its view. <Router> system-view [Router] ddns policy oray.cn # Specify for DDNS update requests the URL address with the login ID steven and plaintext password nevets. [Router-ddns-policy-oray.cn] url oray://phservice2.oray.net [Router-ddns-policy-oray.cn] username steven [Router-ddns-policy-oray.cn] password simple nevets # Set the DDNS update request interval to 12 minutes. [Router-ddns-policy-oray.cn] interval [Router-ddns-policy-oray.cn] quit # Specify the IP address of the DNS server as [Router] dns server
122 # Apply the DDNS policy to GigabitEthernet 2/1/1 to enable DDNS update and dynamically update the mapping between whatever.gicp.cn and the primary IP address of GigabitEthernet 2/1/1. [Router] interface gigabitethernet 2/1/1 [Router-GigabitEthernet2/1/1] ddns apply policy oray.cn fqdn whatever.gicp.cn After the configuration is completed, Router notifies the DNS server of its new domain name-to-ip address mapping through the PeanutHull server, whenever the IP address of Router changes. Therefore, Router can always provide Web service at whatever.gicp.cn. 109
123 Configuring NAT In this chapter, "MSR1000" refers to MSR "MSR2000" refers to MSR2003, MSR , MSR "MSR3000" collectively refers to MSR3012, MSR3024, MSR3044, MSR3064. "MSR4000" collectively refers to MSR4060 and MSR4080. Network Address Translation (NAT) translates an IP address in the IP packet header to another IP address. Typically, NAT is configured on gateways to enable private users to access an external network and to enable external users to access private network resources such as a Web server. Figure 49 shows how NAT works. Figure 49 NAT operation Direction Outbound Before NAT After NAT Inbound Host Src : Dst : NAT Src : Dst : Server Src : Dst : Intranet Internet Src : Dst : The internal host at sends an IP packet to the external server at Upon receiving the packet, the NAT device then translates the private address to the public address and forwards the packet to the server on the external network. Meanwhile, the NAT device adds the mapping of the two addresses to its NAT table. 3. The external server receives the packet and responds. 4. The NAT device receives the reply and performs a NAT table lookup. The device then translates the destination to the address of the internal host and forwards the packet. The NAT operation is transparent to the terminals. NAT hides the private network from the external users and shows that the IP address of the internal PC is Terminology NAT device A device where NAT is configured. Typically, a gateway functions as a NAT device. NAT interface An interface with NAT enabled on a NAT device. 110
124 NAT address NAT entry Easy IP An IP address for translation, which can be manually specified or dynamically allocated. The address in the external network must be routable from the NAT address. An entry recording the translation between a private and a public address on a NAT device. For more information, see "NAT entries." Easy IP uses the IP address of an interface on the device as the NAT address. The IP address of the interface is obtained through DHCP or PPPoE. To implement Easy IP, you can specify an interface instead of a NAT address. NAT types Traditional NAT Traditional NAT translates the source IP addresses of outgoing packets and translates destination IP addresses of incoming packets on the NAT interface. NAT is configured on the interface that connects the public network. Bidirectional NAT NAT translates the source and destination IP addresses of a packet at the same time when the packet passes through the NAT device. Bidirectional NAT is performed on incoming packets on the receiving interface and on outgoing packets on the sending interface. Twice NAT Bidirectional NAT is applied when source and destination addresses overlap. Twice NAT translates the destination IP address on the receiving interface, and translates the source IP address on the sending interface. The receiving and sending interfaces are both NAT interfaces. Twice NAT implements access between VPNs with overlapping address. NAT hairpin NAT hairpin allows internal hosts behind the same NAT device to access each other only after they uses the NAT addresses. NAT hairpin can be in P2P or C/S mode, depending on the scenarios. 111
125 P2P The P2P mode applies to the scenario where users in the internal network can see each other only by using NAT addresses. In this mode, you must configure outbound PAT on the interface that connects the external network and enable the EIM mapping behavior mode. Internal hosts first register their NAT addresses to an external server. Then, the hosts communicate with each other by using the registered IP addresses. C/S NAT hairpin occurs when internal users access internal servers only by using NAT addresses. The destination IP address of the packet going to the internal server is translated by matching the NAT Server configurations. The source IP address is translated by matching the outbound dynamic or static NAT entries. NAT translation control NAT translation control enables the device to translate only addresses matching a specific rule. You can configure ACL-based NAT to achieve NAT translation control. NAT uses only the match criteria of the source IP address, source port number, destination IP address, destination port number, transport layer protocol, and VPN instance in an ACL rule for packet matching. Only packets matching an ACL permit rule are processed by NAT. NAT implementations Static NAT Static NAT uses a fixed translation of a real address to a NAT address. Because the NAT address is the same for each consecutive connection, static NAT allows bidirectional access to and from the host. With dynamic NAT, each host uses a different address or port for each subsequent translation, so bidirectional initiation is not supported. Dynamic NAT NO-PAT Dynamic NAT translates a group of real addresses to a pool of NAT addresses that are routable on the destination network. The NAT address pool includes fewer addresses than the real group. When a host accesses the destination network, NAT assigns the host an IP address from the NAT address pool. The translation is created when the real host initiates a connection, and the translation lasts for the duration of the connection. A user might use different IP address for each translation. Dynamic NAT supports the modes of Not Port Address Translation (NO-PAT) and Port Address Translation (PAT). NO-PAT uses a NAT address to translate one real address and creates a NO-PAT entry for recording the mapping. When the connection between the internal and external is closed, the NAT address is released and can be assigned to other NAT users. NO-PAT supports IP address translation for all IP protocols. 112
126 PAT PAT maps a group of real addresses to a single NAT address by using different port numbers. PAT supports translating the transport identifiers of TCP and UDP port numbers, and ICMP query identifiers. PAT improves the use of IP address resources, enabling more internal hosts to access the external network at the same time. Figure 50 shows how PAT works. Figure 50 PAT operation See Figure 50 for an example. Packets 1 and 2 with different source ports are from Host A, and Packets 3 with the same source port as packet 1 is from Host B. PAT maps the source IP addresses of the three packets to the same NAT address and uses different port numbers to make each unique. When the NAT device receives a response packet, it translates the destination address and port number of the packet, and forwards it to the target host. PAT supports the following mapping behaviors: Endpoint-Independent Mapping Uses the same IP and port mapping for packets from the same source address and port to any destination IP and port. An EIM entry is generated to record the IP and port mapping. This behavior allows packets from any external host to access the internal user by using the NAT address and port, which improves communication among hosts that connect to different NAT gateways. Address and Port-Dependent Mapping Typically uses different IP and port mappings for packets from the same source IP and port to different destination IP addresses and ports. This behavior does not allow packets from an external host to access any NAT address unless the internal host has previously sent a packet of the same protocol to that external host. This behavior is secure, but it is inconvenient for internal hosts connecting to different NAT gateways to access each other by using the NATed external addresses. NAT Server The NAT Server feature maps a NAT address and port number to the real IP address and port number of an internal server. This feature allows servers in the private network to provide services to external users. Figure 51 shows how NAT Server works. 113
127 Figure 51 NAT Server operation Direction Inbound Before NAT :8080 After NAT :8080 Server Dst : :8080 Dst : :8080 NAT Intranet Internet Src : :8080 Src : :8080 Host NAT The host in the public network sends a packet destined for the public IP address and port number of the server in the private network. 2. When the NAT device receives the packet, it matches the destination address and port number against the NAT Server mapping. If a match is found, NAT translates the destination address and port number in the packet to the private IP address and port number of the internal server. 3. Upon receiving a response packet from the internal server, the NAT device translates the source private IP address and port number of the packet into the public IP address and port number of the internal server. NAT444 provides carrier-grade NAT. It is a preferred solution for carriers to mitigate the IPv4 address exhaustion. It only introduces a second layer of NAT on the carrier side, without many changes on the customer side and the application server side. Its user logging function provides the user tracing function. Figure 52 shows how the NAT444 gateway works together with other devices to provide an integrated NAT solution. The NAT444 architecture includes the following entities: CPE Provides NAT services on the customer side. BRAS Provides Internet access services. NAT444 gateway Provides carrier-grade NAT services. AAA server Cooperates with BRAS to provide user authentication, authorization, and accounting services. Log server Records user access logs and responds to queries of user access information. Figure 52 NAT444 application diagram 114
128 Static NAT444 The NAT444 gateway provides port block-based PAT translation. It maps multiple private IP addresses to one public IP address with different port blocks. Each private IP address uses a port block exclusively. For example, private IP address is mapped to public IP address and port block to When the internal user initiates sessions to the public network, the source IP address is translated to , and the source ports are translated to ports in the port block to Port blocks and private IP addresses are mapped in static or dynamic mode. The NAT444 gateway computes a static NAT444 mapping from a private IP address to a public IP address and a port block before address translation occurs. When the private IP address accesses the public network, the NAT444 gateway uses this entry for translation. For the NAT444 gateway to create static NAT444 mappings, you must provide private IP addresses, public IP addresses, a port range, and a port block size. The gateway computes static NAT444 mappings as follows: 1. Divides the port range by the port block size to get the number of available port blocks for each public IP address. This value is the base number for mapping. 2. Sorts the port blocks in ascending order of the start port number in each block. 3. Sorts the private IP addresses and the public IP addresses separately in ascending order. 4. Maps the first base number of private IP addresses to the first public IP address and its port blocks in ascending order. For example, the number of available port blocks of each public IP address is m. The first m private IP addresses are mapped to the first public IP address and the m port blocks in ascending order. The next m private IP addresses are mapped to the second IP address and the m port blocks in ascending order. The other static IP-to-port block mappings are created by analogy. Dynamic NAT444 A dynamic NAT444 mapping records the mapping from a private IP address to a public IP address and a port block. It is created when a private IP address initiates a connection to the public network. A NAT444 gateway with dynamic NAT444 mappings functions as follows: 1. The NAT444 gateway selects a public IP address and a port block in the NAT address group for the private IP address. 2. For subsequent connections from the private IP address, the NAT444 gateway translates the private IP address to the mapped public IP address, and the source ports to ports in the selected port block. 3. When all the connections from the private IP address are disconnected, the NAT444 gateway withdraws the port block mapped to the private IP address and deletes the dynamic NAT444 mapping. The NAT444 gateway uses ACL to implement translation control. Only packets matching an ACL permit rule are processed by the NAT444 gateway. Dynamic NAT444 mapping supports port block extending. When a private IP address accesses the public network, and the ports in the selected port block are all occupied, the NAT444 gateway translates the source port to a port from extended port blocks. 115
129 NAT entries NAT session entry EIM entry NAT translates the IP address of the first packet in a session and creates a NAT session entry for recording the mappings. The NAT session entry contains extended NAT information, such as interface and translation method. Subsequent packets of the session are translated by using this entry. The session management module maintains the updating and aging of NAT session entries. For information about session management, see Security Configuration Guide. A NAT device with the PAT Endpoint-Independent Mapping configured creates the following: First a NAT session entry. Then an EIM entry for recording the mapping between an internal address/port and a NAT address/port. The EIM entry provides the following benefits: The same mapping applies to subsequent connections originating from the same source IP and port as the first connection. Allows reverse translation for connections originating from external hosts to the NAT address and port based on the EIM entry. An EIM entry ages out after all related NAT session entries age out. NO-PAT entry A NAT device with NO-PAT translation method configured creates the following: First a NAT session entry. Then a NO-PAT entry for recording the mapping between an internal address and a NAT address. A NO-PAT entry can also be created during the ALG process for NAT. For information about NAT with ALG, see "NAT with ALG." The NO-PAT entry provides the following benefits: The same mapping applies to subsequent connections originating from the same source IP as the first connection. The reversible keyword allows translating the destination IP address of the first packet of a connection originating from an external host that meets the specified conditions to the NAT address based on the existing NO-PAT entry. A NO-PAT entry ages out after all related NAT session entries age out. NAT444 entry A NAT444 entry records the mapping from a private IP address to a public IP address and a port block. NAT444 entries can be static or dynamic NAT444 mappings. 116
130 For information about these mappings, see "Static NAT444" and "Dynamic NAT444." Using NAT with other features NAT with multiple VPN instances NAT with multiple VPN instances allows users from different VPN instances to access external networks and to access each other. 1. Upon receiving a request from a user in a VPN instance to an external network, NAT does the following: Translates the private source IP address and port number to a NAT IP address and port number. Records the VPN instance information, such as the VPN name. 2. When a response packet arrives, NAT does the following: Translates the destination IP address and port number to the private IP address and port number. Forwards the packet to the target VPN instance. The NAT Server feature supports NAT with multiple VPN instances for external users to access the servers in a VPN instance. For example, to enable a host at in VPN 1 to provide Web services for Internet users, configure NAT Server to use as the public IP address of the Web server. NAT with DNS mapping NAT with DNS mapping allows an internal host to access an internal server on the same private network by using the domain name of the internal server when the DNS server is on the public network. NAT with DNS mapping must operate with the NAT Server feature. NAT with DNS mapping maps the domain name of the internal server to the public IP address, public port number, and protocol type of the server. NAT Server maps the public IP and port to the private IP and port of the internal server. Figure 53 shows the application scenario for NAT with DNS mapping. Figure 53 NAT with DNS mapping 117
131 Configure NAT with DNS mapping to record the mapping of the domain name, public address, public port number, and protocol type of the Web server. Configure NAT Server to map the public address and port number to the private address and port number of the Web server. 1. When a DNS reply arrives on the NAT interface, NAT performs a NAT with DNS mapping lookup by using the domain name. 2. If a match is found, the NAT continues to match the public address, public port number, and the protocol type against the NAT Server configuration. 3. If a match is found, NAT translates the public IP address in the reply into the private IP address of the Web server. 4. The internal host can access the internal server. NAT with ALG Use NAT with ALG to translate the payload information to ensure connection establishment. NAT translates only IP addresses and port numbers in packet headers and does not analyze fields in application layer payload. However, the packet payloads of some protocols might contain IP address or port information, which might cause problems if not translated. For example, an FTP application involves both data connection and control connection. The data connection establishment dynamically depends on the payload information for the control connection. NAT configuration task list Tasks at a glance Perform at least one of the following tasks: Configuring static NAT Configuring dynamic NAT Configuring NAT Server Configuring NAT444 (Optional.) Configuring NAT with DNS mapping (Optional.) Configuring NAT hairpin (Optional.) Configuring NAT with ALG (Optional.) Configuring NAT logging Remarks If you configure all the tasks on the same interface, their priority is as follows: NAT Server. Static NAT. Static NAT444. Dynamic NAT and dynamic NAT444. Dynamic NAT and dynamic NAT444 have the same priority. They are matched in the descending order of ACL numbers. N/A N/A N/A N/A Configuring static NAT Static NAT can be implemented by one-to-one or net-to-net mapping for outbound and inbound translation. Do not configure inbound static NAT separately. Typically, inbound static NAT works with other NAT translation methods to implement bidirectional NAT. 118
132 Configuration prerequisites Configure an ACL to identify the IP addresses to be translated. NAT uses only the match criteria of the source IP address, source port number, destination IP address, destination port number, transport layer protocol, and VPN instance in the ACL rule for packet matching. For more information about ACLs, see ACL and QoS Configuration Guide. Add a route manually for inbound static NAT. Use local-ip or local-network as the destination address, and use global-ip, an address in global-network, or the next hop address of the output interface for the incoming packets as the next hop. Configuring outbound one-to-one static NAT To translate a private IP address into a public IP address, and vice versa, configure outbound one-to-one static NAT on the interface that connects the external network. When the source IP address of a packet from the private network matches the local-ip, the IP address is translated to the global-ip. When the destination IP address of a packet from the public matches the global-ip, the destination IP address is translated into the local-ip. To configure outbound one-to-one static NAT: Step Command Remarks 1. Enter system view. system-view N/A 2. Configure a one-to-one mapping for outbound static NAT. nat static outbound local-ip [ vpn-instance local-name ] global-ip [ vpn-instance global-name ] [ acl acl-number [ reversible ] ] By default, no mappings exist. If you specify the acl keyword, NAT processes only packets matching the permit statement in the ACL. 3. Return to system view. quit N/A 4. Enter interface view. 5. Enable static NAT on the interface. interface interface-type interface-number nat static enable N/A By default, static NAT is disabled. Configuring outbound net-to-net static NAT For address translation between a private network and a public network, configure outbound net-to-net static NAT on the interface that connects the external network. When the source IP address of a packet from the private network matches the internal address pool, the source IP address is translated into a public address in the external address pool. When the destination IP address of a packet from the public network matches the external address pool, the destination IP address is translated into a private address in the internal address pool. To configure outbound net-to-net static NAT: 119
133 Step Command Remarks 1. Enter system view. system-view N/A 2. Configure a net-to-net mapping for outbound static NAT. nat static outbound net-to-net local-start-address local-end-address [ vpn-instance local -name ] global global-network { mask-length mask } [ vpn-instance global-name ] [ acl acl-number [ reversible ] ] By default, no mappings exist. If you specify the acl keyword, Nat processes only packets matching the permit statement in the ACL. 3. Return to system view. quit N/A 4. Enter interface view. 5. Enable static NAT on the interface. interface interface-type interface-number nat static enable N/A By default, static NAT is disabled. Configuring inbound one-to-one static NAT Configure inbound one-to-one static NAT for address translation between a private IP address and a public IP address. When the source IP address of a packet from the public network to the private network matches the global-ip, the source IP address is translated to the local-ip. When the destination IP address of a packet from the private network matches the local-ip, the destination IP address is translated to the global-ip. To configure inbound one-to-one static NAT: Step Command Remarks 1. Enter system view. system-view N/A 2. Configure a one-to-one mapping for inbound static NAT. nat static inbound global-ip [ vpn-instance global-name ] local-ip [ vpn-instance local-name ] [ acl acl-number [ reversible ] ] By default, no mappings exist. If you specify the acl keyword, Nat processes only packets matching the permit statement in the ACL. 3. Return to system view. quit N/A 4. Enter interface view. 5. Enable static NAT on the interface. interface interface-type interface-number nat static enable N/A By default, static NAT is disabled. Configuring inbound net-to-net static NAT Configure inbound net-to-net static NAT for translation between a private network and a public network. When the source IP address of a packet from the public network matches the external address pool, the source IP address is translated into a private address in the internal address pool. 120
134 When the destination IP address of a packet from the private network matches the internal address pool, the destination IP address is translated into a public address in the external address pool. To configure inbound net-to-net static NAT: Step Command Remarks 1. Enter system view. system-view N/A 2. Configure a net-to-net mapping for inbound static NAT. nat static inbound net-to-net global-start-address global-end-address [ vpn-instance global -name ] local local-network { mask-length mask } [ vpn-instance local-name ] [ acl acl-number [ reversible ] ] By default, no mappings exist. If you specify the acl keyword, NAT processes only packets matching the permit statement in the ACL. 3. Return to system view. quit N/A 4. Enter interface view. 5. Enable static NAT on the interface. interface interface-type interface-number nat static enable N/A By default, static NAT is disabled. Configuring dynamic NAT Dynamic NAT implements address translation by mapping a group of IP addresses to a smaller number of NAT addresses. You can specify an address group (or the IP address of an interface) and ACL to implement dynamic NAT on the NAT interface. Configuration restrictions and guidelines You can configure multiple dynamic NAT rules. A NAT rule is an inbound or outbound configuration. A NAT rule with an ACL takes precedence over a rule without any ACL. The priority for the ACL-based dynamic NAT rules depends on ACL number. A higher ACL number represents a higher priority. Configuration prerequisites Configure an ACL to identify the IP addresses to be translated. NAT uses only the match criteria of the source IP address, source port number, destination IP address, destination port number, transport layer protocol, and VPN instance in the ACL rule for packet matching. For more information about ACLs, see ACL and QoS Configuration Guide. Determine whether to enable the Easy IP function. If you use the IP address of an interface as the NAT address, you are configuring Easy IP. Determine a public IP address pool for address translation. Determine whether to translate port number. Use NO-PAT to translate only IP addresses and PAT to translate both IP addresses and port numbers. 121
135 Configuring outbound dynamic NAT To translate private IP addresses into public IP addresses, configure outbound dynamic NAT on the interface that connects the external network. The source IP address of the outgoing packets that match the ACL permit statement is translated into an address in the address group. The reversible keyword enables the device to perform the following operations: Compare the destination IP address in the first packet from the public network to the private network with existing NO-PAT entries. Translate the destination address into the NAT address in a matching NO-PAT entry. To configure outbound dynamic NAT: Step Command Remarks 1. Enter system view. system-view N/A 2. Configure an address group and enter its view. 3. Add a group member to the address group. 4. Enter interface view. 5. Configure outbound dynamic NAT. 6. (Optional.) Configure the mapping behavior for PAT. nat address-group group-number address start-address end-address interface interface-type interface-number Configure NO-PAT: nat outbound [ acl-number ] address-group group-number [ vpn-instance vpn-instance-name ] no-pat [ reversible ] Configure PAT: nat outbound [ acl-number ] [ address-group group-number ] [ vpn-instance vpn-instance-name ] [ port-preserved ] nat mapping-behavior endpoint-independent [ acl acl-number ] By default, no address group exists. By default, no group member exists. You can add multiple members to an address group. The IP addresses of the members must not overlap. N/A By default, outbound dynamic NAT is not configured. You can configure multiple outbound dynamic NAT rules on an interface. The default mapping behavior is Address and Port-Dependent Mapping. This command takes effect only on outbound dynamic NAT for PAT. Configuring inbound dynamic NAT To implement bidirectional NAT, you must use inbound dynamic NAT with outbound dynamic NAT, NAT Server, or outbound static NAT. The source IP address of a received packet that matches the ACL permit statement is translated into an address in the address group. 122
136 The add-route keyword enables the device to add a route automatically to the NATed address when a packet matches an inbound dynamic NAT rule. The output interface for the automatically added route is the NAT interface, and the next hop is the source address before translation. If you do not specify this keyword, you must add the route manually. HP recommends that you manually specify a route because it takes time to add routes automatically. The reversible keyword enables the device to perform the following operations: Compare the destination IP address in the first packet from the private network to the public network against existing NO-PAT entries. Translate the destination address into the NAT address in a matching NO-PAT entry. Inbound dynamic NAT does not support Easy IP. To configure inbound dynamic NAT: Step Command Remarks 1. Enter system view. system-view N/A 2. Configure an address group and enter its view. 3. Add a group member to the address group. 4. Enter interface view. 5. Configure inbound dynamic NAT. nat address-group group-number address start-address end-address interface interface-type interface-number nat inbound acl-number address-group group-number [ vpn-instance vpn-instance-name ] [ no-pat [ reversible ] [ add-route ] ] By default, no address group exists. By default, no group member exists. You can add multiple members to an address group. The IP addresses of the members must not overlap. N/A By default, inbound dynamic NAT is not configured. You can configure multiple inbound dynamic NAT rules on an interface. Configuring NAT Server To configure NAT Server, map an external IP address and port number to the real IP address and port number of an internal server on the interface that connects the external network. An internal server can be located in a common private network or a VPN instance. If you specify the acl keyword for the NAT Server configuration, only packets matching the ACL permit rule are translated. NAT uses only the match criteria of the source IP address, source port number, destination IP address, destination port number, transport layer protocol, and VPN instance in the ACL rule for packet matching. Configuring common NAT Server Map the real private IP address and port number of an internal server to a public IP address and port number so that hosts in external networks can access the internal server. To configure common NAT Server: 123
137 Step Command Remarks 1. Enter system view. 2. Enter interface view. 3. Configure one or more common NAT Server mappings. system-view interface interface-type interface-number A single global address with a single or no global port: nat server protocol pro-type global { global-address current-interface interface interface-type interface-number } [ global-port ] [ vpn-instance global-name ] inside local-address [ local-port ] [ vpn-instance local-name ] [ acl acl-number ] A single global address with consecutive global ports: nat server protocol pro-type global { global-address current-interface interface interface-type interface-number } global-port1 global-port2 [ vpn-instance global-name ] inside { { local-address local-address1 local-address2 } local-port local-address local-port1 local-port2 } [ vpn-instance local-name ] [ acl acl-number ] Consecutive global addresses with a single or no global port: nat server protocol pro-type global global-address1 global-address2 [ global-port ] [ vpn-instance global-name ] inside { local-address local-address1 local-address2 } [ local-port ] [ vpn-instance local-name ] [ acl acl-number ] Consecutive global addresses with a single global port: nat server protocol pro-type global global-address1 global-address2 global-port [ vpn-instance global-name ] inside local-address local-port1 local-port2 [ vpn-instance local-name ] [ acl acl-number ] N/A N/A By default, no NAT Server mapping exists. You can configure multiple NAT Server mappings on an interface. Configuring load sharing NAT Server You can add multiple internal servers to an internal server group so that these servers provide the same service to external hosts. The NAT device chooses one internal server as the destination server based on the weight and number of connections of the servers when an external user sends application requests to the external address of the internal server group. To configure load sharing NAT Server: Step Command Remarks 1. Enter system view. system-view N/A 2. Configure a NAT Server group and enter its view. 3. Add an internal server into the group. nat server-group group-number inside ip inside-ip port port-number [ weight weight-value ] By default, no NAT Server group exists. By default, no internal server is in the group. You can add multiple internal servers to a group. 124
138 Step Command Remarks 4. Enter interface view. interface interface-type interface-number N/A 5. Configure load sharing NAT Server. nat server protocol pro-type global { { global-address current-interface interface interface-type interface-number } { global-port global-port1 global-port2 } global-address1 global-address2 global-port } [ vpn-instance global-name ] inside server-group group-number [ vpn-instance local-name ] [ acl acl-number ] By default, no internal server exists. You can configure multiple load sharing internal servers on an interface. Configuring NAT444 NAT444 provides outbound address translation, and it is configured on the interface connected to the public network. Configuring static NAT444 Static NAT444 is applicable when the private IP addresses are fixed. To configure static NAT444: Step Command Remarks 1. Enter system view. system-view N/A 2. Create a NAT port block group, and enter its view. 3. Add a private IP address member to the port block group. 4. Add a public IP address member to the port block group. 5. (Optional.) Configure the port range for the public IP addresses. nat port-block-group group-number local-ip-address start-address end-address global-ip-pool start-address end-address port-range start-port-number end-port-number By default, no port block group exists. By default, no private IP address member exists in the port block group. You can add multiple private IP address members to one port block group, but they cannot overlap. By default, no public IP address member exists in the port block group. You can add multiple public IP address members to one port block group, but they cannot overlap. By default, the port range is 1 to Set the port block size. block-size block-size By default, the port block size is Return to system view. quit N/A 8. Enter interface view. interface interface-type interface-number N/A 125
139 Step Command Remarks 9. Apply the port block group to the outbound direction of the interface. nat outbound port-block-group group-number By default, no port block group is applied to the interface. You can apply multiple port block groups to one interface. 10. Return to system view. quit N/A 11. (Optional.) Configure the mapping behavior for PAT. nat mapping-behavior endpoint-independent [ acl acl-number ] The default mapping behavior is Address and Port-Dependent Mapping. Configuring dynamic NAT444 Dynamic NAT444 is applicable when the private IP addresses are not fixed. To configure dynamic NAT444: Step Command Remarks 1. Enter system view. system-view N/A 2. Create a NAT address group, and enter its view. nat address-group group-number By default, no NAT address group exists. 3. Add a public IP address member to the NAT address group. address start-address end-address By default, no public IP address member exists in the NAT address group. You can add multiple members to an address group, but they cannot overlap. 4. Configure the port range for the public IP addresses. 5. Configure port block parameters. 6. Enter interface view. 7. Configure PAT for outbound dynamic NAT. 8. (Optional.) Configure the mapping behavior for PAT. port-range start-port-number end-port-number port-block block-size block-size [ extended-block-number extended-block-number ] interface interface-type interface-number nat outbound [ acl-number ] [ address-group group-number ] [ vpn-instance vpn-instance-name ] [ port-preserved ] nat mapping-behavior endpoint-independent [ acl acl-number ] By default, the port range is 1 to The configuration takes effect only on PAT translation mode. By default, no port block parameter exists. The configuration takes effect only on PAT translation mode. N/A By default, outbound dynamic NAT is not configured. The port-preserved keyword does not take effect on dynamic NAT444. The default mapping behavior is Address and Port-Dependent Mapping. 126
140 Configuring NAT with DNS mapping NAT with DNS mapping must operate together with NAT Server and NAT with ALG. To configure NAT with DNS mapping: Step Command Remarks 1. Enter system view. system-view N/A 2. Configure a DNS mapping for NAT. nat dns-map domain domain-name protocol pro-type { interface interface-type interface-number ip global-ip } port global-port By default, no DNS mapping for NAT exists. You can configure multiple DNS mappings for NAT. Configuring NAT hairpin NAT hairpin enables an internal host to access an internal server or another internal host by using NAT addresses. NAT hairpin functions on the interface that connects the internal network and translates the source and destination IP addresses of a packet on the interface. NAT hairpin typically operates with NAT Server, outbound dynamic NAT, or outbound static NAT. To configure NAT hairpin: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. interface interface-type interface-number N/A 3. Enable NAT hairpin. nat hairpin enable By default, NAT hairpin is disabled. Configuring NAT with ALG Configure NAT with ALG for a specific protocol to analyze and process the payload fields in the application layer packets. To configure NAT with ALG: Step Command Remarks 1. Enter system view. system-view N/A 2. Configure NAT with ALG for the specified protocol or all protocols. nat alg { all dns ftp h323 icmp-error ils mgcp nbt pptp rsh rtsp sccp sip sqlnet tftp xdmcp } By default, NAT with ALG is enabled. 127
141 Configuring NAT logging Configuring NAT session logging NAT session logging records NAT session information, including IP address and port number translation, user access, and network flows. A NAT device generates NAT session logs when one of the following occurs: A NAT session is established. A NAT session is removed when you add configuration with higher priority, remove configuration, change ACLs, and when a NAT session ages out or a NAT session is deleted. Active NAT flows exist. When the interval for logging active NAT flows is reached, the NAT session is logged. To enable NAT session logging: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable NAT logging. nat log enable [ acl acl-number ] By default, NAT logging is disabled. 3. Enable NAT session logging. For NAT session establishment events: nat log flow-begin For NAT session removal events: nat log flow-end For active NAT flows: nat log flow-active minutes By default, NAT session logging is disabled. Configuring NAT444 user logging NAT444 user logs are used for user tracing. The NAT444 gateway generates a user log whenever it assigns or withdraws a port block. The log includes the private IP address, public IP address, and port block. You can use the public IP address and port numbers to locate the user private IP address from the user logs. A NAT444 gateway generates NAT user logs when one of the following events occurs: A port block is assigned. For static NAT444, the NAT444 gateway generates a user log when it translates the first connection from a private IP address. For dynamic NAT444, the NAT444 gateway generates a user log when it assigns or extends a port block for a private IP address. A port block is withdrawn. For static NAT444, the NAT444 gateway generates a user log when all connections from a private IP address are disconnected. For dynamic NAT444, the NAT444 gateway generates a user log when all the following conditions are met: 128
142 All connections from a private IP address are disconnected. The port blocks (including the extended ones) assigned to the private IP address are withdrawn. The corresponding mapping entry is deleted. Before configuring NAT444 user logging, you must configure the custom NAT444 log generation and outputting functions. For more information, see Network Management and Monitoring Configuration Guide. To configure NAT444 user logging: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable NAT logging. nat log enable [ acl acl-number ] By default, NAT logging is disabled. The acl acl-number option does not take effect on NAT444 user logging. 3. Enable NAT444 user logging. For port block assignment: nat log port-block-assign For port block withdrawal: nat log port-block-withdraw By default, NAT444 user logging is disabled,. Configuring NAT444 alarm logging If the public IP addresses, port blocks, or ports in mapped port blocks (including extended ones) are all occupied, the NAT444 gateway cannot perform address translation and packets will be dropped. To monitor the usage of public IP addresses and port block resources, you can configure NAT444 alarm logging. A NAT444 gateway generates alarm logs when one of the following occurs: The ports in the mapped port block of a static NAT444 mapping are all occupied. The ports in the mapped port blocks (including extended ones) of a dynamic NAT444 mapping are all occupied. The public IP addresses or port blocks for dynamic NAT444 mappings are all assigned. Before configuring NAT444 alarm logging, you must configure the custom NAT444 log generation and outputting functions. For more information, see Network Management and Monitoring Configuration Guide. To configure NAT444 alarm logging: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable NAT logging. nat log enable [ acl acl-number ] By default, NAT logging is disabled. The acl acl-number option does not take effect on NAT444 alarm logging. 129
143 Step Command Remarks 3. Enable NAT444 alarm logging. nat log alarm By default, NAT444 alarm logging is disabled. Displaying and maintaining NAT Execute display commands in any view and reset commands in user view. Task Display all NAT configuration information. Command display nat all Display NAT address group information. display nat address-group [ group-number ] Display NAT with DNS mapping configuration. Display information about NAT EIM entries (MSR1000/MSR2000/MSR3000). Display information about NAT EIM entries (MSR4000). Display information about inbound dynamic NAT. Display NAT logging configuration. Display information about NAT NO-PAT entries (MSR1000/MSR2000/MSR3000). display nat dns-map display nat eim display nat eim [ slot slot-number ] display nat inbound display nat log display nat no-pat Display information about NAT NO-PAT entries (MSR4000). display nat no-pat [ slot slot-number ] Display information about outbound dynamic NAT. Display NAT Server configuration. display nat outbound display nat server Display internal server group configuration. display nat server-group [ group-number ] Display sessions that have been NATed (MSR1000/MSR2000/MSR3000). Display sessions that have been NATed (MSR4000). display nat session [ { source-ip source-ip destination-ip destination-ip } * [ vpn-instance vpn-name ] ] [ verbose ] display nat session [ { source-ip source-ip destination-ip destination-ip } * [ vpn-instance vpn -name ] ] [ slot slot-number ] [ verbose ] Display static NAT mappings. display nat static Display NAT statistics (MSR1000/MSR2000/MSR3000). display nat statistics Display NAT statistics (MSR4000). display nat statistics [ slot slot-number ] 130
144 Task Display information about port block group application for NAT444. Display information about NAT port block groups. Display NAT444 mappings (MSR1000/MSR2000/MSR3000). Command display nat outbound port-block-group display nat port-block-group [ group-number ] display nat port-block { dynamic static } Display NAT444 mappings (MSR4000). display nat port-block { dynamic static } [ slot slot-number ] Clear NAT sessions (MSR1000/MSR2000/MSR3000). reset nat session Clear NAT sessions (MSR4000). reset nat session [ slot slot-number ] NAT configuration examples One-to-one static NAT for internal-to-external access Network requirements Configure static NAT to allow the user at /24 to access the Internet. Figure 54 Network diagram Configuration procedure # Specify IP addresses for the interfaces. (Details not shown.) # Configure a one-to-one static NAT mapping between internal address and the NAT address <Router> system-view [Router] nat static # Enable static NAT on interface GigabitEthernet 2/1/2. [Router] interface gigabitethernet 2/1/2 [Router-GigabitEthernet2/1/2] nat static enable [Router-GigabitEthernet2/1/2] quit Verifying the configuration # Verify that the host at /24 can access the server on the Internet. (Details not shown.) # Display static NAT configuration. [Router] display nat static 131
145 Static NAT mappings: There are 1 outbound static NAT mappings. IP-to-IP: Local IP : Global IP : Interfaces enabled with static NAT: There are 1 interfaces enabled with static NAT. Interface: GigabitEthernet2/1/2 # Use the display nat session verbose command to display NAT session information generated when the host accesses an external server. [Router] display nat session verbose Initiator: Source IP/port: /42496 Destination IP/port: /2048 DS-Lite tunnel peer: - VPN instance/vlan ID/VLL ID: -/-/- Protocol: ICMP(1) Responder: Source IP/port: /42496 Destination IP/port: /0 DS-Lite tunnel peer: - VPN instance/vlan ID/VLL ID: -/-/- Protocol: ICMP(1) State: ICMP_REPLY Application: OTHER Start time: :30:49 TTL: 27s Interface(in) : GigabitEthernet2/1/1 Interface(out): GigabitEthernet2/1/2 Initiator->Responder: 5 packets 420 bytes Responder->Initiator: 5 packets 420 bytes Total sessions found: 1 Outbound dynamic NAT for internal-to-external access (non-overlapping addresses) Network requirements As shown in Figure 55, a company has a segment address /16 and two public IP addresses and Configure outbound dynamic NAT to allow only internal users on segment /24 to access the Internet. 132
146 Figure 55 Network diagram Configuration procedure # Specify IP addresses for the interfaces. (Details not shown.) # Configure address group 0, and add an address member from to <Router> system-view [Router] nat address-group 0 [Router-nat-address-group-0] address [Router-nat-address-group-0] quit # Configure ACL 2000, and create a rule to permit packets only from segment /24 to pass through. [Router] acl number 2000 [Router-acl-basic-2000] rule permit source [Router-acl-basic-2000] quit # Enable outbound dynamic PAT on interface GigabitEthernet 2/1/2. The source IP addresses of the packets permitted by the ACL rule is translated into the addresses in address group 0. [Router] interface gigabitethernet 2/1/2 [Router-GigabitEthernet2/1/2] nat outbound 2000 address-group 0 [Router-GigabitEthernet2/1/2] quit Verifying the configuration # Verify that Host A can access the WWW server, while Host B cannot. (Details not shown.) # Display all NAT configuration and statistics. [Router] display nat all NAT address group information: There are 1 NAT address groups. Address group 0: Address information: Start address End address NAT outbound information: There are 1 NAT outbound rules. Interface: GigabitEthernet2/1/2 ACL: 2000 Address group: 0 Port-preserved: N NO-PAT: N Reversible: N 133
147 NAT logging: Log enable : Disabled Flow-begin : Disabled Flow-end : Disabled Flow-active : Disabled Port-block-assign : Disabled Port-block-withdraw : Disabled Alarm : Disabled NAT mapping behavior: Mapping mode: Address and Port-Dependent ACL : --- NAT ALG: DNS : Enabled FTP : Enabled H323 : Enabled ICMP-ERROR : Enabled ILS : Enabled MGCP : Enabled NBT : Enabled PPTP : Enabled RTSP : Enabled RSH : Enabled SCCP : Enabled SIP : Enabled SQLNET : Enabled TFTP : Enabled XDMCP : Enabled # Use the display nat session verbose command to display NAT session information generated when Host A accesses the WWW server. [Router] display nat session verbose Initiator: Source IP/port: /52992 Destination IP/port: /2048 DS-Lite tunnel peer: - VPN instance/vlan ID/VLL ID: -/-/- Protocol: ICMP(1) Responder: Source IP/port: /4 Destination IP/port: /0 DS-Lite tunnel peer: - VPN instance/vlan ID/VLL ID: -/-/- Protocol: ICMP(1) State: ICMP_REPLY Application: OTHER Start time: :53:29 TTL: 12s 134
148 Interface(in) : GigabitEthernet2/1/1 Interface(out): GigabitEthernet2/1/2 Initiator->Responder: 1 packets 84 bytes Responder->Initiator: 1 packets 84 bytes Total sessions found: 1 Bidirectional NAT for internal-to-external access Network requirements As shown in Figure 56, the IP address of the Web server is , and it overlaps with internal network /24, where the hosts reside. The company has two public IP addresses and Configure NAT to allow internal users to access the external Web server by using its domain name. Figure 56 Network diagram Requirements analysis This is a typical application of bidirectional NAT. When an internal host tries to access the external Web server by using the domain name, a DNS query is sent to the external DNS server. The server sends the internal host a response with the Web server's IP address, which overlaps with that of the internal host. To make sure the internal host reaches the Web server instead of an internal user, configure inbound dynamic NAT with ALG so that NAT can translate the Web server's address in the payload to a dynamically assigned NAT address. The internal host uses the NAT address as the destination address. When a packet from the internal host arrives at the NAT device, the source IP address overlaps with the real address of the Web server. Configure outbound dynamic NAT to translate the source IP address to a dynamically assigned NAT address. The NAT device has no route to the NAT address of the external Web server. Add a static route to the NAT address with GigabitEthernet 2/1/2 as the output interface. Configuration procedure # Specify IP addresses for the interfaces. (Details not shown.) # Enable NAT with ALG and DNS. <Router> system-view [Router] nat alg dns 135
149 # Configure ACL 2000, and create a rule to permit packets only from segment /24 to pass through. [Router] acl number 2000 [Router-acl-basic-2000] rule permit source [Router-acl-basic-2000] quit # Create address group 1. [Router] nat address-group 1 # Add address to the group. [Router-nat-address-group-1] address [Router-nat-address-group-1] quit # Create address group 2. [Router] nat address-group 2 # Add address to the group. [Router-nat-address-group-2] address [Router-nat-address-group-2] quit # Enable inbound NO-PAT on interface GigabitEthernet 2/1/2 to translate the source IP address in the DNS reply payload into the address in address group 1, and allow reversible NAT. [Router] interface gigabitethernet 2/1/2 [Router-GigabitEthernet2/1/2] nat inbound 2000 address-group 1 no-pat reversible # Enable outbound PAT on interface GigabitEthernet 2/1/2 to translate the source address of outgoing packets into the address in address group 2. [Router-GigabitEthernet2/1/2] nat outbound 2000 address-group 2 [Router-GigabitEthernet2/1/2] quit # Configure a static route to with GigabitEthernet 2/1/2 as the output interface and as the next hop. (The next hop address varies by network.) [Router] ip route-static gigabitethernet 2/1/ Verifying the configuration # Verify that Host A can access the Web server by using its domain name. (Details not shown.) # Display all NAT configuration and statistics. [Router] display nat all NAT address group information: There are 2 NAT address groups. Address group 1: Address information: Start address End address Address group 2: Address information: Start address End address NAT inbound information: There are 1 NAT inbound rules. Interface: GigabitEthernet2/1/2 136
150 ACL: 2000 Address group: 1 Add route: N NO-PAT: Y Reversible: Y NAT outbound information: There are 1 NAT outbound rules. Interface: GigabitEthernet2/1/2 ACL: 2000 Address group: 2 Port-preserved: N NO-PAT: N Reversible: N NAT logging: Log enable : Disabled Flow-begin : Disabled Flow-end : Disabled Flow-active : Disabled Port-block-assign : Disabled Port-block-withdraw : Disabled Alarm : Disabled NAT mapping behavior: Mapping mode: Address and Port-Dependent ACL : --- NAT ALG: DNS : Enabled FTP : Enabled H323 : Enabled ICMP-ERROR : Enabled ILS : Enabled MGCP : Enabled NBT : Enabled PPTP : Enabled RTSP : Enabled RSH : Enabled SCCP : Enabled SIP : Enabled SQLNET : Enabled TFTP : Enabled XDMCP : Enabled # Use the display nat session verbose command to display NAT session information generated when Host A accesses the Web server. [Router] display nat session verbose Initiator: Source IP/port: /1694 Destination IP/port: /8080 DS-Lite tunnel peer: - VPN instance/vlan ID/VLL ID: -/-/- Protocol: TCP(6) Responder: 137
151 Source IP/port: /8080 Destination IP/port: /1025 DS-Lite tunnel peer: - VPN instance/vlan ID/VLL ID: -/-/- Protocol: TCP(6) State: TCP_ESTABLISHED Application: HTTP Start time: :53:29 TTL: 3597s Interface(in) : GigabitEthernet2/1/1 Interface(out): GigabitEthernet2/1/2 Initiator->Responder: 7 packets 308 bytes Responder->Initiator: 5 packets 312 bytes Total sessions found: 1 NAT Server for external-to-internal access Network requirements As shown in Figure 57, two Web servers, one FTP server and one SMTP server are in the internal network to provide services for external users. The internal network address is /16. The company has three public IP addresses from /24 to /24. Configure the NAT Server feature to allow the external user to access the internal servers with public address /24. Figure 57 Network diagram Configuration procedure # Specify IP addresses for the interfaces. (Details not shown.) # Enter interface view of GigabitEthernet 2/1/2. <Router> system-view [Router] interface gigabitethernet 2/1/2 # Configure NAT Server to allow external users to access the FTP server by using the address and port 21. [Router-GigabitEthernet2/1/2] nat server protocol tcp global inside ftp 138
152 # Configure NAT Server to allow external users to access the Web server 1 by using the address and port 80. [Router-GigabitEthernet2/1/2] nat server protocol tcp global inside http # Configure NAT Server to allow external users to access the Web server 2 by using the address and port [Router-GigabitEthernet2/1/2] nat server protocol tcp global inside http # Configure NAT Server to allow external users to access the SMTP server by using the address and port number defined by SMTP. [Router-GigabitEthernet2/1/2] nat server protocol tcp global smtp inside smtp [Router-GigabitEthernet2/1/2] quit Verifying the configuration # Verify that the host on the external network can access the internal servers by using the NAT addresses. (Details not shown.) # Display all NAT configuration and statistics. [Router] display nat all NAT internal server information: There are 4 internal servers. Interface: GigabitEthernet2/1/2 Protocol: 6(TCP) Global IP/port: /21 Local IP/port: /21 Interface: GigabitEthernet2/1/2 Protocol: 6(TCP) Global IP/port: /25 Local IP/port: /25 Interface: GigabitEthernet2/1/2 Protocol: 6(TCP) Global IP/port: /80 Local IP/port: /80 Interface: GigabitEthernet2/1/2 Protocol: 6(TCP) Global IP/port: /8080 Local IP/port: /80 NAT logging: Log enable : Disabled Flow-begin : Disabled Flow-end : Disabled Flow-active : Disabled Port-block-assign : Disabled Port-block-withdraw : Disabled 139
153 Alarm : Disabled NAT mapping behavior: Mapping mode: Address and Port-Dependent ACL : --- NAT ALG: DNS : Enabled FTP : Enabled H323 : Enabled ICMP-ERROR : Enabled ILS : Enabled MGCP : Enabled NBT : Enabled PPTP : Enabled RTSP : Enabled RSH : Enabled SCCP : Enabled SIP : Enabled SQLNET : Enabled TFTP : Enabled XDMCP : Enabled # Use the display nat session verbose command to display NAT session information generated when Host accesses the FTP server. [Router] display nat session verbose Initiator: Source IP/port: /1694 Destination IP/port: /21 DS-Lite tunnel peer: - VPN instance/vlan ID/VLL ID: -/-/- Protocol: TCP(6) Responder: Source IP/port: /21 Destination IP/port: /1694 DS-Lite tunnel peer: - VPN instance/vlan ID/VLL ID: -/-/- Protocol: TCP(6) State: TCP_ESTABLISHED Application: FTP Start time: :53:29 TTL: 3597s Interface(in) : GigabitEthernet2/1/2 Interface(out): GigabitEthernet2/1/1 Initiator->Responder: 7 packets 308 bytes Responder->Initiator: 5 packets 312 bytes Total sessions found: 1 140
154 NAT Server for external-to-internal access through domain name Network requirements As shown in Figure 58, Web server at /24 in the internal network provides services for external users. A DNS server at /24 is used to resolve the domain name of the Web server. The company has two public IP addresses: and Configure NAT Server to allow external users to access the internal Web server by using the domain name. Figure 58 Network diagram Requirements analysis To meet the network requirements, perform the following tasks: To make sure the external host can access the internal DNS server, configure the NAT Server feature to map the internal IP address and port of the DNS server to an external address and port. Enable DNS with ALG and configure outbound dynamic NAT to translate the internal IP address of the Web server in the payload of the DNS response packet to an external IP address. Configuration procedure # Specify IP addresses for the interfaces. (Details not shown.) # Enable NAT with ALG and with DNS. <Router> system-view [Router] nat alg dns # Configure ACL 2000, and create a rule to permit packets only from to pass through. [Router] acl number 2000 [Router-acl-basic-2000] rule permit source [Router-acl-basic-2000] quit # Create address group 1. [Router] nat address-group 1 # Add address to the group. [Router-nat-address-group-1] address [Router-nat-address-group-1] quit 141
155 # Configure NAT Server on interface GigabitEthernet 2/1/2 to map the address to External users can access the internal DNS server. [Router] interface gigabitethernet 2/1/2 [Router-GigabitEthernet2/1/2] nat server protocol udp global inside domain # Enable outbound NO-PAT on interface GigabitEthernet 2/1/2. Use the address in address group 1 to translate the internal address in DNS response payload, and allow reversible NAT. [Router-GigabitEthernet2/1/2] nat outbound 2000 address-group 1 no-pat reversible [Router-GigabitEthernet2/1/2] quit Verifying the configuration # Verify that the host on the external network can access the internal Web server by using the server's domain name. (Details not shown.) # Display all NAT configuration and statistics. [Router] display nat all NAT address group information: There are 1 NAT address groups. Address group 1: Address information: Start address End address NAT outbound information: There are 1 NAT outbound rules. Interface: GigabitEthernet2/1/2 ACL: 2000 Address group: 1 Port-preserved: N NO-PAT: Y Reversible: Y NAT internal server information: There are 1 internal servers. Interface: GigabitEthernet2/1/2 Protocol: 17(UDP) Global IP/port: /53 Local IP/port: /53 NAT logging: Log enable : Disabled Flow-begin : Disabled Flow-end : Disabled Flow-active : Disabled Port-block-assign : Disabled Port-block-withdraw : Disabled Alarm : Disabled NAT mapping behavior: Mapping mode: Address and Port-Dependent ACL :
156 NAT ALG: DNS : Enabled FTP : Enabled H323 : Enabled ICMP-ERROR : Enabled ILS : Enabled MGCP : Enabled NBT : Enabled PPTP : Enabled RTSP : Enabled RSH : Enabled SCCP : Enabled SIP : Enabled SQLNET : Enabled TFTP : Enabled XDMCP : Enabled # Use the display nat session verbose command to display NAT session information generated when Host accesses Web server. [Router] display nat session verbose Initiator: Source IP/port: /1694 Destination IP/port: /8080 DS-Lite tunnel peer: - VPN instance/vlan ID/VLL ID: -/-/- Protocol: TCP(6) Responder: Source IP/port: /8080 Destination IP/port: /1694 DS-Lite tunnel peer: - VPN instance/vlan ID/VLL ID: -/-/- Protocol: TCP(6) State: TCP_ESTABLISHED Application: HTTP Start time: :53:29 TTL: 3597s Interface(in) : GigabitEthernet2/1/2 Interface(out): GigabitEthernet2/1/1 Initiator->Responder: 7 packets 308 bytes Responder->Initiator: 5 packets 312 bytes Total sessions found: 1 143
157 Bidirectional NAT for external-to-internal access through NAT Server Network requirements As shown in Figure 59, an intranet uses the segment /24. The Web server at /24 provides Web services to external users and the DNS server at /24 resolves the domain name of the Web server. The company has 3 public addresses , , and Configure NAT to allow external host at in the external network to use the domain name to access the internal Web server. Figure 59 Network diagram Requirements analysis This is a typical application of bidirectional NAT. To make sure the external host to access the internal Web server by using its domain name, configure NAT Server so that the external host can access the internal DNS server to obtain the IP address of the Web server. The IP address of the Web server overlaps with the external host and is included in the response sent by the internal DNS server to the external host. To make sure the external host reaches the Web server, configure outbound dynamic NAT with ALG and DNS mapping so that NAT can translate the Web server's address in the payload to a dynamically assigned NAT address. The external host uses the NAT address as the destination address. When a packet from the external host arrives at the NAT device, the source IP address overlaps with the real address of the Web server. Configure inbound dynamic NAT to translate the source IP address to a dynamically assigned NAT address. The NAT device has no route to the NAT address of the external host. Add a static route to the NAT address with GigabitEthernet 2/1/2 as the output interface. Configuration procedure # Specify IP addresses for the interfaces. (Details not shown.) # Enable NAT with ALG and DNS. <Router> system-view [Router] nat alg dns # Configure ACL 2000, and create a rule to permit packets only from segment /24 to pass through. 144
158 [Router] acl number 2000 [Router-acl-basic-2000] rule permit source [Router-acl-basic-2000] quit # Create address group 1. [Router] nat address-group 1 # Add address to the address group. [Router-nat-address-group-1] address [Router-nat-address-group-1] quit # Create address group 2. [Router] nat address-group 2 # Add address to the address group. [Router-nat-address-group-2] address [Router-nat-address-group-2] quit # Configure NAT Server on interface GigabitEthernet 2/1/2 to allow external hosts to access the internal DNS server by using the address [Router] interface gigabitethernet 2/1/2 [Router-GigabitEthernet2/1/2] nat server protocol udp global inside domain # Enable outbound NO-PAT on interface GigabitEthernet 2/1/2 to translate IP address of the Web server in the DNS response payload into the address in address group 1, and allow reversible NAT. [Router-GigabitEthernet2/1/2] nat outbound 2000 address-group 1 no-pat reversible # Enable inbound PAT on interface GigabitEthernet 2/1/2 to translate the source address of packets going to the internal network to the address in address group 2. [Router-GigabitEthernet2/1/2] nat inbound 2000 address-group 2 [Router-GigabitEthernet2/1/2] quit # Configure a static route to with GigabitEthernet 2/1/2 as the output interface and as the next hop. (The next hop address varies by network.). [Router] ip route-static gigabitethernet 2/1/ Verifying the configuration # Verify that the host on the external network can use the domain name to access the internal Web server whose address is the same as the host. (Details not shown.) # Display all NAT configuration and statistics. [Router] display nat all NAT address group information: There are 2 NAT address groups. Address group 1: Address information: Start address End address Address group 2: Address information: Start address End address
159 NAT inbound information: There are 1 NAT inbound rules. Interface: GigabitEthernet2/1/2 ACL: 2000 Address group: 2 Add route: N NO-PAT: N Reversible: N NAT outbound information: There are 1 NAT outbound rules. Interface: GigabitEthernet2/1/2 ACL: 2000 Address group: 1 Port-preserved: N NO-PAT: Y Reversible: Y NAT internal server information: There are 1 internal servers. Interface: GigabitEthernet2/1/2 Protocol: 17(UDP) Global IP/port: /53 Local IP/port: /53 NAT logging: Log enable : Disabled Flow-begin : Disabled Flow-end : Disabled Flow-active : Disabled Port-block-assign : Disabled Port-block-withdraw : Disabled Alarm : Disabled NAT mapping behavior: Mapping mode: Address and Port-Dependent ACL : --- NAT ALG: DNS : Enabled FTP : Enabled H323 : Enabled ICMP-ERROR : Enabled ILS : Enabled MGCP : Enabled NBT : Enabled PPTP : Enabled RTSP : Enabled RSH : Enabled SCCP : Enabled SIP : Enabled SQLNET : Enabled TFTP : Enabled XDMCP : Enabled 146
160 # Use the display nat session verbose command to display NAT session information generated when Host accesses the Web server. [Router] display nat session verbose Initiator: Source IP/port: /1694 Destination IP/port: /8080 DS-Lite tunnel peer: - VPN instance/vlan ID/VLL ID: -/-/- Protocol: TCP(6) Responder: Source IP/port: /8080 Destination IP/port: /1025 DS-Lite tunnel peer: - VPN instance/vlan ID/VLL ID: -/-/- Protocol: TCP(6) State: TCP_ESTABLISHED Application: HTTP Start time: :53:29 TTL: 3597s Interface(in) : GigabitEthernet2/1/2 Interface(out): GigabitEthernet2/1/1 Initiator->Responder: 7 packets 308 bytes Responder->Initiator: 5 packets 312 bytes Total sessions found: 1 NAT hairpin in C/S mode Network requirements As shown in Figure 60, the internal FTP server at /24 provides services for internal and external users. Configure NAT hairpin in C/S mode to allow external and internal users to access the internal FTP server. Figure 60 Network diagram Requirements analysis This is a typical NAT hairpin application in C/S mode. 147
161 Configure NAT Server on the interface that connects the external network to make sure an external host can access the internal FTP server by using a NAT address. Enable NAT hairpin on the interface that connects the internal network to make sure internal hosts can access the internal FTP server by using a NAT address. The destination address is translated by matching the NAT Server configuration. The source address is translated by matching outbound dynamic or static NAT configuration on the interface where NAT Server is configured. In this example, the source address is translated by matching outbound dynamic NAT. Configuration procedure # Specify IP addresses for the interfaces. (Details not shown.) # Configure ACL 2000, and create a rule to permit packets only from segment /24 to be translated. <Router> system-view [Router] acl number 2000 [Router-acl-basic-2000] rule permit source [Router-acl-basic-2000] quit # Configure NAT Server on interface GigabitEthernet 2/1/2 to map the IP address of the FTP server to a NAT address, allowing external users to access the internal FTP server. [Router] interface gigabitethernet 2/1/2 [Router-GigabitEthernet2/1/2] nat server protocol tcp global inside ftp # Enable outbound NAT with Easy IP on interface GigabitEthernet 2/1/2 so that NAT translates the source addresses of the packets from internal hosts into the IP address of interface GigabitEthernet 2/1/2. [Router-GigabitEthernet2/1/2] nat outbound 2000 [Router-GigabitEthernet2/1/2] quit # Enable NAT hairpin on interface GigabitEthernet 2/1/1. [Router] interface gigabitethernet 2/1/1 [Router-GigabitEthernet2/1/1] nat hairpin enable [Router-GigabitEthernet2/1/1] quit Verifying the configuration # Verify that both internal and external hosts can access the internal FTP server through the external address. (Details not shown.) # Display all NAT configuration and statistics. [Router]display nat all NAT outbound information: There are 1 NAT outbound rules. Interface: GigabitEthernet2/1/2 ACL: 2000 Address group: --- Port-preserved: N NO-PAT: N Reversible: N NAT internal server information: There are 1 internal servers. Interface: GigabitEthernet2/1/2 Protocol: 6(TCP) Global IP/port: /21 Local IP/port: /21 148
162 NAT logging: Log enable : Disabled Flow-begin : Disabled Flow-end : Disabled Flow-active : Disabled Port-block-assign : Disabled Port-block-withdraw : Disabled Alarm : Disabled NAT hairpinning: There are 1 interfaces enabled with NAT hairpinning. Interface: GigabitEthernet2/1/1 NAT mapping behavior: Mapping mode: Address and Port-Dependent ACL : --- NAT ALG: DNS : Enabled FTP : Enabled H323 : Enabled ICMP-ERROR : Enabled ILS : Enabled MGCP : Enabled NBT : Enabled PPTP : Enabled RTSP : Enabled RSH : Enabled SCCP : Enabled SIP : Enabled SQLNET : Enabled TFTP : Enabled XDMCP : Enabled # Use the display nat session verbose command to display NAT session information generated when Host A accesses the FTP server. [Router] display nat session verbose Initiator: Source IP/port: /1694 Destination IP/port: /21 VPN instance/vlan ID/VLL ID: -/-/- Protocol: TCP(6) Responder: Source IP/port: /21 Destination IP/port: /1025 VPN instance/vlan ID/VLL ID: -/-/- Protocol: TCP(6) State: TCP_ESTABLISHED 149
163 Application: FTP Start time: :53:29 TTL: 3597s Interface(in) : GigabitEthernet2/1/1 Interface(out): GigabitEthernet2/1/1 Initiator->Responder: 7 packets 308 bytes Responder->Initiator: 5 packets 312 bytes Total sessions found: 1 NAT hairpin in P2P mode for access between internal users Network requirements In the P2P application, internal clients must register their IP address to the external server and the server records the registered IP addresses and port numbers of the internal clients. An internal client must request the IP address and port number of another client from the external server before accessing the client. Configure NAT hairpin so that: The internal clients can register the same external address to the external server. The internal clients can access each other through the IP address and port number obtained from the server. Figure 61 Network diagram Requirements analysis This is a typical application of NAT hairpin in P2P mode. Configure outbound dynamic NAT on the interface that connects the external network so that the source address of the clients are translated when they register their IP addresses to the external server. Configure PAT of the Endpoint-Independent Mapping mode. The translation of the clients' addresses is endpoint-independent because the registered IP address and port number should be accessible for any source address. Enable NAT hairpin on the interface that connects the internal network so that internal clients can access each other through the external address. Configuration procedure # Specify IP addresses for the interfaces. (Details not shown.) 150
164 # Configure ACL 2000, and create a rule to permit packets only from segment /24 to be translated. <Router> system-view [Router] acl number 2000 [Router-acl-basic-2000] rule permit source [Router-acl-basic-2000] quit # Configure outbound dynamic PAT with Easy IP on interface GigabitEthernet 2/1/2. The IP address of GigabitEthernet 2/1/2 is used as the NAT address for the source address translation of the packets from internal to external. [Router] interface gigabitethernet 2/1/2 [Router-GigabitEthernet2/1/2] nat outbound 2000 [Router-GigabitEthernet2/1/2] quit # Configure the Endpoint-Independent Mapping mode for PAT. For packets with the same source address and port number and permitted by ACL 2000, the source address and port number are translated to the same external address and port number. [Router] nat mapping-behavior endpoint-independent acl 2000 # Enable NAT hairpin on interface GigabitEthernet 2/1/1. [Router] interface gigabitethernet 2/1/1 [Router-GigabitEthernet2/1/1] nat hairpin enable [Router-GigabitEthernet2/1/1] quit Verifying the configuration # Verify that Host A, Host B, and Host C can access each other after they register their IP addresses and port numbers to the external server. (Details not shown.) # Display all NAT configuration and statistics. [Router] display nat all NAT outbound information: There are 1 NAT outbound rules. Interface: GigabitEthernet2/1/2 ACL: 2000 Address group: --- Port-preserved: N NO-PAT: N Reversible: N NAT logging: Log enable : Disabled Flow-begin : Disabled Flow-end : Disabled Flow-active : Disabled Port-block-assign : Disabled Port-block-withdraw : Disabled Alarm : Disabled NAT hairpinning: There are 1 interfaces enabled with NAT hairpinning. Interface: GigabitEthernet2/1/1 NAT mapping behavior: Mapping mode: Endpoint-Independent 151
165 ACL : 2000 NAT ALG: DNS : Enabled FTP : Enabled H323 : Enabled ICMP-ERROR : Enabled ILS : Enabled MGCP : Enabled NBT : Enabled PPTP : Enabled RTSP : Enabled RSH : Enabled SCCP : Enabled SIP : Enabled SQLNET : Enabled TFTP : Enabled XDMCP : Enabled # Use the display nat session verbose command to display NAT session information generated when Client A accesses Client B. [Router] display nat session verbose Initiator: Source IP/port: /44929 Destination IP/port: /1 DS-Lite tunnel peer: - VPN instance/vlan ID/VLL ID: -/-/- Protocol: UDP(17) Responder: Source IP/port: /69 Destination IP/port: /1024 DS-Lite tunnel peer: - VPN instance/vlan ID/VLL ID: -/-/- Protocol: UDP(17) State: UDP_READY Application: TFTP Start time: :53:36 TTL: 46s Interface(in) : GigabitEthernet2/1/1 Interface(out): GigabitEthernet2/1/1 Initiator->Responder: 1 packets 56 bytes Responder->Initiator: 1 packets 72 bytes Total sessions found: 1 152
166 Twice NAT for access between two VPNs with overlapping addresses Network requirements As shown in Figure 62, two departments are in different VPN instances with overlapping addresses. Configure twice NAT so that Host A and Host B in different departments can access each other. Figure 62 Network diagram Requirements analysis This is a typical application of twice NAT. Both the source and destination addresses of packets between the two VPNs need to be translated. Configure static NAT on both interfaces that connects the VPNs on the NAT device. Configuration procedure # Specify VPN instances and IP addresses for the interfaces. (Details not shown.) # Configure a static outbound NAT mapping between in vpn 1 and in vpn 2. <Router> system-view [Router] nat static outbound vpn-instance vpn vpn-instance vpn2 # Configure a static outbound NAT mapping between in vpn 2 and in vpn 1. [Router] nat static outbound vpn-instance vpn vpn-instance vpn1 # Enable static NAT on interface GigabitEthernet 2/1/2. [Router] interface gigabitethernet 2/1/2 [Router-GigabitEthernet2/1/2] nat static enable [Router-GigabitEthernet2/1/2] quit # Enable static NAT on interface GigabitEthernet 2/1/1. [Router] interface gigabitethernet 2/1/1 [Router-GigabitEthernet2/1/1] nat static enable [Router-GigabitEthernet2/1/1] quit Verifying the configuration # Verify that Host A and Host B can access each other. The NAT address for Host A is and that for Host B is (Details not shown.) # Display all NAT configuration and statistics. [Router] display nat all Static NAT mappings: There are 2 outbound static NAT mappings. IP-to-IP: Local IP : Global IP :
167 Local VPN : vpn1 Global VPN: vpn2 IP-to-IP: Local IP : Global IP : Local VPN : vpn2 Global VPN: vpn1 Interfaces enabled with static NAT: There are 2 interfaces enabled with static NAT. Interface: GigabitEthernet2/1/1 GigabitEthernet2/1/2 NAT logging: Log enable : Disabled Flow-begin : Disabled Flow-end : Disabled Flow-active : Disabled Port-block-assign : Disabled Port-block-withdraw : Disabled Alarm : Disabled NAT mapping behavior: Mapping mode: Address and Port-Dependent ACL : --- NAT ALG: DNS : Enabled FTP : Enabled H323 : Enabled ICMP-ERROR : Enabled ILS : Enabled MGCP : Enabled NBT : Enabled PPTP : Enabled RTSP : Enabled RSH : Enabled SCCP : Enabled SIP : Enabled SQLNET : Enabled TFTP : Enabled XDMCP : Enabled # Use the display nat session verbose command to display NAT session information generated when Host A accesses Host B. [Router] display nat session verbose Initiator: Source IP/port: /
168 Destination IP/port: /2048 DS-Lite tunnel peer: - VPN instance/vlan ID/VLL ID: vpn1/-/- Protocol: ICMP(1) Responder: Source IP/port: /42496 Destination IP/port: /0 DS-Lite tunnel peer: - VPN instance/vlan ID/VLL ID: vpn2/-/- Protocol: ICMP(1) State: ICMP_REPLY Application: OTHER Start time: :30:49 TTL: 27s Interface(in) : GigabitEthernet2/1/1 Interface(out): GigabitEthernet2/1/2 Initiator->Responder: 5 packets 420 bytes Responder->Initiator: 5 packets 420 bytes Total sessions found: 1 Load sharing NAT Server configuration example Network requirements As shown in Figure 63, three FTP servers are in the intranet to provide FTP services for external users. Configure NAT so that these external users use the address /16 to access the servers and the three FTP servers implement load sharing. Figure 63 Network diagram /16 FTP server 1 GE2/1/ /16 GE2/1/ /16 Internet Router Host FTP server /16 FTP server /16 Configuration procedure # Specify IP addresses for the interfaces. (Details not shown.) # Create NAT Server group 0, and add members to the group. <Router> system-view [Router] nat server-group 0 [Router-nat-server-group-0] inside ip port 21 [Router-nat-server-group-0] inside ip port
169 [Router-nat-server-group-0] inside ip port 21 [Router-nat-server-group-0] quit # Associate NAT Server group 0 with GigabitEthernet 2/1/2 so that servers in the server group can provide FTP services. [Router] interface gigabitethernet 2/1/2 [Router-GigabitEthernet2/1/2] nat server protocol tcp global ftp inside server-group 0 [Router-GigabitEthernet2/1/2] quit Verifying the configuration # Verify that external hosts can access the internal FTP server group. (Details not shown.) # Display all NAT configuration and statistics. [Router] display nat all NAT server group information: There are 1 NAT server groups. Group Number Inside IP Port Weight NAT internal server information: There are 1 internal servers. Interface: GigabitEthernet2/1/2 Protocol: 6(TCP) Global IP/port: /21 Local IP/port: server group /21 (Connections: 1) /21 (Connections: 2) /21 (Connections: 2) NAT logging: Log enable : Disabled Flow-begin : Disabled Flow-end : Disabled Flow-active : Disabled Port-block-assign : Disabled Port-block-withdraw : Disabled Alarm : Disabled NAT mapping behavior: Mapping mode: Address and Port-Dependent ACL : --- NAT ALG: DNS : Enabled FTP : Enabled H323 : Enabled ICMP-ERROR : Enabled 156
170 ILS MGCP NBT PPTP RTSP RSH SCCP SIP SQLNET TFTP XDMCP : Enabled : Enabled : Enabled : Enabled : Enabled : Enabled : Enabled : Enabled : Enabled : Enabled : Enabled # Use the display nat session verbose command to display NAT session information generated when external hosts access an internal FTP server. [Router] display nat session verbose Initiator: Source IP/port: /53957 Destination IP/port: /21 DS-Lite tunnel peer: - VPN instance/vlan ID/VLL ID: -/-/- Protocol: TCP(6) Responder: Source IP/port: /21 Destination IP/port: /53957 DS-Lite tunnel peer: - VPN instance/vlan ID/VLL ID: -/-/- Protocol: TCP(6) State: TCP_ESTABLISHED Application: FTP Start time: :06:07 TTL: 26s Interface(in) : GigabitEthernet2/1/2 Interface(out): GigabitEthernet2/1/1 Initiator->Responder: 1 packets 60 bytes Responder->Initiator: 2 packets 120 bytes Total sessions found: 5 NAT with DNS mapping configuration example Network requirements As shown in Figure 64, the internal Web server at /16 and FTP server at /16 provide services for external user. The company has three public addresses through The DNS server at is on the external network. Configure NAT so that: The public IP address is used by external users to access the Web and FTP servers. External users can use the public address or domain name of internal servers to access them. Internal users can access the internal servers by using their domain names. 157
171 Figure 64 Network diagram /16 Web server /16 FTP server /24 DNS server GE2/1/ /16 GE2/1/ /24 Internet Router Host A /16 Host B /24 Requirements analysis Configure NAT Server by mapping the internal IP addresses and port numbers of the internal servers to a public address and port numbers so that external users can access the interval servers. Configure NAT with DNS mapping and ALG so that the external IP address of the internal server in the payload of the DNS response packet can be translated to the internal IP address. Configuration procedure # Specify IP addresses for the interfaces. (Details not shown.) # Enable NAT with ALG and DNS. <Router> system-view [Router] nat alg dns # Enter interface view of GigabitEthernet 2/1/2. [Router] interface gigabitethernet 2/1/2 # Configure NAT Server to allow external hosts to access the internal Web server by using the address [Router-GigabitEthernet2/1/2] nat server protocol tcp global inside http # Configure NAT Server to allow external hosts to access the internal FTP server by using the address [Router-GigabitEthernet2/1/2] nat server protocol tcp global inside ftp # Enable outbound NAT with Easy IP on interface GigabitEthernet 2/1/2. [Router-GigabitEthernet2/1/2] nat outbound [Router-GigabitEthernet2/1/2] quit # Configure two DNS mapping entries by mapping the domain name of the Web server to , and ftp.server.com of the FTP server to [Router] nat dns-map domain protocol tcp ip port http [Router] nat dns-map domain ftp.server.com protocol tcp ip port ftp [Router] quit Verifying the configuration # Verify that both internal and external hosts can access the internal servers by using domain names. (Details not shown.) # Display all NAT configuration and statistics. 158
172 [Router] display nat all NAT outbound information: There are 1 NAT outbound rules. Interface: GigabitEthernet2/1/2 ACL: --- Address group: --- Port-preserved: N NO-PAT: N Reversible: N NAT internal server information: There are 2 internal servers. Interface: GigabitEthernet2/1/2 Protocol: 6(TCP) Global IP/port: /21 Local IP/port: /21 Interface: GigabitEthernet2/1/2 Protocol: 6(TCP) Global IP/port: /80 Local IP/port: /80 NAT DNS mapping information: There are 2 NAT DNS mappings. Domain name: ftp.server.com Global IP : Global port: 21 Protocol : TCP(6) Domain name: Global IP : Global port: 80 Protocol : TCP(6) NAT logging: Log enable : Disabled Flow-begin : Disabled Flow-end : Disabled Flow-active : Disabled Port-block-assign : Disabled Port-block-withdraw : Disabled Alarm : Disabled NAT mapping behavior: Mapping mode: Address and Port-Dependent ACL : --- NAT ALG: DNS FTP H323 : Enabled : Enabled : Enabled 159
173 ICMP-ERROR : Enabled ILS : Enabled MGCP : Enabled NBT : Enabled PPTP : Enabled RTSP : Enabled RSH : Enabled SCCP : Enabled SIP : Enabled SQLNET : Enabled TFTP : Enabled XDMCP : Enabled Static NAT444 configuration example Network requirements As shown in Figure 65, configure static NAT444 to allow users at private IP addresses to to use the public IP address to access the Internet. Set the port range to to 15000, and set the port block size to 500. Figure 65 Network diagram Configuration procedure # Specify IP addresses to interfaces. (Details not shown.) # Create NAT port block group 1. <Router> system-view [Router] nat port-block-group 1 # Add the private IP addresses from to to the port block group. [Router-port-block-group-1] local-ip-address # Add the public IP address member to the port block group. [Router-port-block-group-1] global-ip-pool # Set the port block size to 500. [Router-port-block-group-1] block-size 500 # Configure the port range as to [Router-port-block-group-1] port-range [Router-port-block-group-1] quit # Apply the port block group 1 to the outbound direction of GigabitEthernet 2/1/2. [Router] interface gigabitethernet 2/1/2 160
174 [Router-GigabitEthernet2/1/2] nat outbound port-block-group 1 [Router-GigabitEthernet2/1/2] quit Verifying the configuration # Verify that users at the private IP addresses can access the Internet. (Details not shown.) # Display all NAT configuration and statistics. [Router]display nat all NAT logging: Log enable : Disabled Flow-begin : Disabled Flow-end : Disabled Flow-active : Disabled Port-block-assign : Disabled Port-block-withdraw : Disabled Alarm : Disabled NAT mapping behavior: Mapping mode: Address and Port-Dependent ACL : --- NAT ALG: DNS : Enabled FTP : Enabled H323 : Enabled ICMP-ERROR : Enabled ILS : Enabled MGCP : Enabled NBT : Enabled PPTP : Enabled RTSP : Enabled RSH : Enabled SCCP : Enabled SIP : Enabled SQLNET : Enabled TFTP : Enabled XDMCP : Enabled NAT port block group information: There are 1 NAT port block groups. Port block group 1: Port range: Block size: 500 Local IP address information: Start address End address VPN instance Global IP pool information: Start address End address
175 NAT outbound port block group information: There are 1 outbound port block group items. Interface: GigabitEthernet2/1/2 Port block group: 1 # Display static NAT444 IP-to-port block mappings. [Router]display nat port-block static Local VPN Local IP Global IP Port block Connections Dynamic NAT444 configuration example Network requirements As shown in Figure 66, a company uses private IP address on network /16 and public IP addresses and Configure dynamic NAT444 with the following requirements: Only users on subnet /24 can use public IP addresses and to access the Internet. The port range for the public IP addresses is 1024 to The port block size is 300. If the ports in the assigned port block are all used, extend another port block for users. Figure 66 Network diagram Configuration procedure # Specify IP addresses for interfaces. (Details not shown.) # Create NAT address group
176 <Router> system-view [Router] nat address-group 0 # Add the public IP addresses and to the NAT address group. [Router-address-group-0] address # Configure the port range as 1024 to [Router-address-group-0] port-range # Set the port block size to 300 and the extended port block number to 1. [Router-address-group-0] port-block block-size 300 extended-block-number 1 [Router-address-group-0] quit # Configure an ACL to identify packets from subnet /24. [Router] acl number 2000 [Router-acl-basic-2000] rule permit source [Router-acl-basic-2000] quit # Configure outbound NAT444 on interface GigabitEthernet 2/1/2. [Router] interface gigabitethernet 2/1/2 [Router-GigabitEthernet2/1/2] nat outbound 2000 address-group 0 [Router-GigabitEthernet2/1/2] quit Verifying the configuration # Verify that Host A can access external servers, but Host B and Host C cannot. (Details not shown.) # Display all NAT configuration and statistics. [Router]display nat all NAT address group information: There are 1 NAT address groups. Address group 0: Port range: Port block size: 300 Extended block number: 1 Address iniformation: Start address End address NAT outbound information: There are 1 NAT outbound rules. Interface: GigabitEthernet2/1/2 ACL: 2000 Address group: 0 Port-preserved: N NO-PAT: N Reversible: N NAT logging: Log enable : Disabled Flow-begin : Disabled Flow-end : Disabled Flow-active : Disabled Port-block-assign : Disabled Port-block-withdraw : Disabled Alarm : Disabled 163
177 NAT mapping behavior: Mapping mode: Address and Port-Dependent ACL : --- NAT ALG: DNS : Enabled FTP : Enabled H323 : Enabled ICMP-ERROR : Enabled ILS : Enabled MGCP : Enabled NBT : Enabled PPTP : Enabled RTSP : Enabled RSH : Enabled SCCP : Enabled SIP : Enabled SQLNET : Enabled TFTP : Enabled XDMCP : Enabled # Display NAT statistics. [Router]display nat statistics Total session entries: 0 Total EIM entries: 0 Total inbound NO-PAT entries: 0 Total outbound NO-PAT entries: 0 Total static port block entries: 0 Total dynamic port block entries: 430 Active static port block entries: 0 Active dynamic port block entries: 1 164
178 Basic IP forwarding on the device FIB table Upon receiving a packet, the device uses the destination IP address of the packet to find a match from the forwarding information base (FIB) table, and then uses the matching entry to forward the packet. A device selects optimal routes from the routing table, and puts them into the FIB table. Each FIB entry specifies the next hop IP address and output interface for packets destined for a specific subnet or host. For more information about the routing table, see Layer 3 IP Routing Configuration Guide. Use the display fib command to display FIB table entries. The following example displays the entire FIB table. <Sysname> display fib Destination count: 4 FIB entry count: 4 Flag: U:Useable G:Gateway H:Host B:Blackhole D:Dynamic S:Static R:Relay F:FRR Destination/Mask Nexthop Flag OutInterface/Token Label / U GE2/1/1 Null / UH InLoop0 Null / U InLoop0 Null / UH InLoop0 Null A FIB entry includes the following items: Destination Destination IP address. Mask Network mask. The mask and the destination address identity the destination network. A logical AND operation between the destination address and the network mask yields the address of the destination network. For example, if the destination address is and the mask , the address of the destination network is A network mask comprises a certain number of consecutive 1s. It can be expressed in dotted decimal format or by the number of the 1s. Nexthop IP address of the next hop. Flag Route flag. OutInterface Output interface. Token MPLS Label Switched Path index number. Label Inner label. Displaying FIB table entries Execute display commands in any view. 165
179 Task Display FIB entries. Command display fib [ topology topo-name vpn-instance vpn-instance-name ] [ ip-address [ mask mask-length ] ] 166
180 Configuring fast forwarding Overview Fast forwarding reduces route lookup time and improves packet forwarding efficiency by using a high-speed cache and data-flow-based technology. It identifies a data flow by using the following fields: source IP address, source port number, destination IP address, destination port number, and protocol number. After the first packet of a flow is forwarded through the routing table, fast forwarding creates an entry for the flow and uses the entry to forward subsequent packets of the flow. Fast forwarding can process fragmented IP packets, but it does not fragment IP packets. Configuration procedure To configure fast forwarding: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable fast-forwarding load sharing. 3. Configure the aging time of fast forwarding entries. ip fast-forwarding load-sharing ip fast-forwarding aging-time aging-time By default, fast-forwarding load sharing is enabled. By default, the aging time is 30 seconds. Displaying and maintaining fast forwarding Execute display commands in any view and reset commands in user view. Task Display fast forwarding table information (MSR1000/MSR2000/MSR3000). Display fast forwarding table information (MSR4000). Display fast forwarding table information about fragmented packets (MSR1000/MSR2000/MSR3000). Display fast forwarding table information about fragmented packets (MSR4000). Display the aging time of fast forwarding entries. Clear fast forwarding table information (MSR1000/MSR2000/MSR3000). Command display ip fast-forwarding cache [ ip-address ] display ip fast-forwarding cache [ ip-address ] [ slot slot-number ] display ip fast-forwarding fragcache [ ip-address ] display ip fast-forwarding fragcache [ ip-address ] [ slot slot-number ] display ip fast-forwarding aging-time reset ip fast-forwarding cache Clear fast forwarding table information (MSR4000). reset ip fast-forwarding cache [ slot slot-number ] 167
181 Fast forwarding configuration example Network requirements As shown in Figure 67, enable fast forwarding on Router B. Figure 67 Network diagram Configuration procedure 1. Configure Router A: # Configure the IP address of interface GigabitEthernet 2/1/1. <RouterA> system-view [RouterA] interface gigabitethernet2/1/1 [RouterA-GigabitEthernet2/1/1] ip address [RouterA-GigabitEthernet2/1/1] quit # Configure a static route. [RouterA] ip route-static Configure Router C: # Configure the IP address of interface GigabitEthernet 2/1/2. <RouterC> system-view [RouterC] interface gigabitethernet 2/1/2 [RouterC-GigabitEthernet2/1/2] ip address [RouterC-GigabitEthernet2/1/2] quit # Configure a static route. [RouterC] ip route-static Configure Router B: # Enable fast-forwarding load sharing. <RouterB> system-view [RouterB] ip fast-forwarding load-sharing # Configure the IP addresses of interfaces GigabitEthernet 2/1/1 and GigabitEthernet 2/1/2. [RouterB] interface gigabitethernet2/1/1 [RouterB-GigabitEthernet2/1/1] ip address [RouterB-GigabitEthernet2/1/1] quit [RouterB] interface gigabitethernet 2/1/2 [RouterB-GigabitEthernet2/1/2] ip address [RouterB-GigabitEthernet2/1/2] quit 168
182 Verifying the configuration # Display the fast forwarding table on Router B. [RouterB] display ip fast-forwarding cache No fast-forwarding entries. The output shows that no fast forwarding entry exists. # Ping the IP address of GigabitEthernet 2/1/2 on Router C from Router A. Reply packets can be received. [RouterA] ping PING : 56 data bytes, press CTRL_C to break Reply from : bytes=56 Sequence=1 ttl=254 time=2 ms Reply from : bytes=56 Sequence=2 ttl=254 time=1 ms Reply from : bytes=56 Sequence=3 ttl=254 time=1 ms Reply from : bytes=56 Sequence=4 ttl=254 time=2 ms Reply from : bytes=56 Sequence=5 ttl=254 time=2 ms ping statistics packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 2/2/3 ms # Display the fast forwarding table on Router B. [RouterB] display ip fast-forwarding cache Total number of fast-forwarding entries: 2 SIP SPort DIP DPort Pro Input_If Output_If Flg GE2/1/2 GE2/1/ GE2/1/1 GE2/1/2 7 The output shows that fast forwarding entries have been created. 169
183 Configuring flow classification To implement differentiated services, flow classification categorizes packets to be forwarded by a multi-core device according to one of the following flow classification policies: Flow-based policy Forwards packets of a flow to the same CPU. A data flow is defined by using the following fields: source IP address, destination IP address, source port number, destination port number, and protocol number. This policy takes the first-in first-out rule. Packet-based policy Forwards packets in sequence to different CPUs, even though they are the same flow. This policy does not ensure packet order. Feature and hardware compatibility The following matrix shows the feature and hardware compatibility: Hardware MSR1000 MSR2000 MSR3000 MSR4000 Flow classification compatibility No No Yes Yes Specifying a flow classification policy IMPORTANT: If a service requires packets of a flow to be received by the same CPU, you must use the flow-based policy. To specify a flow classification policy: Step Command Remarks 1. Enter system view. system-view N/A 2. Specify a flow classification policy. forwarding policy { per-flow per-packet } By default, flow-based policy is used. 170
184 Displaying the adjacency table In this chapter, "MSR1000" refers to MSR "MSR2000" refers to MSR2003, MSR , MSR "MSR3000" collectively refers to MSR3012, MSR3024, MSR3044, MSR3064. "MSR4000" collectively refers to MSR4060 and MSR4080. The adjacency table stores information about directly connected neighbors for IP forwarding. The neighbor information in the adjacency table in this chapter refers to non-ethernet neighbor information. This table is not user configurable. The neighbor information is generated, updated, and deleted by link layer protocols through negotiation (such as PPP dynamic negotiation) or through manual configuration (such as ATM static configuration). An adjacency entry contains the neighbor network layer address (next hop), output interface, link layer protocol type, and link layer address (PVC for ATM, unavailable for PPP). When forwarding an IP packet, the device does the following: Searches the FIB to find the output interface and next hop. Uses the output interface and next hop address to search the adjacency table for link layer forwarding information that is required for forwarding the packet. NOTE: Ethernet neighbor information and non-ethernet neighbor information are stored and managed together. The following table shows the items contained in an adjacency table output: Item IP address Routing interface Physical interface Logical interface Service type Action type Link media type Link head information(ip) Link head information(ipv6) Slot Virtual circuit information Description IP address of the next hop in FIB table for packet forwarding. This address is used for adjacency table lookup. Output interface in the matching route entry. This interface is used for adjacency table lookup, and it can be logical or physical. Output physical interface that sends matching packets. If the routing interface is physical, the routing interface and physical interface are the same. If the routing interface is logical, the routing interface and physical interface are different. Logical interface for sending packets, such as a virtual-ethernet interface for ATM, or a Virtual-Template interface for MP. Link layer protocol type, such as PPP or HDLC. Action to be taken on the matching packet: Forwarding or Drop. Related to the link layer protocol used by the routing interface. P2P indicates a point-to-point link, and NBMA indicates a non-broadcast multi-access link. Link layer header for IP forwarding. Link layer header for IPv6 forwarding. ID of the slot that holds the card. Information about the virtual circuit, such as PVC or DLCI. If the entry has no virtual circuit, this field displays N/A. 171
185 Item Link head information(mpls) Description Link layer header for MPLS forwarding. To display adjacency table entries, use one of the following commands in any view: Task Display IPv4 adjacency table information (MSR1000/MSR2000/MSR3000). Display IPv4 adjacency table information (MSR4000). Display IPv6 adjacency table information (MSR1000/MSR2000/MSR3000). Display IPv6 adjacency table information (MSR4000). Command display adjacent-table { all physical-interface interface-type interface-number routing-interface interface-type interface-number } [ count verbose ] display adjacent-table { all physical-interface interface-type interface-number routing-interface interface-type interface-number slot slot-number } [ count verbose ] display ipv6 adjacent-table { all physical-interface interface-type interface-number routing-interface interface-type interface-number } [ count verbose ] display ipv6 adjacent-table { all physical-interface interface-type interface-number routing-interface interface-type interface-number slot slot-number } [ count verbose ] 172
186 Configuring IRDP The term router in this chapter refers to a routing-capable device. The term host in this chapter refers to the host that supports IRDP. For example, a host that runs the Linux operating system. Overview ICMP Router Discovery Protocol (IRDP), an extension of the ICMP, allows hosts to discover the IP addresses of neighboring routers that can be used as a default gateway to reach IP-based devices on other networks. IRDP provides the following benefits: Enables hosts to track dynamic changes in router availability. Is independent of any routing protocol. Requires a minimal amount of manual configuration. IRDP operation IRDP uses the following types of ICMP messages: Router advertisement (RA) Sent by a router to advertise IP addresses (including the primary and secondary IP addresses) and preference. Router solicitation (RS) Sent by a host to request the IP addresses of routers on the subnet. A router periodically broadcasts or multicasts an RA message from each IRDP-enabled interface, advertising the IP addresses of that interface. Hosts listen for RAs to obtain the IP addresses of neighboring routers. Upon receiving an RA, the host adds the IP addresses in the RA to its routing table. The host selects the IP address with the highest preference as the default gateway. When a host attached to the subnet starts up, the host multicasts an RS message to request immediate advertisements. If the host does not receive any advertisements to the RS, it retransmits the RS several times. If the host does not discover the IP addresses of neighboring routers because of network problems, the host can still discover them from periodic RAs. IRDP allows hosts to discover the IP addresses of neighboring routers, but it does not suggest the best route to a specific destination. If a host selects a router that is not the best next hop to a specific destination, the router will send an ICMP redirect message to the host to provide a better route. Basic concepts Preference of an IP address Every IP address advertised in RAs has a preference value. The IP address with the highest preference is selected as the default gateway address. You can specify the preference for IP addresses advertised on a router interface. 173
187 A larger preference value represents a higher preference. The minimum preference value ( ) indicates that the address, even though it might be advertised, is not to be used by neighboring hosts as a default gateway address. Lifetime of an IP address An RA contains a lifetime field that specifies the lifetime of advertised IP addresses. If no new RA for an IP address is received within the lifetime of the IP address, the host removes the corresponding route entry. All the IP addresses advertised by an interface have the same lifetime. Advertising interval A router interface with IRDP enabled sends out RAs at a random interval between the minimum advertising interval and the maximum advertising interval. This mechanism prevents the local link from being overloaded by a large number of RAs sent simultaneously from routers. HP recommends that you shorten the advertising interval on a link that suffers high packet loss rates. Destination address of RAs An RA uses either of the following destination IP addresses: Broadcast address Multicast address , which identifies all hosts on the local subnet. By default, the destination IP address of an RA is the broadcast address. If the interface that sends RAs supports multicast, specify as the destination IP address. Proxy-advertised IP addresses By default, an interface advertises its primary and secondary IP addresses. You can specify IP addresses of other gateways for an interface to proxy-advertise. Protocols and standards RFC 1256: ICMP Router Discovery Messages Configuration procedure To configure IRDP: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. interface interface-type interface-number The interface can be a Layer 3 Ethernet interface or VLAN interface. 3. Enable IRDP on the interface. ip irdp 4. (Optional.) Specify the preference of advertised primary and secondary IP addresses on the interface. ip irdp preference preference-value By default, IRDP is disabled. After IRDP is enabled on an interface, the IRDP configuration takes effect, and the device sends RA messages out of the interface. The default preference is
188 Step Command Remarks 5. (Optional.) Set the lifetime of advertised IP addresses. 6. (Optional.) Set the maximum and minimum advertising intervals. 7. (Optional.) Specify the multicast address as the destination IP address of RAs. 8. (Optional.) Specify a proxy-advertised IP address and its preference. ip irdp lifetime lifetime-value ip irdp interval max-interval-value [ min-interval-value ] ip irdp multicast ip irdp address ip-address preference-value The default lifetime is 1800 seconds. The specified lifetime applies to all advertised IP addresses, including the IP addresses of the interface and proxy-advertised IP addresses on the interface. The lifetime of the advertised IP addresses cannot be shorter than the maximum advertising interval. By default, the maximum interval is 600 seconds and the minimum interval is 3/4 of the maximum interval. By default, RAs use the broadcast address as the destination IP address. Repeat this step to specify multiple proxy-advertised IP addresses. By default, no IP address is specified. You can specify a maximum of four proxy-advertised IP addresses on an interface. IRDP configuration example Network requirements As shown in Figure 68, Host A and Host B that run the Linux operating systems support IRDP, and they are in the internal network of a company. Router A and Router B serve as the egress routers and connect to external networks /24 and /24, respectively. Configure Router A as the default gateway for the hosts. Packets to the external networks can be correctly routed. Figure 68 Network diagram 175
189 Configuration procedure 1. Configure Router A: # Specify an IP address for GigabitEthernet 2/1/1. <RouterA> system-view [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ip address # Enable IRDP on GigabitEthernet 2/1/1. [RouterA-GigabitEthernet2/1/1] ip irdp # Specify preference 1000 for advertised IP addresses on GigabitEthernet 2/1/1. [RouterA-GigabitEthernet2/1/1] ip irdp preference 1000 # Specify the multicast address as the destination IP address for RAs sent by GigabitEthernet 2/1/1. [RouterA-GigabitEthernet2/1/1] ip irdp multicast # Specify the IP address and preference 400 for GigabitEthernet 2/1/1 to proxy-advertise. [RouterA-GigabitEthernet2/1/1] ip irdp address Configure Router B: # Specify an IP address for GigabitEthernet 2/1/1. <RouterB> system-view [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] ip address # Enable IRDP on GigabitEthernet 2/1/1. [RouterB-GigabitEthernet2/1/1] ip irdp # Specify preference 500 for advertised IP addresses on GigabitEthernet 2/1/1. [RouterB-GigabitEthernet2/1/1] ip irdp preference 500 # Specify the multicast address as the destination IP address for RAs sent by GigabitEthernet 2/1/1. [RouterB-GigabitEthernet2/1/1] ip irdp multicast # Specify the IP address and preference 400 for GigabitEthernet 2/1/1 to proxy-advertise. [RouterB-GigabitEthernet2/1/1] ip irdp address Verifying the configuration # Display the routing table for Host A. [HostA@localhost ~]$ netstat -rne Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface U eth U eth U eth UG eth1 The output shows that the default route on Host A points to IP address , and Host A has routes to /24 and /
190 # Display the routing table for Host B. ~]$ netstat -rne Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface U eth U eth U eth UG eth1 The output shows that the default route on Host B points to IP address , and Host B has routes to /24 and /
191 Optimizing IP performance In this chapter, "MSR1000" refers to MSR "MSR2000" refers to MSR2003, MSR , MSR "MSR3000" collectively refers to MSR3012, MSR3024, MSR3044, MSR3064. "MSR4000" collectively refers to MSR4060 and MSR4080. Enabling an interface to receive and forward directed broadcasts destined for the directly connected network A directed broadcast packet is destined for all hosts on a specific network. In the destination IP address of the directed broadcast, the network ID identifies the target network, and the host ID is made up of all ones. If an interface is allowed to forward directed broadcasts destined for the directly connected network, hackers can exploit this vulnerability to attack the target network. In some scenarios, however, an interface must receive and send such directed broadcast packets to support UDP helper and Wake on LAN. This task enables an interface to accept directed broadcast packets that are destined for and received from the directly connected network to support UDP helper. UDP helper converts the directed broadcasts to unicasts and forwards them to a specific server. The task also enables the interface to forward directed broadcast packets that are destined for the directly connected network and are received from another subnet to support Wake on LAN. Wake on LAN sends the directed broadcasts to wake up the hosts on the target network. Configuration procedure To enable an interface to receive and forward directed broadcasts destined to the directly connected network: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Enable the interface to receive and forward directed broadcasts destined for the directly connected network. interface interface-type interface-number ip forward-broadcast N/A By default, an interface cannot forward directed broadcasts destined for the directly connected network. 178
192 Configuration example Network requirements As shown in Figure 69, the default gateway of the host is the IP address /24 of the interface GigabitEthernet 2/1/1 of Router A. Configure a static route destined for the host on Router B. Router B can receive directed broadcasts from the host to IP address Figure 69 Network diagram Configuration procedure 1. Configure Router A: # Specify IP addresses for GigabitEthernet 2/1/1 and GigabitEthernet 2/1/2. <RouterA> system-view [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ip address [RouterA-GigabitEthernet2/1/1] quit [RouterA] interface gigabitethernet 2/1/2 [RouterA-GigabitEthernet2/1/2] ip address # Enable GigabitEthernet 2/1/2 to forward directed broadcasts destined for the directly connected network. [RouterA-GigabitEthernet2/1/2] ip forward-broadcast 2. Configure Router B: # Configure a static route to the host. <RouterB> system-view [RouterB] ip route-static # Specify an IP address for GigabitEthernet 2/1/2. [RouterB] interface gigabitethernet 2/1/2 [RouterB-GigabitEthernet2/1/2] ip address # Enable GigabitEthernet 2/1/2 to receive directed broadcasts destined for the directly connected network. [RouterB-GigabitEthernet2/1/2] ip forward-broadcast After the configurations, if you ping the subnet-directed broadcast address on the host, the interface GigabitEthernet 2/1/2 of Router B can receive the ping packets. If you remove the ip forward-broadcast configuration on any router, the interface GigabitEthernet 2/1/2 of Router B cannot receive the ping packets. Configuring MTU for an interface When a packet exceeds the MTU of the output interface, the device processes it in one of the following ways: If the packet disallows fragmentation, the device discards it. 179
193 If the packet allows fragmentation, the device fragments it and forwards the fragments. Fragmentation and reassembling consume system resources, so set an appropriate MTU for an interface based on the network environment to avoid fragmentation. To configure an MTU for an interface: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Configure an MTU for the interface. interface interface-type interface-number ip mtu mtu-size N/A By default, no MTU is configured. Configuring TCP MSS for an interface The maximum segment size (MSS) option informs the receiver of the largest segment that the sender can accept. Each end announces its MSS during TCP connection establishment. If the size of a TCP segment is smaller than the MSS of the receiver, TCP sends the TCP segment without fragmentation. If not, it fragments the segment according to the receiver's MSS. If you configure a TCP MSS on an interface, the size of each TCP segment received or sent on the interface cannot exceed the MSS value. This configuration takes effect only for TCP connections established after the configuration rather than the TCP connections that already exist. This configuration is effective only for IP packets. If MPLS is enabled on the interface, do not configure the TCP MSS on the interface. To configure a TCP MSS of the interface: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Configure a TCP MSS for the interface. interface interface-type interface-number tcp mss value N/A By default, no TCP MSS is configured. Configuring TCP path MTU discovery IMPORTANT: All the devices on a TCP connection must be enabled to send ICMP error messages by using the ip unreachables enable command. TCP path MTU discovery (in RFC 1191) discovers the path MTU between the source and destination ends of a TCP connection. It works as follows: 1. A TCP source device sends a packet with the Don't Fragment (DF) bit set. 180
194 2. A router that fails to forward the packet because it exceeds the MTU on the outgoing interface discards the packet and returns an ICMP error message, which contains the MTU of the outgoing interface. 3. Upon receiving the ICMP message, the TCP source device calculates the current path MTU of the TCP connection. 4. The TCP source device sends subsequent TCP segments that each are smaller than the MSS (MSS = path MTU IP header length TCP header length). If the TCP source device still receives ICMP error messages when the MSS is smaller than 32 bytes, the TCP source device will fragment packets. An ICMP error message received from a router that does not support RFC 1191 has the MTU of the outgoing interface set to 0. Upon receiving the ICMP message, the TCP source device selects the path MTU smaller than the current path MTU from the MTU table as described in RFC 1191 to calculate the TCP MSS. The MTU table contains MTUs of 68, 296, 508, 1006, 1280, 1492, 2002, 4352, 8166, 17914, 32000, and bytes. Because the minimum TCP MSS specified by the system is 32 bytes, the actual minimum MTU is 72 bytes. After you enable TCP path MTU discovery, all new TCP connections will detect the path MTU. The device uses the path MTU to calculate the MSS to avoid IP fragmentation. The path MTU uses the following aging mechanism to make sure that the source device can increase the path MTU when the minimum link MTU on the path increases. When the TCP source device receives an ICMP error message, it reduces the path MTU and starts an age timer for the path MTU. After the age timer expires, the source device uses a larger MSS in the MTU table, as described in RFC If no ICMP error message is received within two minutes, the source device increases the MSS again until the MSS is as large as the MSS negotiated during TCP three-way handshake. To enable TCP path MTU discovery: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable TCP path MTU discovery. tcp path-mtu-discovery [ aging age-time no-aging ] The default setting is disabled. Enabling TCP SYN Cookie A TCP connection is established through a three-way handshake: 1. The sender sends a SYN packet to the server. 2. The server receives the SYN packet, establishes a TCP semi-connection in SYN_RECEIVED state, and replies with a SYN ACK packet to the sender. 3. The sender receives the SYN ACK packet and replies with an ACK packet. A TCP connection is established. An attacker can exploit this mechanism to mount SYN Flood attacks. The attacker sends a large number of SYN packets, but does not respond to the SYN ACK packets from the server. As a result, the server establishes a large number of TCP semi-connections and can no longer handle normal services. 181
195 SYN Cookie can protect the server from SYN Flood attacks. When the server receives a SYN packet, it responds with a SYN ACK packet without establishing a TCP semi-connection. The server establishes a TCP connection and enters ESTABLISHED state only when it receives an ACK packet from the client. To enable TCP SYN Cookie: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable SYN Cookie. tcp syn-cookie enable The default setting is disabled. Configuring the TCP buffer size Step Command Remarks 1. Enter system view. system-view N/A 2. Configure the size of TCP receive/send buffer. tcp window window-size The default buffer size is 64 KB. Configuring TCP timers You can configure the following TCP timers: SYN wait timer TCP starts the SYN wait timer after sending a SYN packet. If no response packet is received within the SYN wait timer interval, TCP fails to establish the connection. FIN wait timer TCP starts the FIN wait timer when the state changes to FIN_WAIT_2. If no FIN packet is received within the timer interval, TCP terminates the connection. If a FIN packet is received, TCP changes connection state to TIME_WAIT. If a non-fin packet is received, TCP restarts the timer, and tears down the connection when the timer expires. To configure TCP timers: Step Command Remarks 1. Enter system view. system-view N/A 2. Configure TCP timers. Configure the TCP SYN wait timer: tcp timer syn-timeout time-value Configure the TCP FIN wait timer: tcp timer fin-timeout time-value By default: The TCP SYN wait timer is 75 seconds. The TCP FIN wait timer is 675 seconds. Enabling sending ICMP error messages Perform this task to enable sending ICMP error messages, including redirect, time-exceeded, and destination unreachable messages. ICMP redirect messages 182
196 A host that has only one default route sends all packets to the default gateway. The default gateway sends an ICMP redirect message to inform the host of a correct next hop by following these rules: The receiving and sending interfaces are the same. The selected route is not created or modified by any ICMP redirect messages. The selected route is not destined for There is no source route option in the received packet. ICMP redirect messages simplify host management and enable hosts to gradually optimize their routing table. ICMP time exceeded messages A device sends ICMP time exceeded messages by following these rules: If a received packet is not destined for the device and the TTL field of the packet is 1, the device sends an ICMP TTL exceeded in transit message to the source. When the device receives the first fragment of an IP datagram destined for it, it starts a timer. If the timer expires before all the fragments of the datagram are received, the device sends an ICMP fragment reassembly time exceeded message to the source. ICMP destination unreachable messages A device sends ICMP destination unreachable messages by following these rules: If a packet does not match any route and there is no default route in the routing table, the device sends an ICMP network unreachable message to the source. If a packet is destined for the device but the transport layer protocol of the packet is not supported by the device, the device sends an ICMP protocol unreachable message to the source. NOTE: If a DHCP enabled device receives an ICMP echo reply without sending any ICMP echo requests, the device does not send any ICMP protocol unreachable messages to the source. For more information about DHCP, see Layer 3 IP Services Configuration Guide. If a UDP packet is destined for the device but the packet's port number does not match the corresponding process, the device sends the source an ICMP port unreachable message. If the source uses Strict Source Routing to send packets, but the intermediate device finds that the next hop specified by the source is not directly connected, the device sends the source an ICMP source route failed message. If the MTU of the sending interface is smaller than the packet and the packet has DF set, the device sends the source an ICMP fragmentation needed and DF set message. To enable sending ICMP error messages: Step Command Remarks 1. Enter system view. system-view N/A 183
197 Step Command Remarks 2. Enable sending ICMP error messages. Enable sending ICMP redirect messages: ip redirects enable Enable sending ICMP time exceeded messages: ip ttl-expires enable Enable sending ICMP destination unreachable messages: ip unreachables enable The default settings are disabled. Sending ICMP error messages facilitates network management, but sending excessive ICMP messages increases network traffic. A device's performance degrades if it receives a lot of malicious ICMP messages that cause it to respond with ICMP error messages. To prevent such problems, you can disable the device from sending ICMP error messages. A device that is disabled from sending ICMP time exceeded messages does not send ICMP TTL exceeded in transit messages. However, it can still send ICMP fragment reassembly time exceeded messages. Configuring rate limit for ICMP error messages To avoid sending excessive ICMP error messages within a short period that might cause network congestion, you can limit the rate at which ICMP error messages are sent. A token bucket algorithm is used with one token representing one ICMP error message. Tokens are placed in the bucket at intervals until the maximum number of tokens that the bucket can hold is reached. Tokens are removed from the bucket when ICMP error messages are sent. When the bucket is empty, ICMP error messages are not sent until a new token is placed in the bucket. To configure rate limit for ICMP error messages: Step Command Remarks 1. Enter system view. system-view N/A 2. Set the interval and bucket size for ICMP error messages. ip icmp error-interval milliseconds [ bucketsize ] By default, the bucket allows a maximum of 10 tokens, and tokens are placed in the bucket at the interval of 100 milliseconds. To disable the ICMP rate limit, set the interval to 0 milliseconds. Specifying the source address for ICMP packets Perform this task to specify the source IP address for outgoing ping echo request and ICMP error messages. HP recommends that you specify the IP address of the loopback interface as the source IP address. This feature helps users to locate the sending device easily. If you specify an IP address in the ping command, ping echo requests use the specified address as the source IP address rather than the IP address specified by the ip icmp source command. 184
198 To specify the source IP address for ICMP packets: Step Command Remarks 1. Enter system view. system-view N/A 2. Specify the source address for outgoing ICMP packets. ip icmp source [ vpn-instance vpn-instance-name ] ip-address By default, the device uses the IP address of the sending interface as the source IP address for outgoing ICMP packets. Displaying and maintaining IP performance optimization Execute display commands in any view and reset commands in user view. Task Display brief information about RawIP connections (MSR1000/MSR2000/MSR3000). Display brief information about RawIP connections (MSR4000). Display detailed information about RawIP connections (MSR1000/MSR2000/MSR3000). Display detailed information about RawIP connections (MSR4000). Display brief information about TCP connections (MSR1000/MSR2000/MSR3000). Display brief information about TCP connections (MSR4000). Display detailed information about TCP connections (MSR1000/MSR2000/MSR3000). Display detailed information about TCP connections (MSR4000). Display brief information about UDP connections (MSR1000/MSR2000/MSR3000). Display brief information about UDP connections (MSR4000). Display detailed information about UDP connections (MSR1000/MSR2000/MSR3000). Display detailed information about UDP connections (MSR4000). Display IP packet statistics (MSR1000/MSR2000/MSR3000). Command display rawip display rawip [ slot slot-number ] display rawip verbose [ pcb pcb-index ] display rawip verbose [ slot slot-number [ pcb pcb-index ] ] display tcp display tcp [ slot slot-number ] display tcp verbose [ pcb pcb-index ] display tcp verbose [ slot slot-number [ pcb pcb-index ] ] display udp display udp [ slot slot-number ] display udp verbose [ pcb pcb-index ] display udp verbose [ slot slot-number [ pcb pcb-index ] ] display ip statistics Display IP packet statistics (MSR4000). display ip statistics [ slot slot-number ] 185
199 Task Display TCP traffic statistics (MSR1000/MSR2000/MSR3000). Command display tcp statistics Display TCP traffic statistics (MSR4000). display tcp statistics [ slot slot-number ] Display UDP traffic statistics (MSR1000/MSR2000/MSR3000). display udp statistics Display UDP traffic statistics (MSR4000). display udp statistics [ slot slot-number ] Display ICMP traffic statistics (MSR1000/MSR2000/MSR3000). display icmp statistics Display ICMP traffic statistics (MSR4000). display icmp statistics [ slot slot-number ] Clear IP packet statistics (MSR1000/MSR2000/MSR3000). reset ip statistics Clear IP packet statistics (MSR4000). reset ip statistics [ slot slot-number ] Clear TCP traffic statistics. Clear UDP traffic statistics. reset tcp statistics reset udp statistics 186
200 Configuring UDP helper Overview UDP helper can provide the following packet conversion for packets with specific UDP destination port numbers: Convert broadcast to unicast, and forward the unicast packets to specific destinations. Convert broadcast to multicast, and forward the multicast packets. Convert multicast to broadcast or unicast, and forward the broadcast or unicast packets. Configuration restrictions and guidelines When you configure UDP helper, follow these restrictions and guidelines: By default, an interface on the device does not receive directed broadcasts destined for the directly connected network. To use UDP helper, execute the ip forward-broadcast command. For more information about receiving directed broadcasts destined for the directly connected network, see "Optimizing IP performance." Do not set UDP ports 67 and 68 for UDP helper, because UDP helper cannot forward DHCP broadcast packets. You can specify a maximum of 256 UDP ports for UDP helper. You can specify up to 20 unicast and multicast addresses for UDP helper to convert broadcast packets on an interface. You can map one multicast address to a maximum of 16 broadcast and unicast addresses for UDP helper to convert multicast packets on an interface. Configuring UDP helper to convert broadcast to unicast You can configure UDP helper to convert broadcast packets with specific UDP port numbers to unicast packets. Upon receiving a UDP broadcast packet, UDP helper matches the UDP destination port number of the packet against the configured UDP ports. If a match is found, UDP helper duplicates the packet and modifies the destination IP address of the copy to the configured unicast address. Then UDP helper forwards the unicast packet to the unicast address. If no match is found, UDP helper does not process the packet. To configure UDP helper to convert broadcast to unicast: 187
201 Step Command Remarks 1. Enter system view. system-view N/A 2. Enable UDP helper. udp-helper enable By default, UDP helper is disabled. 3. Specify a UDP port. udp-helper port { port-number dns netbios-ds netbios-ns tacacs tftp time } By default, no UDP port is specified. 4. Enter interface view. interface interface-type interface-number N/A 5. Specify a destination server for UDP helper to convert broadcast to unicast. udp-helper server ip-address [ global vpn-instance vpn-instance-name ] By default, no destination server is specified. If you specify multiple destination servers, UDP helper creates one copy for each server. Use this command on the interface that receives broadcast packets. Configuring UDP helper to convert broadcast to multicast You can configure UDP helper to convert broadcast packets with specific UDP port numbers to multicast packets. Upon receiving a UDP broadcast packet, UDP helper matches the UDP destination port number of the packet against the configured UDP ports. If a match is found, UDP helper duplicates the packet and modifies the destination IP address of the copy to the configured multicast address. Then UDP helper forwards the packet to the multicast group. If no match is found, UDP helper does not process the packet. To configure UDP helper to convert broadcast to multicast: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable UDP helper. udp-helper enable By default, UDP helper is disabled. 3. Specify a UDP port. udp-helper port { port-number dns netbios-ds netbios-ns tacacs tftp time } By default, no UDP port is specified. 4. Enter interface view. interface interface-type interface-number N/A 188
202 Step Command Remarks 5. Specify a destination multicast address for UDP helper to convert broadcast to multicast. udp-helper broadcast-map multicast-address [ acl acl-number ] By default, no destination multicast address is specified for UDP helper. If you specify multiple multicast addresses, UDP helper creates one copy for each address. Use this command on the interface that receives broadcast packets. Configuring UDP helper to convert multicast to broadcast or unicast You can configure UDP helper to convert multicast packets with specific UDP port numbers and multicast addresses to broadcast or unicast packets. Upon receiving a UDP multicast packet, UDP helper matches the UDP destination port number of the packet against the configured UDP ports. If a match is found, UDP helper searches the configured mappings based on the packet's destination multicast address. If a match is found, UDP helper duplicates the packet and modifies the destination IP address of the copy to the mapping broadcast or unicast address. Then UDP helper forwards the packet to its destination. If no match is found, UDP helper does not process the packet. If the packet's destination port number does not match the configured UDP ports, UDP helper does not process the packet. To configure UDP helper to convert multicast to broadcast or unicast: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable UDP helper. udp-helper enable By default, UDP helper is disabled. 3. Specify a UDP port. 4. Enter interface view. udp-helper port { port-number dns netbios-ds netbios-ns tacacs tftp time } interface interface-type interface-number By default, no UDP port is specified. N/A 189
203 Step Command Remarks 5. Map a multicast address to a directed broadcast or a unicast address for UDP helper. udp-helper multicast-map multicast-address ip-address [ global vpn-instance vpn-instance-name ] [ acl acl-number ] By default, no address mapping is specified for UDP helper. If you specify multiple multicast and unicast addresses, UDP helper creates one copy for each address. For multicast to broadcast conversion, do not specify a limited broadcast address for the ip-address argument. Use this command on the interface that receives multicast packets. Displaying and maintaining UDP helper Execute display command in any view and reset command in user view. Task Display information about broadcast to unicast conversion by UDP helper on an interface. Clear packet statistics for UDP helper. Command display udp-helper interface interface-type interface-number reset udp-helper statistics UDP helper configuration examples Configuring UDP helper to convert broadcast to unicast Network requirements As shown in Figure 70, configure UDP helper to convert broadcast to unicast on GigabitEthernet 2/1/1 of Router A. This feature enables Router A to forward broadcast packets with UDP destination port 55 to the destination server /16. Figure 70 Network diagram Configuration procedure Make sure Router A can reach the subnet /
204 # Enable UDP helper. <RouterA> system-view [RouterA] udp-helper enable # Enable UDP helper to forward broadcast packets with the UDP destination port 55. [RouterA] udp-helper port 55 # Associate interface GigabitEthernet 2/1/2 with VPN instance a. [RouterA] interface gigabitethernet 2/1/2 [RouterA-GigabitEthernet2/1/2] ip binding vpn-instance a [RouterA-GigabitEthernet2/1/2] quit # Specify the destination server in VPN instance a on the interface GigabitEthernet 2/1/1. [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ip address [RouterA-GigabitEthernet2/1/1] udp-helper server vpn-instance a Verifying the configuration # Display information about broadcast to unicast conversion by UDP helper on GigabitEthernet 2/1/1. [RouterA-GigabitEthernet2/1/1] display udp-helper interface gigabitethernet 2/1/1 Interface Server VPN instance Server address Packets sent GigabitEthernet2/1/1 a Configuring UDP helper to convert broadcast to multicast Network requirements As shown in Figure 71, Router B can receive multicast packets destined for Configure UDP helper to convert broadcast to multicast on GigabitEthernet 2/1/1 of Router A. This feature enables Router A to forward broadcast packets with UDP destination port number 55 to the multicast group Figure 71 Network diagram Configuration procedure Make sure Router A can reach the subnet /16. # Enable UDP Helper. <RouterA> system-view [RouterA] udp-helper enable # Enable UDP helper to forward broadcast packets with the UDP destination port
205 [RouterA] udp-helper port 55 # Configure UDP helper to convert broadcast packets to multicast packets destined for on GigabitEthernet 2/1/1. [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ip address [RouterA-GigabitEthernet2/1/1] udp-helper broadcast-map [RouterA-GigabitEthernet2/1/1] quit # Enable IP multicast routing globally. [RouterA] multicast routing [RouterA-mrib] quit # Enable PIM-DIM and IGMP on GigabitEthernet 2/1/1. [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] pim dm [RouterA-GigabitEthernet2/1/1] igmp enable # Configure GigabitEthernet 2/1/1 as a static member of the multicast group [RouterA-GigabitEthernet2/1/1] igmp static-group # Enable PIM-DIM and IGMP on GigabitEthernet 2/1/2. [RouterA-GigabitEthernet2/1/2] pim dm [RouterA-GigabitEthernet2/1/2] igmp enable # Configure GigabitEthernet 2/1/2 as a static member of the multicast group [RouterA-GigabitEthernet2/1/2] igmp static-group Verifying the configuration Verify that you can capture multicast packets from Router A on Router B. Configuring UDP helper to convert multicast to broadcast Network requirements As shown in Figure 72, GigabitEthernet 2/1/1 of Router B is a member of the multicast group Configure UDP helper to convert multicast to broadcast on GigabitEthernet 2/1/1 of Router A. This feature enables Router A to forward the multicast packets with UDP destination port number 55 and destination IP address from Router B to all hosts on /16. Figure 72 Network diagram 192
206 Configuration procedure Make sure Router A can reach the subnet /16. # Enable UDP helper. <RouterA> system-view [RouterA] udp-helper enable # Enable UDP helper to forward multicast packets with the UDP destination port 55. [RouterA] udp-helper port 55 # Configure UDP helper to convert multicast packets from to broadcast packets destined for [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] udp-helper multicast-map Verifying the configuration Verify that you can capture broadcast packets on all hosts on the network segment /16. The broadcast packets are from Router A. 193
207 Configuring basic IPv6 settings In this chapter, "MSR1000" refers to MSR "MSR2000" refers to MSR2003, MSR , MSR "MSR3000" collectively refers to MSR3012, MSR3024, MSR3044, MSR3064. "MSR4000" collectively refers to MSR4060 and MSR4080. Overview IPv6, also called IP next generation (IPng), was designed by the IETF as the successor to IPv4. One significant difference between IPv6 and IPv4 is that IPv6 increases the IP address size from 32 bits to 128 bits. IPv6 features Simplified header format IPv6 removes several IPv4 header fields or moves them to the IPv6 extension headers to reduce the length of the basic IPv6 packet header. The basic IPv6 packet header has a fixed length of 40 bytes to simplify IPv6 packet handling and improve forwarding efficiency. Although the IPv6 address size is four times the IPv4 address size, the basic IPv6 packet header size is only twice the size of the option-less IPv4 packet header. Figure 73 IPv4 packet header format and basic IPv6 packet header format Larger address space IPv6 can provide 3.4 x addresses to meet the requirements of hierarchical address assignment for both public and private networks. Hierarchical address structure IPv6 uses a hierarchical address structure to speed up route lookup and reduce the IPv6 routing table size through route aggregation. 194
208 Address autoconfiguration Built-in security QoS support To simplify host configuration, IPv6 supports stateful and stateless address autoconfiguration. Stateful address autoconfiguration enables a host to acquire an IPv6 address and other configuration information from a server (for example, a DHCPv6 server). For more information about DHCPv6 server, see "Configuring the DHCPv6 server." Stateless address autoconfiguration enables a host to automatically generate an IPv6 address and other configuration information by using its link-layer address and the prefix information advertised by a router. To communicate with other hosts on the same link, a host automatically generates a link-local address based on its link-layer address and the link-local address prefix (FE80::/10). IPv6 defines extension headers to support IPsec. IPsec provides end-to-end security and enhances interoperability among different IPv6 applications. The Flow Label field in the IPv6 header allows the device to label the packets of a specific flow for special handling. Enhanced neighbor discovery mechanism The IPv6 neighbor discovery protocol uses a group of ICMPv6 messages to manage information exchange among neighboring nodes on the same link. The group of ICMPv6 messages replaces ARP messages, ICMPv4 router discovery messages, and ICMPv4 redirect messages and provides a series of other functions. Flexible extension headers IPv6 eliminates the Options field in the header and introduces optional extension headers to provide scalability and improve efficiency. The Options field in the IPv4 packet header contains up to 40 bytes, whereas the IPv6 extension headers are restricted to the maximum size of IPv6 packets. IPv6 addresses IPv6 address formats An IPv6 address is represented as a set of 16-bit hexadecimals separated by colons (:). An IPv6 address is divided into eight groups, and each 16-bit group is represented by four hexadecimal numbers, for example, 2001:0000:130F:0000:0000:09C0:876A:130B. To simplify the representation of IPv6 addresses, you can handle zeros in IPv6 addresses by using the following methods: The leading zeros in each group can be removed. For example, the above address can be represented in a shorter format as 2001:0:130F:0:0:9C0:876A:130B. If an IPv6 address contains one or more consecutive groups of zeros, they can be replaced by a double colon (::). For example, the above address can be represented in the shortest format as 2001:0:130F::9C0:876A:130B. 195
209 IMPORTANT: A double colon can appear once or not at all in an IPv6 address. This limit allows the device to determine how many zeros the double colon represents and correctly convert it to zeros to restore a 128-bit IPv6 address. An IPv6 address consists of an address prefix and an interface ID, which are equivalent to the network ID and the host ID of an IPv4 address. An IPv6 address prefix is written in IPv6-address/prefix-length notation, where the prefix-length is a decimal number indicating how many leftmost bits of the IPv6 address includes the address prefix. IPv6 address types IPv6 addresses include the following types: Unicast address An identifier for a single interface, similar to an IPv4 unicast address. A packet sent to a unicast address is delivered to the interface identified by that address. Multicast address An identifier for a set of interfaces (typically belonging to different nodes), similar to an IPv4 multicast address. A packet sent to a multicast address is delivered to all interfaces identified by that address. There are no broadcast addresses in IPv6. Their function is replaced by multicast addresses. Anycast address An identifier for a set of interfaces (typically belonging to different nodes). A packet sent to an anycast address is delivered to the nearest interface among the interfaces identified by that address. The nearest interface is chosen according to the routing protocol' measure of distance. The type of an IPv6 address is designated by the first several bits, called the format prefix. Table 7 Mappings between address types and format prefixes Type Format prefix (binary) IPv6 prefix ID Unspecified address (128 bits) ::/128 Unicast address Loopback address (128 bits) ::1/128 Link-local address FE80::/10 Global unicast address Other forms N/A Multicast address FF00::/8 Anycast address Anycast addresses use the unicast address space and have the identical structure of unicast addresses. Unicast addresses Unicast addresses include global unicast addresses, link-local unicast addresses, the loopback address, and the unspecified address. Global unicast addresses Equivalent to public IPv4 addresses, global unicast addresses are provided for Internet service providers. This type of address allows for prefix aggregation to restrict the number of global routing entries. Link-local addresses Used for communication among link-local nodes for neighbor discovery and stateless autoconfiguration. Packets with link-local source or destination addresses are not forwarded to other links. 196
210 A loopback address 0:0:0:0:0:0:0:1 (or ::1). It has the same function as the loopback address in IPv4. It cannot be assigned to any physical interface. A node uses this address to send an IPv6 packet to itself. An unspecified address 0:0:0:0:0:0:0:0 (or ::). It cannot be assigned to any node. Before acquiring a valid IPv6 address, a node fills this address in the source address field of IPv6 packets. The unspecified address cannot be used as a destination IPv6 address. Multicast addresses IPv6 multicast addresses listed in Table 8 are reserved for special purposes. Table 8 Reserved IPv6 multicast addresses Address FF01::1 FF02::1 FF01::2 FF02::2 Application Node-local scope all-nodes multicast address. Link-local scope all-nodes multicast address. Node-local scope all-routers multicast address. Link-local scope all-routers multicast address. Multicast addresses also include solicited-node addresses. A node uses a solicited-node multicast address to acquire the link-layer address of a neighboring node on the same link and to detect duplicate addresses. Each IPv6 unicast or anycast address has a corresponding solicited-node address. The format of a solicited-node multicast address is FF02:0:0:0:0:1:FFXX:XXXX. FF02:0:0:0:0:1:FF is fixed and consists of 104 bits, and XX:XXXX is the last 24 bits of an IPv6 unicast address or anycast address. EUI-64 address-based interface identifiers An interface identifier is 64-bit long and uniquely identifies an interface on a link. Interfaces generate EUI-64 address-based interface identifiers differently. On an IEEE 802 interface (such as an Ethernet interface and a VLAN interface) The interface identifier is derived from the link-layer address (typically a MAC address) of the interface. The MAC address is 48-bit long. To obtain an EUI-64 address-based interface identifier, follow these steps: a. Insert the hexadecimal number FFFE (16 bits of ) behind the 24th high-order bit of the MAC address. b. Invert the universal/local (U/L) bit (the seventh high-order bit), ensuring that the interface identifier has the same local or global significance as the MAC address. Figure 74 Converting a MAC address into an EUI-64 address-based interface identifier 197
211 On a tunnel interface The lower 32 bits of the EUI-64 address-based interface identifier are the source IPv4 address of the tunnel interface. The higher 32 bits of the EUI-64 address-based interface identifier of an ISATAP tunnel interface are 0000:5EFE, whereas those of other tunnel interfaces are all zeros. For more information about tunnels, see "Configuring tunneling." On an interface of another type (such as a serial interface) The EUI-64 address-based interface identifier is generated randomly by the device. IPv6 ND protocol The IPv6 Neighbor Discovery (ND) protocol uses the following ICMPv6 messages: Table 9 ICMPv6 messages used by ND ICMPv6 message Type Function Acquires the link-layer address of a neighbor. Neighbor Solicitation (NS) 135 Verifies whether a neighbor is reachable. Neighbor Advertisement (NA) 136 Detects duplicate addresses. Responds to an NS message. Notifies the neighboring nodes of link layer changes. Router Solicitation (RS) 133 Router Advertisement (RA) 134 Redirect 137 Requests an address prefix and other configuration information for autoconfiguration after startup. Responds to an RS message. Advertises information, such as the Prefix Information options and flag bits. Informs the source host of a better next hop on the path to a particular destination when certain conditions are met. Address resolution This function is similar to ARP in IPv4. An IPv6 node acquires the link-layer addresses of neighboring nodes on the same link through NS and NA messages. Figure 75 shows how Host A acquires the link-layer address of Host B on the same link. Figure 75 Address resolution The address resolution procedure is as follows: 1. Host A multicasts an NS message. The source address of the NS message is the IPv6 address of the sending interface of Host A and the destination address is the solicited-node multicast address of 198
212 Host B. The NS message body contains the link-layer address of Host A and the target IPv6 address. 2. After receiving the NS message, Host B determines whether the target address of the packet is its IPv6 address. If it is, Host B learns the link-layer address of Host A, and then unicasts an NA message containing its link-layer address. 3. Host A acquires the link-layer address of Host B from the NA message. Neighbor reachability detection After Host A acquires the link-layer address of its neighbor Host B, Host A can use NS and NA messages to test reachability of Host B as follows: 1. Host A sends an NS message whose destination address is the IPv6 address of Host B. 2. If Host A receives an NA message from Host B, Host A decides that Host B is reachable. Otherwise, Host B is unreachable. Duplicate address detection After Host A acquires an IPv6 address, it performs Duplicate Address Detection (DAD) to check whether the address is being used by any other node (similar to gratuitous ARP in IPv4). DAD is accomplished through NS and NA messages. Figure 76 Duplicate address detection 1. Host A sends an NS message whose source address is the unspecified address and whose destination address is the corresponding solicited-node multicast address of the IPv6 address to be detected. The NS message body contains the detected IPv6 address. 2. If Host B uses this IPv6 address, Host B returns an NA message that contains its IPv6 address. 3. Host A knows that the IPv6 address is being used by Host B after receiving the NA message from Host B. If receiving no NA message, Host A decides that the IPv6 address is not in use and uses this address. Router/prefix discovery and stateless address autoconfiguration A node performs router/prefix discovery and stateless address autoconfiguration as follows: 1. At startup, a node sends an RS message to request configuration information from a router. 2. The router returns an RA message containing the Prefix Information option and other configuration information. (The router also periodically sends an RA message.) 3. The node automatically generates an IPv6 address and other configuration parameters according to the configuration information in the RA message. The Prefix Information option contains an address prefix and the preferred lifetime and valid lifetime of the address prefix. A node updates the preferred lifetime and valid lifetime upon receiving a periodic RA message. 199
213 Redirection The generated IPv6 address is valid within the valid lifetime and becomes invalid when the valid lifetime expires. After the preferred lifetime expires, the node cannot use the generated IPv6 address to establish new connections, but can receive packets destined for the IPv6 address. The preferred lifetime cannot be greater than the valid lifetime. Upon receiving a packet from a host, the gateway sends an ICMPv6 redirect message to inform a better next hop to the host when the following conditions are met (similar to the ICMP redirection function in IPv4): The interface receiving the packet is the same as the interface forwarding the packet. The selected route is not created or modified by an ICMPv6 redirect message. The selected route is not a default route on the device. The forwarded IPv6 packet does not contain the routing extension header. IPv6 path MTU discovery The links that a packet passes from a source to a destination can have different MTUs, among which the minimum MTU is the path MTU. If a packet exceeds path MTU, the source end fragments the packet to reduce the processing pressure on intermediate devices and to use network resources effectively. A source end uses path MTU discovery to find the path MTU to a destination, as shown in Figure 77. Figure 77 Path MTU discovery process 1. The source host sends a packet no larger than its MTU to the destination host. 2. If the MTU of a device's output interface is smaller than the packet, the device discards the packet and returns an ICMPv6 error message containing the interface MTU to the source host. 3. After receiving the ICMPv6 error message, the source host uses the returned MTU to limit the packet size, performs fragmentation, and sends the packets to the destination host. 4. Step 2 and step 3 are repeated until the destination host receives the packet. In this way, the source host finds the minimum MTU of all links in the path to the destination host. IPv6 transition technologies IPv6 transition technologies enable communication between IPv4 and IPv6 networks. Several IPv6 transition technologies can be used in different environments and periods, such as dual stack (RFC 2893), tunneling (RFC 2893), NAT-PT (RFC 2766), and IPv6 on the provider edge routers (6PE). 200
214 Dual stack Tunneling NAT-PT 6PE Dual stack is the most direct transition approach. A network node that supports both IPv4 and IPv6 is a dual-stack node. A dual-stack node configured with an IPv4 address and an IPv6 address can forward both IPv4 and IPv6 packets. An application that supports both IPv4 and IPv6 prefers IPv6 at the network layer. Dual stack is suitable for communication between IPv4 nodes or between IPv6 nodes. It is the basis of all transition technologies. However, it does not solve the IPv4 address depletion issue because each dual stack node must have a globally unique IPv4 address. Tunneling uses one network protocol to encapsulate the packets of another network protocol and transfers them over the network. For more information about tunneling, see "Configuring tunneling." Network Address Translation Protocol Translation (NAT-PT) enables communication between IPv4 and IPv6 nodes by translating between IPv4 and IPv6 packets. It performs IP address translation, and according to different protocols, performs semantic translation for packets. This technology is only suitable for communication between a pure IPv4 node and a pure IPv6 node. For more information about NAT-PT, see "Configuring NAT-PT." 6PE enables communication between isolated IPv6 networks over an IPv4 backbone network. 6PE adds labels to the IPv6 routing information about customer networks and advertises the information into the IPv4 backbone network over internal Border Gateway Protocol (IBGP) sessions. IPv6 packets are labeled and forwarded over tunnels on the backbone network. The tunnels can be GRE tunnels or MPLS LSPs. Figure 78 Network diagram 6PE is a highly efficient solution. When an ISP wants to utilize the existing IPv4/MPLS network to provide IPv6 traffic switching, it only needs to upgrade the PE routers. In addition, the operation risk of 6PE is very low. For more information about 6PE, see Layer 3 IP Routing Configuration Guide. Protocols and standards Protocols and standards related to IPv6 include: 201
215 RFC 1881, IPv6 Address Allocation Management RFC 1887, An Architecture for IPv6 Unicast Address Allocation RFC 1981, Path MTU Discovery for IP version 6 RFC 2375, IPv6 Multicast Address Assignments RFC 2460, Internet Protocol, Version 6 (IPv6) Specification RFC 2464, Transmission of IPv6 Packets over Ethernet Networks RFC 2526, Reserved IPv6 Subnet Anycast Addresses RFC 3307, Allocation Guidelines for IPv6 Multicast Addresses RFC 4191, Default Router Preferences and More-Specific Routes RFC 4291, IP Version 6 Addressing Architecture RFC 4443, Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification RFC 4861, Neighbor Discovery for IP Version 6 (IPv6) RFC 4862, IPv6 Stateless Address Autoconfiguration IPv6 basics configuration task list Tasks at a glance (Required.) Assigning IPv6 addresses to interfaces: Configuring an IPv6 global unicast address Configuring an IPv6 link-local address Configuring an IPv6 anycast address (Optional.) Configuring IPv6 ND: Configuring a static neighbor entry Setting the maximum number of dynamic neighbor entries Setting the aging timer for ND entries in stale state Minimizing link-local ND entries Setting the hop limit Configuring parameters for RA messages Configuring the maximum number of attempts to send an NS message for DAD Enabling ND proxy (Optional.) Configuring path MTU discovery: Configuring the interface MTU Configuring a static path MTU for an IPv6 address Configuring the aging time for dynamic path MTUs (Optional.) Controlling sending ICMPv6 messages: Configuring the rate limit for ICMPv6 error messages Enabling replying to multicast echo requests Enabling sending ICMPv6 destination unreachable messages Enabling sending ICMPv6 time exceeded messages Enabling sending ICMPv6 redirect messages Specifying the source address for ICMPv6 packets 202
216 Assigning IPv6 addresses to interfaces This section describes how to configure an IPv6 global unicast address, an IPv6 link-local address, and an IPv6 anycast address. Configuring an IPv6 global unicast address Use one of the following methods to configure an IPv6 global unicast address for an interface: EUI-64 IPv6 address The IPv6 address prefix of the interface is manually configured, and the interface identifier is generated automatically by the interface. Manual configuration The IPv6 global unicast address is manually configured. Stateless address autoconfiguration The IPv6 global unicast address is generated automatically based on the address prefix information contained in the RA message. You can configure multiple IPv6 global unicast addresses on an interface. Manually configured global unicast addresses (including EUI-64 IPv6 addresses) take precedence over automatically generated ones. If you manually configure a global unicast address with the same address prefix as an existing global unicast address on an interface, the manually configured one takes effect, but it does not overwrite the automatically generated address. If you remove the manually configured global unicast address, the device uses the automatically generated one. EUI-64 IPv6 address To configure an interface to generate an EUI-64 IPv6 address: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Configure the interface to generate an EUI-64 IPv6 address. interface interface-type interface-number ipv6 address { ipv6-address prefix-length ipv6-address/prefix-length } eui-64 N/A By default, no IPv6 global unicast address is configured on an interface. Manual configuration To configure an IPv6 global unicast address for an interface: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Configure an IPv6 global unicast address for the interface. interface interface-type interface-number ipv6 address { ipv6-address prefix-length ipv6-address/prefix-length } N/A By default, no IPv6 global unicast address is configured on an interface. Stateless address autoconfiguration To configure an interface to generate an IPv6 address through stateless address autoconfiguration: 203
217 Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Enable stateless address autoconfiguration. interface interface-type interface-number ipv6 address auto N/A By default, no IPv6 global unicast address is configured on an interface. Using the undo ipv6 address auto command on an interface removes all IPv6 global unicast addresses and link-local addresses that are automatically generated on the interface. After this configuration, the interface automatically generates an IPv6 global unicast address by using the address prefix in the received RA message and the interface ID. On an IEEE 802 interface (such as an Ethernet interface or a VLAN interface), the interface ID is generated based on the MAC address of the interface and is globally unique. An attacker can exploit this rule to identify the sending device easily. To fix the vulnerability, you can configure the temporary address function. With this function, an IEEE 802 interface generates the following addresses: Public IPv6 address Includes the address prefix in the RA message and a fixed interface ID generated based on the MAC address of the interface. Temporary IPv6 address Includes the address prefix in the RA message and a random interface ID generated through MD5. You can also configure the interface to preferentially use the temporary IPv6 address as the source address of sent packets. When the valid lifetime of the temporary IPv6 address expires, the interface removes the address and generates a new one. This function enables the system to send packets with different source addresses through the same interface. If the temporary IPv6 address cannot be used because of a DAD conflict, the public IPv6 address is used. The preferred lifetime and valid lifetime for a temporary IPv6 address are determined as follows: The preferred lifetime of a temporary IPv6 address takes the smaller of the following values: The preferred lifetime of the address prefix in the RA message. The preferred lifetime configured for temporary IPv6 addresses minus DESYNC_FACTOR (a random number ranging from 0 to 600 seconds). The valid lifetime of a temporary IPv6 address takes the smaller of the following values: The valid lifetime of the address prefix. The valid lifetime configured for temporary IPv6 addresses. To configure the temporary address function: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable the system to generate a temporary IPv6 address. ipv6 temporary-address [ valid-lifetime preferred-lifetime ] By default, the system does not generate any temporary IPv6 address. 204
218 Step Command Remarks 3. Enable the system to preferentially use the temporary IPv6 address as the source address of the packet. ipv6 prefer temporary-address By default, the system does not preferentially use the temporary IPv6 address as the source address of the packet. To generate a temporary address, an interface must be enabled with stateless address autoconfiguration. Temporary IPv6 addresses do not overwrite public IPv6 addresses, so an interface can have multiple IPv6 addresses with the same address prefix but different interface IDs. If an interface fails to generate a public IPv6 address because of a prefix conflict or other reasons, it does not generate any temporary IPv6 address. Configuring a static IPv6 prefix To configure a static IPv6 prefix: Step Command Remarks 1. Enter system view. system-view N/A 2. Configure a static IPv6 prefix. ipv6 prefix prefix-number ipv6-prefix/prefix-length By default, the device has no static IPv6 prefix. Configuring an IPv6 link-local address Configure IPv6 link-local addresses using one of the following methods: Automatic generation The device automatically generates a link-local address for an interface according to the link-local address prefix (FE80::/10) and the link-layer address of the interface. Manual assignment Manually configure an IPv6 link-local address for an interface. An interface can have only one link-local address. To avoid link-local address conflicts, use the automatic generation method. Manual assignment takes precedence over automatic generation. If you first use automatic generation and then manual assignment, the manually assigned link-local address overwrites the automatically generated one. If you first use manual assignment and then automatic generation, both of the following occur: The automatically generated link-local address does not take effect. The link-local address is still the manually assigned one. If you delete the manually assigned address, the automatically generated link-local address takes effect. Configuring automatic generation of an IPv6 link-local address for an interface Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. interface interface-type interface-number N/A 205
219 Step Command Remarks 3. Configure the interface to automatically generate an IPv6 link-local address. ipv6 address auto link-local By default, no link-local address is configured on an interface. After an IPv6 global unicast address is configured on the interface, a link-local address is generated automatically. Manually specifying an IPv6 link-local address for an interface Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Manually specify an IPv6 link-local address for the interface. interface interface-type interface-number ipv6 address ipv6-address link-local N/A By default, no link-local address is configured on an interface. After an IPv6 global unicast address is configured on the interface, a link-local address is generated automatically. After you configure an IPv6 global unicast address for an interface, the interface automatically generates a link-local address. The automatically generated link-local address is the same as the one generated by using the ipv6 address auto link-local command. If a link-local address is manually assigned to an interface, this manual link-local address takes effect. If the manually assigned link-local address is removed, the automatically generated link-local address takes effect. Using the undo ipv6 address auto link-local command on an interface only removes the link-local address generated by the ipv6 address auto link-local command. If the interface has an IPv6 global unicast address, it still has a link-local address. If the interface has no IPv6 global unicast address, it has no link-local address. Configuring an IPv6 anycast address Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Configure an IPv6 anycast address. interface interface-type interface-number ipv6 address { ipv6-address prefix-length ipv6-address/prefix-length } anycast N/A By default, no IPv6 anycast address is configured on an interface. Configuring IPv6 ND This section describes how to configure IPv6 ND. 206
220 Configuring a static neighbor entry The IPv6 address of a neighboring node can be resolved into a link-layer address dynamically through NS and NA messages or through a manually configured static neighbor entry. The device uniquely identifies a static neighbor entry by the IPv6 address and the local Layer 3 interface number of the neighbor. You can configure a static neighbor entry by using one of the following methods: Method 1 Associate a neighbor's IPv6 address and link-layer address with the local Layer 3 interface. If you use Method 1, the device automatically finds the Layer 2 port connected to the neighbor. Method 2 Associate a neighbor's IPv6 address and link-layer address with a local port in a VLAN. If you use Method 2, make sure the corresponding VLAN interface exists and the Layer 2 port specified by port-type port-number belongs to the VLAN specified by vlan-id. The device associates the VLAN interface with the neighbor IPv6 address to identify the static neighbor entry. To configure a static neighbor entry: Step Command Remarks 1. Enter system view. system-view N/A 2. Configure a static neighbor entry. ipv6 neighbor ipv6-address mac-address { vlan-id port-type port-number interface interface-type interface-number } [ vpn-instance vpn-instance-name ] By default, no static neighbor entry exists on the device. Setting the maximum number of dynamic neighbor entries The device can dynamically acquire the link-layer address of a neighboring node through NS and NA messages and add it into the neighbor table. When the number of dynamic neighbor entries reaches the threshold, the interface stops learning neighbor information. To prevent an interface from occupying too many neighbor table resources, you can set the maximum number of dynamic neighbors that an interface can learn. To set the maximum number of dynamic neighbor entries: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Set the maximum number of dynamic neighbor entries that the interface can learn. interface interface-type interface-number ipv6 neighbors max-learning-num number N/A The default setting for MSR1000/MSR2000 is The default setting for MSR3000/MSR4000 is
221 Setting the aging timer for ND entries in stale state ND entries in stale state have an aging timer. If an ND entry in stale state is not refreshed before the timer expires, the ND entry changes to the delay state. If it is still not refreshed in 5 seconds, the ND entry changes to the probe state, and the device sends an NS message three times. If no response is received, the device removes the ND entry. To set the aging timer for ND entries in stale state: Step Command Remarks 1. Enter system view. system-view N/A 2. Set the aging timer for ND entries in stale state. ipv6 neighbor stale-aging aging-time The default setting is 240 minutes. Minimizing link-local ND entries Perform this task to minimize link-local ND entries assigned to the driver. Link-local ND entries refer to ND entries comprising link-local addresses. By default, the device assigns all ND entries to the driver. With this feature enabled, the device does not add newly learned link-local ND entries whose link local addresses are not the next hop of any route into the driver to save driver resources. This feature affects only newly learned link-local ND entries rather than existing ND entries. To minimize link-local ND entries: Step Command Remarks 1. Enter system view. system-view N/A 2. Minimize link-local ND entries. ipv6 neighbor link-local minimize By default, the device assigns all ND entries to the driver. Setting the hop limit Perform this task to implement the following functions: Set the value of the Hop Limit field for IPv6 packets sent by the device. If you use the undo ipv6 nd ra hop-limit unspecified command, the device sets the hop limit value configured by this task in a sent RA message. A host receiving the RA message fills the value into the Hop Limit field of sent IPv6 packets. To set the hop limit: Step Command Remarks 1. Enter system view. system-view N/A 2. Set the Hop Limit field in the IP header. ipv6 hop-limit value The default setting is
222 Configuring parameters for RA messages You can enable an interface to send RA messages, and configure the interval for sending RA messages and parameters in RA messages. After receiving an RA message, a host can use these parameters to perform corresponding operations. Table 10 describes the configurable parameters in an RA message. Table 10 Parameters in an RA message and their descriptions Parameter Hop Limit Prefix information MTU M flag O flag Router Lifetime Retrans Timer Reachable Time Router Preference Description Maximum number of hops in RA messages. A host receiving the RA message fills the value in the Hop Limit field of sent IPv6 packets. After receiving the prefix information, the hosts on the same link can perform stateless autoconfiguration. Guarantees that all nodes on the link use the same MTU. Determines whether a host uses stateful autoconfiguration to obtain an IPv6 address. If the M flag is set to 1, the host uses stateful autoconfiguration (for example, from a DHCPv6 server) to obtain an IPv6 address. Otherwise, the host uses stateless autoconfiguration to generate an IPv6 address according to its link-layer address and the prefix information in the RA message. Determines whether a host uses stateful autoconfiguration to obtain configuration information other than IPv6 address. If the O flag is set to 1, the host uses stateful autoconfiguration (for example, from a DHCPv6 server) to obtain configuration information other than IPv6 address. Otherwise, the host uses stateless autoconfiguration. Tells the receiving hosts how long the advertising router can live. If the lifetime of a router is 0, the router cannot be used as the default gateway. If the device does not receive a response message within the specified time after sending an NS message, it retransmits the NS message. If the neighbor reachability detection shows that a neighbor is reachable, the device considers the neighbor reachable within the specified reachable time. If the device needs to send a packet to the neighbor after the specified reachable time expires, the device reconfirms whether the neighbor is reachable. Specifies the router preference in a RA message. A host selects a router as the default gateway according to the router preference. If router preferences are the same, the host selects the router from which the first RA message is received. The maximum interval for sending RA messages should be less than (or equal to) the router lifetime in RA messages so the router can be updated by an RA message before expiration. The values of the NS retransmission timer and the reachable time configured for an interface are sent in RA messages to hosts. This interface sends NS messages at the interval of the NS retransmission timer and considers a neighbor reachable within the reachable time. Enabling sending of RA messages Step Command Remarks 1. Enter system view. system-view N/A 209
223 Step Command Remarks 2. Enter interface view. 3. Enable sending of RA messages. 4. Configure the maximum and minimum intervals for sending RA messages. interface interface-type interface-number undo ipv6 nd ra halt ipv6 nd ra interval max-interval-value min-interval-value N/A The default setting is disabled. By default, the maximum interval for sending RA messages is 600 seconds, and the minimum interval is 200 seconds. The device sends RA messages at random intervals between the maximum interval and the minimum interval. The minimum interval should be less than or equal to 0.75 times the maximum interval. Configuring parameters for RA messages Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Configure the prefix information in RA messages. 4. Turn off the MTU option in RA messages. 5. Specify unlimited hops in RA messages. 6. Set the M flag bit to 1. interface interface-type interface-number ipv6 nd ra prefix { ipv6-prefix prefix-length ipv6-prefix/prefix-length } valid-lifetime preferred-lifetime [ no-autoconfig off-link ] * ipv6 nd ra no-advlinkmtu ipv6 nd ra hop-limit unspecified ipv6 nd autoconfig managed-address-flag N/A By default, no prefix information is configured for RA messages, and the IPv6 address of the interface sending RA messages is used as the prefix information. If the IPv6 address is manually configured, the prefix uses a fixed valid lifetime of seconds (30 days) and a preferred lifetime of seconds (7 days). If the IPv6 address is automatically obtained, the prefix uses the valid lifetime and preferred lifetime configured for the IPv6 address. By default, RA messages contain the MTU option. By default, the maximum number of hops in RA messages is 64. By default, the M flag bit is set to 0 and hosts acquire IPv6 addresses through stateless autoconfiguration. 7. Set the O flag bit to 1. ipv6 nd autoconfig other-flag By default, the O flag bit is set to 0 and hosts acquire other configuration information through stateless autoconfiguration. 8. Configure the router lifetime in RA messages. ipv6 nd ra router-lifetime value By default, the router lifetime is 1800 seconds. 210
224 Step Command Remarks 9. Set the NS retransmission timer. 10. Set the router preference in RA messages. 11. Set the reachable time. ipv6 nd ns retrans-timer value ipv6 nd router-preference { high low medium } ipv6 nd nud reachable-time value By default, an interface sends NS messages every 1000 milliseconds, and the value of the Retrans Timer field in RA messages is 0. By default, the router preference is medium. By default, the neighbor reachable time is milliseconds, and the value of the Reachable Time field in sent RA messages is 0. Configuring the maximum number of attempts to send an NS message for DAD An interface sends an NS message for DAD after obtaining an IPv6 address. If the interface does not receive a response within the time specified by the ipv6 nd ns retrans-timer command, it sends an NS message again. If the interface still does not receive a response after the number of attempts reaches the threshold specified by the ipv6 nd dad attempts command, it considers the address is usable. To configure the attempts to send an NS message for DAD: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Configure the number of attempts to send an NS message for DAD. interface interface-type interface-number ipv6 nd dad attempts value N/A The default setting is 1. When the value argument is set to 0, DAD is disabled. Enabling ND proxy About ND proxy ND proxy enables a device to answer an NS message requesting the hardware address of a host on another network. With ND proxy, hosts on different broadcast domains can communicate with each other as they would on the same network. ND proxy includes common ND proxy and local ND proxy. Common ND proxy As shown in Figure 79, GigabitEthernet 1/0/1 with IPv6 address 4:1::99/64 and GigabitEthernet 1/0/2 with IPv6 address 4:2::99/64 belong to different subnets. Host A and Host B reside on the same network but in different broadcast domains. 211
225 Figure 79 Application environment of ND proxy Because Host A's IPv6 address is on the same subnet as Host B's, Host A directly sends an NS message to obtain Host B's MAC address. However, Host B cannot receive the NS message because they belong to different broadcast domains. To solve this problem, enable common ND proxy on GigabitEthernet 1/0/1 and GigabitEthernet 1/0/2 of the router. The router replies to the NS message from Host A, and forwards packets from other hosts to Host B. Local ND proxy As shown in Figure 80, both Host A and Host B belong to VLAN 2. However, they connect to GigabitEthernet 1/0/3 and GigabitEthernet 1/0/1 respectively, which are isolated at Layer 2. Figure 80 Application environment of local ND proxy Router GE1/0/2 4:3::100/16 VLAN 2 Private VLAN Host A 4:1::100/16 GE1/0/3 Switch GE1/0/2 uplink-port GE1/0/1 Host B 4:2::100/16 Configuration procedure Because Host A's IPv6 address is on the same subnet as Host B's, Host A directly sends an NS message to obtain Host B's MAC address. However, Host B cannot receive the NS message because they are isolated at Layer 2. To solve this problem, enable local ND proxy on GigabitEthernet 1/0/2 of the router so that the router can forward messages between Host A and Host B. Local ND proxy implements Layer 3 communication for two hosts in the following cases: The two hosts must connect to different isolated Layer 2 ports of a VLAN. If super VLAN is used, the two hosts must belong to different sub VLANs. If Private VLAN is used, the two hosts must belong to different secondary VLANs. You can enable common ND proxy and local ND proxy in VLAN interface view, Layer 3 Ethernet interface view, or Layer 3 Ethernet subinterface view. To enable common ND proxy: 212
226 Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. interface interface-type interface-number N/A 3. Enable common ND proxy. proxy-nd enable By default, common ND proxy is disabled. To enable local ND proxy: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. interface interface-type interface-number N/A 3. Enable local ND proxy. local-proxy-nd enable By default, local ND proxy is disabled. Configuring path MTU discovery Configuring the interface MTU IPv6 routers do not support packet fragmentation. If the size of a packet exceeds the MTU of the output interface, the router discards the packet and sends a packet too big message to the source host. The source host fragments the packet according to the MTU. To avoid this situation, configure a proper interface MTU. To configure the interface MTU: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. interface interface-type interface-number N/A 3. Configure the interface MTU. ipv6 mtu mtu-size By default, no interface MTU is configured. Configuring a static path MTU for an IPv6 address You can configure a static path MTU for an IPv6 address. Before sending a packet to the IPv6 address, the device compares the MTU of the output interface with the static path MTU. If the packet exceeds the smaller one of the two values, the device fragments the packet according to the smaller value. After sending the fragmented packets, the device dynamically finds the path MTU to a destination host (see "IPv6 path MTU discovery"). To configure a static path MTU for a destination IPv6 address: 213
227 Step Command Remarks 1. Enter system view. system-view N/A 2. Configure a static path MTU for a destination IPv6 address. ipv6 pathmtu [ vpn-instance vpn-instance-name ] ipv6-address value No static path MTU is configured for any IPv6 address by default. Configuring the aging time for dynamic path MTUs After the device dynamically finds the path MTU to a destination host (see "IPv6 path MTU discovery"), it sends packets to the destination host based on the path MTU and starts an aging timer. When the aging timer expires, the device removes the dynamic path MTU and finds the path MTU again. The aging time is invalid for a static path MTU. To configure the aging time for dynamic path MTUs: Step Command Remarks 1. Enter system view. system-view N/A 2. Configure the aging time for dynamic path MTUs. ipv6 pathmtu age age-time The default setting is 10 minutes. Controlling sending ICMPv6 messages This section describes how to configure ICMPv6 message sending. Configuring the rate limit for ICMPv6 error messages To avoid sending excessive ICMPv6 error messages within a short period that might cause network congestion, you can limit the rate at which ICMPv6 error messages are sent. A token bucket algorithm is used with one token representing one ICMPv6 error message. Tokens are placed in the bucket at intervals until the maximum number of tokens that the bucket can hold is reached. Tokens are removed from the bucket when ICMPv6 error messages are sent. When the bucket is empty, ICMPv6 error messages are not sent until a new token is placed in the bucket. To configure the rate limit for ICMPv6 error messages: Step Command Remarks 1. Enter system view. system-view N/A 2. Set the interval and bucket size for ICMPv6 error messages. ipv6 icmpv6 error-interval milliseconds [ bucketsize ] By default, the bucket allows a maximum of 10 tokens, and tokens are placed in the bucket at the interval of 100 milliseconds. To disable the ICMPv6 rate limit, set the interval to 0 milliseconds. 214
228 Enabling replying to multicast echo requests The device does not respond to multicast echo requests by default. In some scenarios, however, you must enable the device to answer multicast echo requests so the source host can obtain needed information. To enable the device to answer multicast echo requests: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable replying to multicast echo requests. ipv6 icmpv6 multicast-echo-reply enable By default, this function is not enabled. Enabling sending ICMPv6 destination unreachable messages The device sends ICMPv6 destination unreachable messages as follows: If a packet does not match any route, the device sends an ICMPv6 no route to destination message to the source. If the device fails to forward the packet because of administrative prohibition (such as a firewall filter or an ACL), the device sends the source an ICMPv6 communication with destination administratively prohibited message. If the device fails to deliver the packet because the destination is beyond the scope of the source IPv6 address (for example, the source IPv6 address is a link-local address whereas the destination IPv6 address is a global unicast address), the device sends the source an ICMPv6 beyond scope of source address message. If the device fails to resolve the link layer address for the destination IPv6 address, the device sends the source an ICMPv6 address unreachable message. If a UDP packet received is destined for the device but its UDP destination port number does not match any process, the device sends the source an ICMPv6 port unreachable message. If a device is generating ICMPv6 destination unreachable messages incorrectly, disable the sending of ICMPv6 destination unreachable messages to prevent attack risks. To enable sending ICMPv6 destination unreachable messages: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable sending ICMPv6 destination unreachable messages. ipv6 unreachables enable By default, this function is disabled. Enabling sending ICMPv6 time exceeded messages The device sends ICMPv6 time exceeded messages as follows: If a received packet is not destined for the device and its hop limit is 1, the device sends an ICMPv6 hop limit exceeded in transit message to the source. 215
229 Upon receiving the first fragment of an IPv6 datagram destined for the device, the device starts a timer. If the timer expires before all the fragments arrive, the device sends an ICMPv6 fragment reassembly time exceeded message to the source. If the device receives large numbers of malicious packets, its performance degrades greatly because it must send back ICMP time exceeded messages. To prevent such attacks, disable sending ICMPv6 time exceeded messages. To enable sending ICMPv6 time exceeded messages: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable sending ICMPv6 time exceeded messages. ipv6 hoplimit-expires enable The default setting is disabled. Enabling sending ICMPv6 redirect messages Upon receiving a packet from a host, the device sends an ICMPv6 redirect message to inform a better next hop to the host when the following conditions are met: The interface receiving the packet is the interface forwarding the packet. The selected route is not created or modified by any ICMPv6 redirect messages. The selected route is not a default route. The forwarded packet does not contain the routing extension header. The ICMPv6 redirect function simplifies host management by enabling hosts that hold few routes to optimize their routing table gradually. However, to avoid adding too many routes on hosts, this function is disabled by default. To enable sending ICMPv6 redirect messages: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable sending ICMPv6 redirect messages. ipv6 redirects enable By default, sending ICMPv6 redirect messages is disabled. Specifying the source address for ICMPv6 packets Perform this task to specify the source IPv6 address for outgoing ping echo request and ICMPv6 error messages. It is a good practice to specify the IPv6 address of the loopback interface as the source IPv6 address. This feature helps users to locate the sending device easily. If you specify an IPv6 address in the ping command, ping echo requests use the specified address as the source IPv6 address rather than the IPv6 address specified by the ipv6 icmpv6 source command. To specify the source IPv6 address for ICMPv6 packets: Step Command Remarks 1. Enter system view. system-view N/A 216
230 Step Command Remarks 2. Specify an IPv6 address as the source address for outgoing ICMPv6 packets. ipv6 icmpv6 source [ vpn-instance vpn-instance-name ] ipv6-address By default, the device uses the IPv6 address of the sending interface as the source IPv6 address for outgoing ICMPv6 packets. Displaying and maintaining IPv6 basics Execute display commands in any view and reset commands in user view. Task Display IPv6 FIB entries. Display IPv6 information about the interface. Display IPv6 prefix information about the interface. Display neighbor information (MSR1000/MSR2000/MSR3000). Display neighbor information (MSR4000). Display the total number of neighbor entries (MSR1000/MSR2000/MSR3000). Display the total number of neighbor entries (MSR4000). Command display ipv6 fib [ vpn-instance vpn-instance-name ] [ ipv6-address [ prefix-length ] ] display ipv6 interface [ interface-type [ interface-number ] ] [ brief ] display ipv6 interface interface-type interface-number prefix display ipv6 neighbors { ipv6-address all dynamic interface interface-type interface-number static vlan vlan-id } [ verbose ] display ipv6 neighbors { { ipv6-address all dynamic static } [ slot slot-number ] interface interface-type interface-number vlan vlan-id } [ verbose ] display ipv6 neighbors { all dynamic interface interface-type interface-number static vlan vlan-id } count display ipv6 neighbors { { all dynamic static } [ slot slot-number ] interface interface-type interface-number vlan vlan-id } count Display neighbor information for a VPN. display ipv6 neighbors vpn-instance vpn-instance-name [ count ] Display the IPv6 path MTU information. display ipv6 pathmtu [ vpn-instance vpn-instance-name ] { ipv6-address { all dynamic static } [ count ] } Display the IPv6 prefix information. display ipv6 prefix [ prefix-number ] Display IPv6 and ICMPv6 packet statistics (MSR1000/MSR2000/MSR3000). Display IPv6 and ICMPv6 packet statistics (MSR4000). Display brief information about IPv6 RawIP connections (MSR1000/MSR2000/MSR3000). Display brief information about IPv6 RawIP connections (MSR4000). display ipv6 statistics display ipv6 statistics [ slot slot-number ] display ipv6 rawip display ipv6 rawip [ slot slot-number ] 217
231 Task Display detailed information about IPv6 RawIP connections (MSR1000/MSR2000/MSR3000). Display detailed information about IPv6 RawIP connections (MSR4000). Display brief information about IPv6 TCP connections (MSR1000/MSR2000/MSR3000). Display brief information about IPv6 TCP connections (MSR4000). Display detailed information about IPv6 TCP connections (MSR1000/MSR2000/MSR3000). Display detailed information about IPv6 TCP connections (MSR4000). Display brief information about IPv6 UDP connections (MSR1000/MSR2000/MSR3000). Display brief information about IPv6 UDP connections (MSR4000). Display detailed information about IPv6 UDP connections (MSR1000/MSR2000/MSR3000). Display detailed information about IPv6 UDP connections (MSR4000). Display ICMPv6 traffic statistics (MSR1000/MSR2000/MSR3000). Display ICMPv6 traffic statistics (MSR4000). Display IPv6 TCP traffic statistics (MSR1000/MSR2000/MSR3000). Display IPv6 TCP traffic statistics (MSR4000). Display IPv6 UDP traffic statistics (MSR1000/MSR2000/MSR3000). Display IPv6 UDP traffic statistics (MSR4000). Clear IPv6 neighbor information (MSR1000/MSR2000/MSR3000). Clear IPv6 neighbor information (MSR4000). Command display ipv6 rawip verbose [ pcb pcb-index ] display ipv6 rawip verbose [ slot slot-number [ pcb pcb-index ] ] display ipv6 tcp display ipv6 tcp [ slot slot-number ] display ipv6 tcp verbose [ pcb pcb-index ] display ipv6 tcp verbose [ slot slot-number [ pcb pcb-index ] ] display ipv6 udp display ipv6 udp [ slot slot-number ] display ipv6 udp verbose [ pcb pcb-index ] display ipv6 udp verbose [ slot slot-number [ pcb pcb-index ] ] display ipv6 icmp statistics display ipv6 icmp statistics [ slot slot-number ] display tcp statistics display tcp statistics [ slot slot-number ] display udp statistics display udp statistics [ slot slot-number ] reset ipv6 neighbors { all dynamic interface interface-type interface-number static } reset ipv6 neighbors { all dynamic interface interface-type interface-number slot slot-number static } Clear path MTUs. reset ipv6 pathmtu { all dynamic static } Clear IPv6 and ICMPv6 packet statistics (MSR1000/MSR2000/MSR3000). reset ipv6 statistics 218
232 Task Clear IPv6 and ICMPv6 packet statistics (MSR4000). Clear IPv6 TCP traffic statistics. Clear IPv6 UDP traffic statistics. Command reset ipv6 statistics [ slot slot-number ] reset tcp statistics reset udp statistics IPv6 basics configuration example Network requirements As shown in Figure 81, configure IPv6 addresses for the routers and verify that they can reach each other. Configure a route to the host on Router B. Enable IPv6 for the host to automatically obtain an IPv6 address through IPv6 ND. The host has a route to Router B. Figure 81 Network diagram Configuration procedure 1. Configure Router A: # Configure a global unicast address for interface GigabitEthernet 2/1/1. <RouterA> system-view [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ipv6 address 3001::1/64 [RouterA-GigabitEthernet2/1/1] quit # Configure a global unicast address for interface GigabitEthernet 2/1/2 and enable it to advertise RA messages (an interface does not advertises RA messages by default). [RouterA] interface gigabitethernet 2/1/2 [RouterA-GigabitEthernet2/1/2] ipv6 address 2001::1/64 [RouterA-GigabitEthernet2/1/2] undo ipv6 nd ra halt [RouterA-GigabitEthernet2/1/2] quit 2. Configure Router B: # Configure a global unicast address for interface GigabitEthernet 2/1/1. <RouterB> system-view [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] ipv6 address 3001::2/64 [RouterB-GigabitEthernet2/1/1] quit # Configure an IPv6 static route to the host. [RouterB] ipv6 route-static 2001:: ::1 3. Configure the host: Enable IPv6 on the host to automatically obtain an IPv6 address through IPv6 ND. 219
233 # Display neighbor information for GigabitEthernet 2/1/2 on Router A. [RouterA] display ipv6 neighbors interface gigabitethernet 2/1/2 Type: S-Static D-Dynamic O-Openflow I-Invalid IPv6 Address Link Layer VID Interface State T Age FE80::215:E9FF:FEA6:7D e9a6-7d14 N/A GE2/1/2 STALE D ::15B:E0EA:3524:E e9a6-7d14 N/A GE2/1/2 STALE D 1248 The output shows that the IPv6 global unicast address that the host obtained is 2001::15B:E0EA:3524:E791. Verifying the configuration # Display IPv6 interface information on Router A. [RouterA] display ipv6 interface gigabitethernet 2/1/1 GigabitEthernet2/1/1 current state: UP Line protocol current state: UP IPv6 is enabled, link-local address is FE80::20F:E2FF:FE00:2 Global unicast address(es): 3001::1, subnet is 3001::/64 Joined group address(es): FF02::1 FF02::2 FF02::1:FF00:1 FF02::1:FF00:2 MTU is 1500 bytes ND DAD is enabled, number of DAD attempts: 1 ND reachable time is milliseconds ND retransmit interval is 1000 milliseconds Hosts use stateless autoconfig for addresses IPv6 Packet statistics: InReceives: InTooShorts: 0 InTruncatedPkts: 0 InHopLimitExceeds: 0 InBadHeaders: 0 InBadOptions: 0 ReasmReqds: 0 ReasmOKs: 0 InFragDrops: 0 InFragTimeouts: 0 OutFragFails: 0 InUnknownProtos: 0 InDelivers: 47 OutRequests: 89 OutForwDatagrams: 48 InNoRoutes: 0 InTooBigErrors: 0 OutFragOKs: 0 OutFragCreates: 0 220
234 InMcastPkts: 6 InMcastNotMembers: OutMcastPkts: 48 InAddrErrors: 0 InDiscards: 0 OutDiscards: 0 [RouterA] display ipv6 interface gigabitethernet 2/1/2 GigabitEthernet2/1/2 current state: UP Line protocol current state: UP IPv6 is enabled, link-local address is FE80::20F:E2FF:FE00:1C0 Global unicast address(es): 2001::1, subnet is 2001::/64 Joined group address(es): FF02::1 FF02::2 FF02::1:FF00:1 FF02::1:FF00:1C0 MTU is 1500 bytes ND DAD is enabled, number of DAD attempts: 1 ND reachable time is milliseconds ND retransmit interval is 1000 milliseconds ND advertised reachable time is 0 milliseconds ND advertised retransmit interval is 0 milliseconds ND router advertisements are sent every 600 seconds ND router advertisements live for 1800 seconds Hosts use stateless autoconfig for addresses IPv6 Packet statistics: InReceives: 272 InTooShorts: 0 InTruncatedPkts: 0 InHopLimitExceeds: 0 InBadHeaders: 0 InBadOptions: 0 ReasmReqds: 0 ReasmOKs: 0 InFragDrops: 0 InFragTimeouts: 0 OutFragFails: 0 InUnknownProtos: 0 InDelivers: 159 OutRequests: 1012 OutForwDatagrams: 35 InNoRoutes: 0 InTooBigErrors: 0 OutFragOKs: 0 OutFragCreates: 0 InMcastPkts: 79 InMcastNotMembers:
235 OutMcastPkts: 938 InAddrErrors: 0 InDiscards: 0 OutDiscards: 0 # Display IPv6 interface information on Router B. [RouterB] display ipv6 interface gigabitethernet 2/1/1 GigabitEthernet2/1/1 current state: UP Line protocol current state: UP IPv6 is enabled, link-local address is FE80::20F:E2FF:FE00:1234 Global unicast address(es): 3001::2, subnet is 3001::/64 Joined group address(es): FF02::1 FF02::2 FF02::1:FF00:1 FF02::1:FF00:1234 MTU is 1500 bytes ND DAD is enabled, number of DAD attempts: 1 ND reachable time is milliseconds ND retransmit interval is 1000 milliseconds Hosts use stateless autoconfig for addresses IPv6 Packet statistics: InReceives: 117 InTooShorts: 0 InTruncatedPkts: 0 InHopLimitExceeds: 0 InBadHeaders: 0 InBadOptions: 0 ReasmReqds: 0 ReasmOKs: 0 InFragDrops: 0 InFragTimeouts: 0 OutFragFails: 0 InUnknownProtos: 0 InDelivers: 117 OutRequests: 83 OutForwDatagrams: 0 InNoRoutes: 0 InTooBigErrors: 0 OutFragOKs: 0 OutFragCreates: 0 InMcastPkts: 28 InMcastNotMembers: 0 OutMcastPkts: 7 InAddrErrors: 0 InDiscards: 0 OutDiscards: 0 222
236 # Ping Router A and Router B from the host, and ping Router A and the host from Router B to verify that they can reach each other. NOTE: To ping a link-local address, use the i parameter to specify an interface for the link-local address. [RouterB] ping ipv6 -c ::1 Ping6(56 data bytes) 3001::2 --> 3001::1, press CTRL_C to break 56 bytes from 3001::1, icmp_seq=0 hlim=64 time=4.404 ms --- Ping6 statistics for 3001:: packet(s) transmitted, 1 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 4.404/4.404/4.404/0.000 ms [RouterB] ping ipv6 -c ::15B:E0EA:3524:E791 Ping6(56 data bytes) 3001::2 --> 2001::15B:E0EA:3524:E791, press CTRL_C to break 56 bytes from 2001::15B:E0EA:3524:E791, icmp_seq=0 hlim=64 time=5.404 ms --- Ping6 statistics for 2001::15B:E0EA:3524:E packet(s) transmitted, 1 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 5.404/5.404/5.404/0.000 ms The output shows that Router B can ping Router A and the host. The host can also ping Router B and Router A (output not shown). Troubleshooting IPv6 basics configuration Symptom Solution An IPv6 address cannot be pinged. 1. Use the display ipv6 interface command in any view to verify that the IPv6 address of the output interface is correct and the interface is up. 2. Use the debugging ipv6 packet command in user view to enable the debugging for IPv6 packets to locate the fault. 223
237 DHCPv6 overview DHCPv6 provides a framework to assign IPv6 prefixes, IPv6 addresses, and other configuration parameters to hosts. DHCPv6 address/prefix assignment An address/prefix assignment process involves two or four messages. Rapid assignment involving two messages As shown in Figure 82, rapid assignment operates in the following steps: 1. The DHCPv6 client sends to the DHCPv6 server a Solicit message that contains a Rapid Commit option to prefer rapid assignment. 2. If the DHCPv6 server supports rapid assignment, it responds with a Reply message containing the assigned IPv6 address/prefix and other configuration parameters. If the DHCPv6 server does not support rapid assignment, Assignment involving four messages is performed. Figure 82 Rapid assignment involving two messages Assignment involving four messages As shown in Figure 83, four-message assignment operates using the following steps: 1. The DHCPv6 client sends a Solicit message to request an IPv6 address/prefix and other configuration parameters. 2. The DHCPv6 server responds with an Advertise message that contains the assignable address/prefix and other configuration parameters if either of the following conditions exists: The Solicit message does not contain a Rapid Commit option. The DHCPv6 server does not support rapid assignment even though the Solicit message contains a Rapid Commit option. 3. The DHCPv6 client might receive multiple Advertise messages offered by different DHCPv6 servers. It selects an offer according to the receiving sequence and server priority, and sends a Request message to the selected server for confirmation. 4. The DHCPv6 server sends a Reply message to the client, confirming that the address/prefix and other configuration parameters are assigned to the client. 224
238 Figure 83 Assignment involving four messages Address/prefix lease renewal An IPv6 address/prefix assigned by a DHCPv6 server has a valid lifetime. After the valid lifetime expires, the DHCPv6 client cannot use the IPv6 address/prefix. To use the IPv6 address/prefix, the DHCPv6 client must renew the lease time. Figure 84 Using the Renew message for address/prefix lease renewal As shown in Figure 84, at T1, the DHCPv6 client sends a Renew message to the DHCPv6 server. The recommended value of T1 is half the preferred lifetime. The DHCPv6 server responds with a Reply message, informing the client about whether or not the lease is renewed. Figure 85 Using the Rebind message for address/prefix lease renewal As shown in Figure 85: If the DHCPv6 client does not receive a response from the DHCPv6 server after sending a Renew message at T1, it multicasts a Rebind message to all DHCPv6 servers at T2. Typically, the value of T2 is 0.8 times the preferred lifetime. The DHCPv6 server responds with a Reply message, informing the client about whether or not the lease is renewed. If the DHCPv6 client does not receive a response from any DHCPv6 server before the valid lifetime expires, the client stops using the address/prefix. 225
239 For more information about the valid lifetime and the preferred lifetime, see "Configuring basic IPv6 settings." Stateless DHCPv6 Stateless DHCPv6 enables a device that has obtained an IPv6 address/prefix to get other configuration parameters from a DHCPv6 server. The device performs stateless DHCPv6 if an RA message with the following flags is received from the router during stateless address autoconfiguration: The managed address configuration flag (M flag) is set to 0. The other stateful configuration flag (O flag) is set to 1. For more information about stateless address autoconfiguration, see "Configuring IPv6 basics." Figure 86 Stateless DHCPv6 operation As shown in Figure 86, stateless DHCPv6 operates in the following steps: 1. The DHCPv6 client sends an Information-request message to the multicast address of all DHCPv6 servers and DHCPv6 relay agents. The Information-request message contains an Option Request option that specifies the requested configuration parameters. 2. The DHCPv6 server returns to the client a Reply message containing the requested configuration parameters. 3. The client checks the Reply message. If the obtained configuration parameters match those requested in the Information-request message, the client uses these parameters to complete configuration. If not, the client ignores the configuration parameters. If the client receives multiple replies with configuration parameters matching those requested in the Information-request message, it uses the first received reply. Protocols and standards RFC 3736, Stateless Dynamic Host Configuration Protocol (DHCP) Service for IPv6 RFC 3315, Dynamic Host Configuration Protocol for IPv6 (DHCPv6) RFC 2462, IPv6 Stateless Address Autoconfiguration RFC 3633, IPv6 Prefix Options for Dynamic Host Configuration Protocol (DHCP) version 6 226
240 Configuring the DHCPv6 server Overview A DHCPv6 server can assign IPv6 addresses, IPv6 prefixes, and other configuration parameters to DHCPv6 clients. IPv6 address assignment As shown in Figure 87, the DHCPv6 server assigns IPv6 addresses, domain name suffixes, DNS server addresses, and other configuration parameters to DHCPv6 clients. The IPv6 addresses assigned to the clients include the following types: Temporary IPv6 addresses Frequently changed without lease renewal. Non-temporary IPv6 addresses Correctly used by DHCP clients, with lease renewal. Figure 87 IPv6 address assignment DHCPv6 client DHCPv6 client DHCPv6 server DHCPv6 client DHCPv6 client IPv6 prefix assignment As shown in Figure 88, the DHCPv6 server assigns an IPv6 prefix to the DHCPv6 client. The client advertises the prefix information in a multicast RA message so that hosts on the subnet can automatically configure their IPv6 addresses by using the prefix. 227
241 Figure 88 IPv6 prefix assignment Concepts Multicast addresses used by DHCPv6 DUID DHCPv6 uses the multicast address FF05::1:3 to identify all site-local DHCPv6 servers. It uses the multicast address FF02::1:2 to identify all link-local DHCPv6 servers and relay agents. A DHCP unique identifier (DUID) uniquely identifies a DHCPv6 device (DHCPv6 client, server, or relay agent). A DHCPv6 device adds its DUID in a sent packet. Figure 89 DUID-LL format IA IAID The device supports the DUID format based on link-layer address (DUID-LL) defined in RFC Figure 89 shows the DUID-LL format, where: DUID type The device supports the DUID type of DUID-LL with the value of 0x0003. Hardware type The device supports the hardware type of Ethernet with the value of 0x0001. Link layer address Takes the value of the bridge MAC address of the device. Identified by an IAID, an identity association (IA) provides a construct through which a client manages the obtained addresses, prefixes, and other configuration parameters. A client can have multiple IAs, for example, one for each of its interfaces. An IAID uniquely identifies an IA. It is chosen by the client and must be unique on the client. 228
242 PD The DHCPv6 server creates a prefix delegation (PD) for each assigned prefix to record the following details: IPv6 prefix. Client DUID. IAID. Valid lifetime. Preferred lifetime. Lease expiration time. IPv6 address of the requesting client. DHCPv6 address pool The DHCP server selects IPv6 addresses, IPv6 prefixes, and other parameters from an address pool, and assigns them to the DHCP clients. Address allocation mechanisms DHCPv6 supports the following address allocation mechanisms: Static address allocation To implement static address allocation for a client, create a DHCPv6 address pool, and manually bind the DUID and IAID of the client to an IPv6 address in the DHCPv6 address pool. When the client requests an IPv6 address, the DHCPv6 server assigns the IPv6 address in the static binding to the client. Dynamic address allocation To implement dynamic address allocation for clients, create a DHCPv6 address pool, specify a subnet for the pool, and divide the subnet into temporary and non-temporary IPv6 address ranges. Upon receiving a DHCP request, the DHCPv6 server selects an IPv6 address from the temporary or non-temporary IPv6 address range based on the address type in the client request. Prefix allocation mechanisms DHCPv6 supports the following prefix allocation mechanisms: Static prefix allocation To implement static prefix allocation for a client, create a DHCPv6 address pool, and manually bind the DUID and IAID of the client to an IPv6 prefix in the DHCPv6 address pool. When the client requests an IPv6 prefix, the DHCPv6 server assigns the IPv6 prefix in the static binding to the client. Dynamic prefix allocation To implement dynamic prefix allocation for clients, create a DHCPv6 address pool and a prefix pool, specify a subnet for the address pool, and apply the prefix pool to the address pool. Upon receiving a DHCP request, the DHCPv6 server dynamically selects an IPv6 prefix from the prefix pool in the address pool. Address pool selection The DHCPv6 server observes the following principles when selecting an IPv6 address or prefix for a client: 1. If there is an address pool where an IPv6 address is statically bound to the DUID or IAID of the client, the DHCPv6 server selects this address pool. It assigns the statically bound IPv6 address or prefix and other configuration parameters to the client. 229
243 2. If the receiving interface has an address pool applied, the DHCP server selects an IPv6 address or prefix and other configuration parameters from this address pool. 3. If no static address pool is configured and no address pool is applied to the receiving interface, the DHCPv6 server selects an address pool depending on the client location. Client on the same subnet as the server The DHCPv6 server compares the IPv6 address of the receiving interface with the subnets of all address pools. It selects the address pool with the longest-matching subnet. Client on a different subnet from the server The DHCPv6 server compares the IPv6 address of the DHCPv6 relay agent interface closest to the client with the subnets of all address pools. It also selects the address pool with the longest-matching subnet. To make sure IPv6 address allocation functions correctly, keep the subnet used for dynamic assignment consistent with the subnet where the interface of the DHCPv6 server or DHCPv6 relay agent resides. IPv6 address/prefix allocation sequence The DHCPv6 server selects an IPv6 address/prefix for a client in the following sequence: 1. IPv6 address/prefix statically bound to the client's DUID and IAID and expected by the client. 2. IPv6 address/prefix statically bound to the client's DUID and IAID. 3. IPv6 address/prefix statically bound to the client's DUID and expected by the client. 4. IPv6 address/prefix statically bound to the client's DUID. 5. IPv6 address/prefix that was ever assigned to the client. 6. Assignable IPv6 address/prefix in the address pool/prefix pool expected by the client. 7. Assignable IPv6 address/prefix in the address pool/prefix pool. 8. IPv6 address/prefix that was a conflict or passed its lease duration. If no IPv6 address/prefix is assignable, the server does not respond. If a client moves to another subnet, the DHCPv6 server selects an IPv6 address/prefix from the address pool that matches the new subnet. Conflicted IPv6 addresses can be assigned to other DHCPv6 clients only after the addresses are in conflict for one hour. Configuration task list Tasks at a glance (Optional.) Perform the following tasks: Configuring IPv6 prefix assignment Configuring IPv6 address assignment Configuring network parameters assignment (Required.) Configuring the DHCPv6 server on an interface (Optional.) Setting the DSCP value for DHCPv6 packets sent by the DHCPv6 server 230
244 Configuring IPv6 prefix assignment Use the following methods to configure IPv6 prefix assignment: Configure a static IPv6 prefix binding in an address pool If you bind a DUID and an IAID to an IPv6 prefix, the DUID and IAID in a request must match those in the binding before the DHCPv6 server can assign the IPv6 prefix to the DHCPv6 client. If you only bind a DUID to an IPv6 prefix, the DUID in the request must match the DUID in the binding before the DHCPv6 server can assign the IPv6 prefix to the DHCPv6 client. Apply a prefix pool to an address pool The DHCPv6 server dynamically assigns an IPv6 prefix from the prefix pool in the address pool to a DHCPv6 client. Configuration guidelines An IPv6 prefix can be bound to only one DHCPv6 client. You cannot modify bindings that have been created. To change the binding for a DHCPv6 client, you must delete the existing binding first. Only one prefix pool can be applied to an address pool. You cannot modify prefix pools that have been applied. To change the prefix pool for an address pool, you must remove the prefix pool application first. You can apply a prefix pool that has not been created to an address pool. The setting takes effect after the prefix pool is created. Configuration procedure To configure IPv6 prefix assignment: Step Command Remarks 1. Enter system view. system-view N/A 2. (Optional.) Specify the IPv6 prefixes excluded from dynamic assignment. 3. Create a prefix pool. 4. Create a DHCPv6 address pool and enter its view. 5. Specify an IPv6 subnet for dynamic assignment. ipv6 dhcp server forbidden-prefix start-prefix/prefix-len [ end-prefix/prefix-len ] ipv6 dhcp prefix-pool prefix-pool-number prefix prefix/prefix-len assign-len assign-len ipv6 dhcp pool pool-name network prefix/prefix-length [ preferred-lifetime preferred-lifetime valid-lifetime valid-lifetime ] By default, no IPv6 prefixes in the prefix pool are excluded from dynamic assignment. If the excluded IPv6 prefix is in a static binding, the prefix still can be assigned to the client. To exclude multiple IPv6 prefix ranges, repeat this step. This step is required for dynamic prefix assignment. By default, no prefix pool is configured. By default, no DHCPv6 address pool is configured. By default, no IPv6 subnet is specified for dynamic assignment. 231
245 Step Command Remarks 6. Configure static or dynamic prefix assignment. Configure a static prefix binding: static-bind prefix prefix/prefix-len duid duid [ iaid iaid ] [ preferred-lifetime preferred-lifetime valid-lifetime valid-lifetime ] Apply the prefix pool to the address pool: prefix-pool prefix-pool-number [ preferred-lifetime preferred-lifetime valid-lifetime valid-lifetime ] Use at least one command. By default, no static or dynamic prefix assignment is configured for an address pool. To add multiple static IPv6 prefix bindings, use the static-bind prefix command. Configuring IPv6 address assignment Use one of the following methods to configure IPv6 address assignment: Configure a static IPv6 address binding in an address pool: If you bind a DUID and an IAID to an IPv6 address, the DUID and IAID in a request must match those in the binding before the DHCPv6 server can assign the IPv6 address to the requesting client. If you only bind a DUID to an IPv6 address, the DUID in a request must match the DUID in the binding before the DHCPv6 server can assign the IPv6 address to the requesting client. Specify a subnet and address ranges in an address pool: Non-temporary address assignment The server selects addresses from the non-temporary address range specified by the address range command. If no non-temporary address range is specified, the server selects addresses on the subnet specified by the network command. Temporary address assignment The server selects addresses from the temporary address range specified by the temporary address range command. If no temporary address range is specified in the address pool, the DHCPv6 server cannot assign temporary addresses to clients. Configuration guidelines You can specify only one non-temporary address range and one temporary address range in an address pool. The address ranges specified by the address range and temporary address range commands must be on the subnet specified by the network command. Otherwise, the addresses are unassignable. Only one prefix pool can be applied to an address pool. You can apply a prefix pool that has not been created to an address pool. The setting takes effect after the prefix pool is created. An IPv6 address can be bound to only one DHCPv6 client. You cannot modify bindings that have been created. To change the binding for a DHCPv6 client, you must delete the existing binding first. Only one subnet can be specified in an address pool. If you use the network command multiple times in a DHCPv6 address pool, the most recent configuration takes effect. If you use this command to specify only new lifetimes, the settings do not affect existing leases. The IPv6 addresses assigned after the modification will take the new lifetimes. Configuration procedure To configure IPv6 address assignment: 232
246 Step Command Remarks 1. Enter system view. system-view N/A 2. (Optional.) Specify the IPv6 addresses excluded from dynamic assignment. 3. Create a DHCPv6 address pool and enter its view. 4. Specify an IPv6 subnet for dynamic assignment. 5. (Optional.) Specify a non-temporary IPv6 address range. 6. (Optional.) Specify a temporary IPv6 address range. 7. (Optional.) Create a static binding. ipv6 dhcp server forbidden-address start-ipv6-address [ end-ipv6-address ] ipv6 dhcp pool pool-name network prefix/prefix-length [ preferred-lifetime preferred-lifetime valid-lifetime valid-lifetime ] address range start-ipv6-address end-ipv6-address [ preferred-lifetime preferred-lifetime valid-lifetime valid-lifetime ] temporary address range start-ipv6-address end-ipv6-address [ preferred-lifetime preferred-lifetime valid-lifetime valid-lifetime ] static-bind address ipv6-address/addr-prefix-length duid duid [ iaid iaid ] [ preferred-lifetime preferred-lifetime valid-lifetime valid-lifetime ] By default, all IPv6 addresses except for the DHCPv6 server's IP address in a DHCPv6 address pool are assignable. If the excluded IPv6 address is in a static binding, the address still can be assigned to the client. To exclude multiple IPv6 prefix ranges, repeat this step. By default, no DHCPv6 address pool is configured. By default, no IPv6 address subnet is specified. You cannot use this command to configure the same subnet in different address pools. By default, no non-temporary IPv6 address range is specified, and all unicast addresses on the subnet are assignable. By default, no temporary IPv6 address range is specified, and the DHCPv6 server cannot assign temporary IPv6 addresses. By default, no static binding is configured. To add more static bindings, repeat this step. Configuring network parameters assignment In addition to IPv6 prefixes and IPv6 addresses, you can configure up to eight DNS server addresses, one domain name suffix, eight SIP server addresses, and eight SIP server domain names in an address pool. You can configure network parameters on a DHCPv6 server by using one of the following methods: Configure network parameters in a DHCPv6 address pool. Configure network parameters in a DHCPv6 option group, and reference the option group in a DHCPv6 address pool. Network parameters configured in a DHCPv6 address pool take precedence over those configured in a DHCPv6 option group. 233
247 Configuring network parameters in a DHCPv6 address pool Step Command Remarks 1. Enter system view. system-view N/A 2. Create a DHCPv6 address pool and enter its view. 3. Specify an IPv6 subnet for dynamic assignment. 4. (Optional.) Specify a DNS server address. 5. (Optional.) Specify a domain name suffix. 6. (Optional.) Specify a SIP server address or domain name. 7. (Optional.) Configure a self-defined DHCPv6 option. ipv6 dhcp pool pool-name network prefix/prefix-length [ preferred-lifetime preferred-lifetime valid-lifetime valid-lifetime ] dns-server ipv6-address domain-name domain-name sip-server { address ipv6-address domain-name domain-name } option code hex hex-string By default, no DHCPv6 address pool exists on the DHCPv6 server. By default, no IPv6 subnet is specified. By default, no DNS server address is specified. By default, no domain name suffix is specified. By default, no SIP server address or domain name is specified. By default, no self-defined DHCPv6 option is configured. Configuring network parameters in a DHCPv6 option group A DHCPv6 option group can be created by using the following methods: Create a static DHCPv6 option group by using the ipv6 dhcp option-group command. When the device acts as a DHCPv6 client, it automatically creates a dynamic DHCPv6 option group for saving the obtained parameters. For more information about creating a dynamic DHCPv6 option group, see "Configuring the DHCPv6 client." To create a static DHCPv6 option group: Step Command Remarks 1. Enter system view. system-view N/A 2. Create a static DHCPv6 option group and enter its view. 3. (Optional.) Specify a DNS server address. 4. (Optional.) Specify a domain name suffix. 5. (Optional.) Specify a SIP server address or domain name. 6. (Optional.) Configure a self-defined DHCPv6 option. ipv6 dhcp option-group option-group-number dns-server ipv6-address domain-name domain-name sip-server { address ipv6-address domain-name domain-name } option code hex hex-string By default, no static DHCPv6 option group exists on the DHCPv6 server. By default, no DNS server address is specified. By default, no domain name suffix is specified. By default, no SIP server address or domain name is specified. By default, no self-defined DHCPv6 option is configured. 234
248 Configuring the DHCPv6 server on an interface Enable the DHCP server and configure one of the following address/prefix assignment methods on an interface: Apply an address pool on the interface The DHCPv6 server selects an IPv6 address/prefix from the applied address pool for a requesting client. If there is no assignable IPv6 address/prefix in the address pool, the DHCPv6 server cannot to assign an IPv6 address/prefix to a client. Configure global address assignment on the interface The DHCPv6 server selects an IPv6 address/prefix in the global DHCPv6 address pool that matches the server interface address or the DHCPv6 relay agent address for a requesting client. If you configure both methods on an interface, the DHCPv6 server uses the specified address pool for address assignment without performing global address assignment. Configuration guidelines An interface cannot serve as a DHCPv6 server and DHCPv6 relay agent at the same time. Do not enable DHCPv6 server and DHCPv6 client on the same interface. If you use the ipv6 dhcp server command multiple times, the most recent configuration takes effect. You can apply an address pool that has not been created to an interface. The setting takes effect after the address pool is created. Only one address pool can be applied to an interface. If you use the ipv6 dhcp server apply pool command multiple times, the most recent configuration takes effect. Configuration procedure To configure the DHCPv6 server on an interface: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. interface interface-type interface-number N/A 3. Enable the DHCPv6 server on the interface. 4. Configure an address/prefix assignment method. ipv6 dhcp select server Configure global address assignment: ipv6 dhcp server { allow-hint preference preference-value rapid-commit } * Apply a DHCPv6 address pool to the interface: ipv6 dhcp server apply pool pool-name [ allow-hint preference preference-value rapid-commit ] * By default, the interface discards DHCPv6 packets from DHCPv6 clients. By default, desired address/prefix assignment and rapid assignment are disabled, and the default preference is
249 Setting the DSCP value for DHCPv6 packets sent by the DHCPv6 server The DSCP value of a packet specifies the priority level of the packet and affects the transmission priority of the packet. To set the DSCP value for DHCPv6 packets sent by the DHCPv6 server: Step Command Remarks 1. Enter system view. system-view N/A 2. Set the DSCP value for DHCPv6 packets sent by the DHCPv6 server. ipv6 dhcp dscp dscp-value By default, the DSCP value in DHCPv6 packets sent by the DHCPv6 server is 56. Displaying and maintaining the DHCPv6 server Execute display commands in any view and reset commands in user view. Task Display the DUID of the local device. Display information about a DHCPv6 option group. Command display ipv6 dhcp duid display ipv6 dhcp option-group [ option-group-number ] Display DHCPv6 address pool information. display ipv6 dhcp pool [ pool-name ] Display prefix pool information. display ipv6 dhcp prefix-pool [ prefix-pool-number ] Display DHCPv6 server information on an interface. Display information about IPv6 address conflicts. Display information about expired IPv6 addresses. Display information about IPv6 address bindings. Display information about IPv6 prefix bindings. Display packet statistics on the DHCPv6 server. Clear information about IPv6 address conflicts. Clear information about expired IPv6 address bindings. Clear information about IPv6 address bindings. display ipv6 dhcp server [ interface interface-type interface-number ] display ipv6 dhcp server conflict [ address ipv6-address ] display ipv6 dhcp server expired [ address ipv6-address pool pool-name ] display ipv6 dhcp server ip-in-use [ address ipv6-address pool pool-name ] display ipv6 dhcp server pd-in-use [ pool pool-name prefix prefix/prefix-len ] display ipv6 dhcp server statistics [ pool pool-name ] reset ipv6 dhcp server conflict [ address ipv6-address ] reset ipv6 dhcp server expired [ address ipv6-address pool pool-name ] reset ipv6 dhcp server ip-in-use [ address ipv6-address pool pool-name ] 236
250 Task Clear information about IPv6 prefix bindings. Clear packets statistics on the DHCPv6 server. Command reset ipv6 dhcp server pd-in-use [ pool pool-name prefix prefix/prefix-len ] reset ipv6 dhcp server statistics DHCPv6 server configuration examples Dynamic IPv6 prefix assignment configuration example Network requirements As shown in Figure 90, Router serves as a DHCPv6 server to assign an IPv6 prefix, a DNS server address, a domain name, a SIP server address, and a SIP server name to each DHCPv6 client. The router assigns prefix 2001:0410:0201::/48 to the client whose DUID is CA0006A40000, and assigns prefixes in the range of 2001:0410::/48 to 2001:0410:FFFF::/48 (excluding 2001:0410:0201::/48) to other clients. The DNS server address is 2::2:3. The DHCPv6 clients reside in domain aaa.com. The SIP server address is 2:2::4, and the SIP server name is bbb.com. Figure 90 Network diagram Configuration procedure # Specify an IPv6 address for GigabitEthernet 2/1/1. <Router> system-view [Router] interface gigabitethernet 2/1/1 [Router-GigabitEthernet2/1/1] ipv6 address 1::1/64 [Router-GigabitEthernet2/1/1] quit # Create prefix pool 1, and specify the prefix 2001:0410::/32 with assigned prefix length 48. [Router] ipv6 dhcp prefix-pool 1 prefix 2001:0410::/32 assign-len 48 # Create address pool 1. [Router] ipv6 dhcp pool 1 # In address pool 1, specify subnet 1::/64 where the server interface resides. [Router-dhcp6-pool-1] network 1::/64 237
251 # Apply prefix pool 1 to address pool 1, and set the preferred lifetime to one day, and the valid lifetime to three days. [Router-dhcp6-pool-1] prefix-pool 1 preferred-lifetime valid-lifetime # In address pool 1, bind prefix 2001:0410:0201::/48 to the client DUID CA0006A40000, and set the preferred lifetime to one day, and the valid lifetime to three days. [Router-dhcp6-pool-1] static-bind prefix 2001:0410:0201::/48 duid CA0006A40000 preferred-lifetime valid-lifetime # Configure the DNS server address as 2:2::3. [Router-dhcp6-pool-1] dns-server 2:2::3 # Configure the domain name as aaa.com. [Router-dhcp6-pool-1] domain-name aaa.com # Configure the SIP server address as 2:2::4, and the SIP server name as bbb.com. [Router-dhcp6-pool-1] sip-server address 2:2::4 [Router-dhcp6-pool-1] sip-server domain-name bbb.com [Router-dhcp6-pool-1] quit # Enable the DHCPv6 server on interface GigabitEthernet 2/1/1, enable desired prefix assignment and rapid prefix assignment, and set the preference to the highest. [Router] interface gigabitethernet 2/1/1 [Router-GigabitEthernet2/1/1] ipv6 dhcp select server [Router-GigabitEthernet2/1/1] ipv6 dhcp server allow-hint preference 255 rapid-commit Verifying the configuration # Display the DHCPv6 server configuration on GigabitEthernet 2/1/1. [Router-GigabitEthernet2/1/1] display ipv6 dhcp server interface gigabitethernet 2/1/1 Using pool: global Preference value: 255 Allow-hint: Enabled Rapid-commit: Enabled # Display information about address pool 1. [Router-GigabitEthernet2/1/1] display ipv6 dhcp pool 1 DHCPv6 pool: 1 Network: 1::/64 Preferred lifetime , valid lifetime Prefix pool: 1 Preferred lifetime 86400, valid lifetime Static bindings: DUID: ca0006a4 IAID: Not configured Prefix: 2001:410:201::/48 Preferred lifetime 86400, valid lifetime DNS server addresses: 2:2::3 Domain name: aaa.com SIP server addresses: 2:2::4 SIP server domain names: 238
252 bbb.com # Display information about prefix pool 1. [Router-GigabitEthernet2/1/1] display ipv6 dhcp prefix-pool 1 Prefix: 2001:410::/32 Assigned length: 48 Total prefix number: Available: In-use: 0 Static: 1 # After the client with the DUID CA0006A40000 obtains an IPv6 prefix, display the binding information on the DHCPv6 server. [Router-GigabitEthernet2/1/1] display ipv6 dhcp server pd-in-use Pool: 1 IPv6 prefix Type Lease expiration 2001:410:201::/48 Static(C) Jul 10 19:45: # After the other client obtains an IPv6 prefix, display the binding information on the DHCPv6 server. [Router-GigabitEthernet2/1/1] display ipv6 dhcp server pd-in-use Pool: 1 IPv6 prefix Type Lease expiration 2001:410:201::/48 Static(C) Jul 10 19:45: :410::/48 Auto(C) Jul 10 20:44: Dynamic IPv6 address assignment configuration example Network requirements As shown in Figure 91, Router A serves as a DHCPv6 server to assign IPv6 addresses to the clients on subnets 1::1:0:0:0/96 and 1::2:0:0:0/96. On Router A, configure the IPv6 address 1::1:0:0:1/96 for GigabitEthernet 2/1/1 and 1::2:0:0:1/96 for GigabitEthernet 2/1/2. The lease duration of the addresses on subnet 1::1:0:0:0/96 is seconds (two days), the valid time is seconds (four days), the domain name is aabbcc.com, and the DNS server address is 1::1:0:0:2/96. The lease duration of the addresses on subnet 1::2:0:0:0/96 is seconds (five days), the valid time is seconds (ten days), the domain name is aabbcc.com, and the DNS server address is 1::2:0:0:2/96. Figure 91 Network diagram 239
253 Configuration procedure 1. Specify IPv6 addresses for interfaces on the DHCPv6 server. (Details not shown.) 2. Enable DHCPv6: # Enable the DHCPv6 server on the interfaces GigabitEthernet 2/1/1 and GigabitEthernet 2/1/2. <RouterA> system-view [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ipv6 dhcp select server [RouterA-GigabitEthernet2/1/1] quit [RouterA] interface gigabitethernet 2/1/2 [RouterA-GigabitEthernet2/1/2] ipv6 dhcp select server [RouterA-GigabitEthernet2/1/2] quit # Exclude the DNS server address from dynamic assignment. [RouterA] ipv6 dhcp server forbidden-address 1::1:0:0:2 [RouterA] ipv6 dhcp server forbidden-address 1::2:0:0:2 # Create DHCPv6 address pool 1 to assign IPv6 addresses and other configuration parameters to clients on subnet 1::1:0:0:0/96. [RouterA] ipv6 dhcp pool 1 [RouterA-dhcp6-pool-1] network 1::1:0:0:0/96 preferred-lifetime valid-lifetime [RouterA-dhcp6-pool-1] domain-name aabbcc.com [RouterA-dhcp6-pool-1] dns-server 1::1:0:0:2 [RouterA-dhcp6-pool-1] quit # Create DHCPv6 address pool 2 to assign IPv6 addresses and other configuration parameters to clients on subnet 1::2:0:0:0/96. [RouterA] ipv6 dhcp pool 2 [RouterA-dhcp6-pool-2] network 1::2:0:0:0/96 preferred-lifetime valid-lifetime [RouterA-dhcp6-pool-2] domain-name aabbcc.com [RouterA-dhcp6-pool-2] dns-server 1::2:0:0:2 [RouterA-dhcp6-pool-2] quit Verifying the configuration Clients on subnets 1::1:0:0:0/96 and 1::2:0:0:0/96 can obtain IPv6 addresses and other configuration parameters from the DHCPv6 server (Router A). You can use the display ipv6 dhcp server ip-in-use command to display IPv6 addresses assigned to the clients. 240
254 Configuring the DHCPv6 relay agent A DHCPv6 client usually uses a multicast address to contact the DHCPv6 server on the local link to obtain an IPv6 address and other configuration parameters. As shown in Figure 92, if the DHCPv6 server resides on another subnet, the DHCPv6 clients need a DHCPv6 relay agent to contact the server. The relay agent feature avoids deploying a DHCP server on each subnet. Figure 92 Typical DHCPv6 relay agent application DHCPv6 client DHCPv6 client IPv6 network DHCPv6 relay agent DHCPv6 client DHCPv6 client DHCPv6 server As shown in Figure 93, a DHCPv6 client obtains an IPv6 address and other network configuration parameters from a DHCPv6 server through a DHCPv6 relay agent. The following uses rapid assignment to describe the process: The DHCPv6 client sends a Solicit message containing the Rapid Commit option to the multicast address FF02::1:2 of all the DHCPv6 servers and relay agents. After receiving the Solicit message, the DHCPv6 relay agent encapsulates the message into the Relay Message option of a Relay-forward message, and sends the message to the DHCPv6 server. After obtaining the Solicit message from the Relay-forward message, the DHCPv6 server does the following operations: Selects an IPv6 address and other required parameters. Adds them to a reply that is encapsulated within the Relay Message option of a Relay-reply message. Sends the Relay-reply message to the DHCPv6 relay agent. The DHCPv6 relay agent obtains the reply from the Relay-reply message and sends the reply to the DHCPv6 client. The DHCPv6 client uses the IPv6 address and other network parameters assigned by the DHCPv6 server to complete network configuration. 241
255 Figure 93 Operating process of a DHCPv6 relay agent DHCPv6 client DHCPv6 relay agent DHCPv6 server (1) Solicit (contains a Rapid Commit option) (2) Relay-forward (3) Relay-reply (4) Reply Configuration guidelines You can use the ipv6 dhcp relay server-address command to specify a maximum of eight DHCPv6 servers on the DHCP relay agent interface. The DHCPv6 relay agent forwards DHCP requests to all the specified DHCPv6 servers. If a specific DHCPv6 server address is a link-local address or multicast address, you must specify an outgoing interface by using the interface keyword in the ipv6 dhcp relay server-address command. Otherwise, DHCPv6 packets might fail to reach the DHCPv6 server. Do not enable the DHCPv6 relay agent and DHCPv6 client on the same interface. Configuration procedure To configure the DHCPv6 relay agent: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Enable DHCPv6 relay agent on the interface. 4. Specify a DHCPv6 server. 5. Set the DSCP value for DHCPv6 packets sent by the DHCPv6 relay agent. interface interface-type interface-number ipv6 dhcp select relay ipv6 dhcp relay server-address ipv6-address [ interface interface-type interface-number ] ipv6 dhcp dscp dscp-value N/A By default, the DHCPv6 relay agent is disabled on the interface. By default, no DHCPv6 server is specified. By default, the DSCP value for DHCPv6 packets sent by the DHCPv6 relay agent is 56. The DSCP value of a packet specifies the priority level of the packet and affects the transmission priority of the packet. 242
256 Displaying and maintaining the DHCPv6 relay agent Execute display commands in any view and reset commands in user view. Task Display the DUID of the local device. Display DHCPv6 server addresses specified on the DHCPv6 relay agent. Display packet statistics on the DHCPv6 relay agent. Clear packets statistics on the DHCPv6 relay agent. Command display ipv6 dhcp duid display ipv6 dhcp relay server-address [ interface interface-type interface-number ] display ipv6 dhcp relay statistics [ interface interface-type interface-number ] reset ipv6 dhcp relay statistics [ interface interface-type interface-number ] DHCPv6 relay agent configuration example Network requirements As shown in Figure 94, configure the DHCPv6 relay agent on Router A to relay DHCP packets between DHCPv6 clients and the DHCPv6 server. Router A acts as the gateway of network 1::/64. It sends RA messages to notify the hosts to obtain IPv6 addresses and other configuration parameters through DHCPv6. For more information about RA messages, see "Configuring basic IPv6 settings." Figure 94 Network diagram Configuration procedure 1. Configure the DHCPv6 relay agent on Router A: # Specify IPv6 addresses for GigabitEthernet 2/1/1 and GigabitEthernet 2/1/2. <RouterA> system-view 243
257 [RouterA] interface gigabitethernet 2/1/2 [RouterA-GigabitEthernet2/1/2] ipv6 address 2::1 64 [RouterA-GigabitEthernet2/1/2] quit [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ipv6 address 1::1 64 # Enable the DHCPv6 relay agent on GigabitEthernet 2/1/1 and specify the DHCPv6 server on the relay agent. [RouterA-GigabitEthernet2/1/1] ipv6 dhcp select relay [RouterA-GigabitEthernet2/1/1] ipv6 dhcp relay server-address 2::2 2. Configure Router A as the gateway, enable Router A to send RA messages, and turn on the M and O flags. [RouterA-GigabitEthernet2/1/1] undo ipv6 nd ra halt [RouterA-GigabitEthernet2/1/1] ipv6 nd autoconfig managed-address-flag [RouterA-GigabitEthernet2/1/1] ipv6 nd autoconfig other-flag Verifying the configuration # Display DHCPv6 server address information on Router A. [RouterA-GigabitEthernet2/1/1] display ipv6 dhcp relay server-address Interface: GigabitEthernet2/1/1 Server address Outgoing Interface 2::2 # Display packet statistics on the DHCPv6 relay agent. [RouterA-GigabitEthernet2/1/1] display ipv6 dhcp relay statistics Packets dropped : 0 Packets received : 14 Solicit : 0 Request : 0 Confirm : 0 Renew : 0 Rebind : 0 Release : 0 Decline : 0 Information-request : 7 Relay-forward : 0 Relay-reply : 7 Packets sent : 14 Advertise : 0 Reconfigure : 0 Reply : 7 Relay-forward : 7 Relay-reply : 0 244
258 Configuring the DHCPv6 client Overview With DHCPv6 client configured, an interface can obtain configuration parameters from the DHCPv6 server. A DHCPv6 client can use DHCPv6 to complete the following functions: Obtain an IPv6 address and other configuration parameters, and automatically create a DHCPv6 option group for the obtained parameters. Obtain an IPv6 prefix and other configuration parameters, and automatically create a DHCPv6 option group for the obtained parameters. Support stateless DHCPv6. The DHCPv6 client can obtain configuration parameters except IPv6 address and IPv6 prefix. The interface obtains an IPv6 address through stateless IPv6 address autoconfiguration. If the interface receives an RA message with the M flag set to 0 and the O flag set to 1 during address acquisition, the interface performs stateless DHCPv6 to get other configuration parameters. Configuration restrictions and guidelines When you configure DHCPv6 client, follow these restrictions and guidelines: The DHCPv6 client configuration is supported only on Layer 3 Ethernet interfaces, Layer 3 aggregate interfaces, and VLAN interfaces. Do not configure the DHCPv6 client on the same interface as the DHCPv6 server or the DHCPv6 relay agent. DHCPv6 client configuration task list Tasks at a glance (Required.) Perform one of the following tasks: Configuring IPv6 address acquisition Configuring IPv6 prefix acquisition Configuring stateless DHCPv6 (Optional.) Setting the DSCP value for DHCPv6 packets sent by the DHCPv6 client Configuring IPv6 address acquisition Step Command Remarks 1. Enter system view. system-view N/A 245
259 Step Command Remarks 2. Enter interface view. 3. Configure the interface to use DHCPv6 to obtain an IPv6 address and other configuration parameters. Layer 3 Ethernet interface: interface interface-type interface-number Layer 3 aggregate interface: interface route-aggregation interface-number VLAN interface: interface vlan-interface interface-number ipv6 address dhcp-alloc [ option-group group-number rapid-commit ] * N/A By default, the interface does not use DHCPv6 for IPv6 address acquisition. Configuring IPv6 prefix acquisition Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Configure the interface to use DHCPv6 to obtain an IPv6 prefix and other configuration parameters. Layer 3 Ethernet interface: interface interface-type interface-number Layer 3 aggregate interface: interface route-aggregation interface-number VLAN interface: interface vlan-interface interface-number ipv6 dhcp client pd prefix-number [ option-group group-number rapid-commit ] * N/A By default, the interface does not use DHCPv6 for IPv6 prefix acquisition. Configuring stateless DHCPv6 Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. Layer 3 Ethernet interface: interface interface-type interface-number Layer 3 aggregate interface: interface route-aggregation interface-number VLAN interface: interface vlan-interface interface-number N/A 246
260 Step Command Remarks 3. Configure the interface to support stateless DHCPv6. Enable stateless IPv6 address autoconfiguration: ipv6 address auto Enable stateless DHCPv6: ipv6 dhcp client stateless enable Use at least one of the methods. By default, the interface does not support stateless DHCPv6. Setting the DSCP value for DHCPv6 packets sent by the DHCPv6 client The DSCP value of a packet specifies the priority level of the packet and affects the transmission priority of the packet. To set the DSCP value for DHCPv6 packets sent by the DHCPv6 client: Step Command Remarks 1. Enter system view. system-view N/A 2. Set the DSCP value for DHCPv6 packets sent by the DHCPv6 client. ipv6 dhcp client dscp dscp-value By default, the DSCP value in DHCPv6 packets sent by the DHCPv6 client is 56. Displaying and maintaining DHCPv6 client Execute the display commands in any view, and execute the reset command in user view. Task Display the DHCPv6 client information. Display the DHCPv6 client statistics. Clear the DHCPv6 client statistics. Command display ipv6 dhcp client [ interface interface-type interface-number ] display ipv6 dhcp client statistics [ interface interface-type interface-number ] reset ipv6 dhcp client statistics [ interface interface-type interface-number ] DHCPv6 client configuration examples IPv6 address acquisition configuration example Network requirements As shown in Figure 95, configure GigabitEthernet 2/1/1 of Router to use DHCPv6 to obtain configuration parameters from the DHCPv6 server. The parameters include IPv6 address, DNS server address, domain name suffix, SIP server address, and SIP server domain name. 247
261 Figure 95 Network diagram Configuration procedure You must configure the DHCPv6 server before configuring the DHCPv6 client. For information about configuring the DHCPv6 server, see "Configuring the DHCPv6 server." # Configure GigabitEthernet 2/1/1 to support DHCPv6 rapid address assignment. Enable the DHCPv6 client to create dynamic DHCPv6 option group 1 for saving configuration parameters. <Router> system-view [Router] interface gigabitethernet 2/1/1 [Router-GigabitEthernet2/1/1] ipv6 address dhcp-alloc rapid-commit option-group 1 [Router-GigabitEthernet2/1/1] quit Verifying the configuration # Display DHCPv6 client information. The output shows that the client has obtained configuration parameters from the server. [Router] display ipv6 dhcp client GigabitEthernet2/1/1: Type: Stateful client requesting address State: OPEN IAID: 0xf0019 Client DUID: fe2ff0000 Preferred server: Reachable via address: FE80::200:5EFF:FE0A:2303 Server DUID: fe20a0a00 Address: 1:2::2 Preferred lifetime 60 sec, valid lifetime 60 sec T1 30 sec, T2 48 sec Will expire on Feb at 15:37:20 (50 seconds left) DNS server addresses: 2000::FF Domain name: example.com SIP server addresses: 2:2::4 SIP server domain names: bbb.com 248
262 # Display information about the dynamic DHCPv6 option group. The output shows that the client has created a dynamic DHCPv6 option group for saving configuration parameters. [Router-GigabitEthernet2/1/1] display ipv6 dhcp option-group 1 DHCPv6 option group: 1 DNS server addresses: Type: Dynamic (DHCPv6 address allocation) Interface: GigabitEthernet2/1/1 2000::FF Domain name: Type: Dynamic (DHCPv6 address allocation) Interface: GigabitEthernet2/1/1 example.com SIP server addresses: Type: Dynamic (DHCPv6 address allocation) Interface: GigabitEthernet2/1/1 2:2::4 SIP server domain names: Type: Dynamic (DHCPv6 address allocation) Interface: GigabitEthernet2/1/1 bbb.com # Display brief IPv6 information for all interfaces on the device. The output shows that the DHCPv6 client has obtained an IPv6 address. [Router] display ipv6 interface brief *down: administratively down (s): spoofing Interface Physical Protocol IPv6 Address GigabitEthernet2/1/1 up up 1:2::2 IPv6 prefix acquisition configuration example Network requirements As shown in Figure 96, configure GigabitEthernet 2/1/1 of Router to use DHCPv6 to obtain configuration parameters from the DHCPv6 server. The parameters include IPv6 prefix, DNS server address, domain name suffix, SIP server address, and SIP server domain name. Figure 96 Network requirements 249
263 Configuration procedure You must configure the DHCPv6 server before configuring the DHCPv6 client. For information about configuring the DHCPv6 server, see "Configuring the DHCPv6 server." # Configure an IPv6 address for GigabitEthernet 2/1/1 that connects to the DHCPv6 server. <Router> system-view [Router] interface gigabitethernet 2/1/1 [Router-GigabitEthernet2/1/1] ipv6 address 1::2/48 # Configure GigabitEthernet 2/1/1 to support DHCPv6 rapid prefix assignment. Enable the DHCPv6 client to assign an ID to the obtained IPv6 prefix and create a dynamic DHCPv6 option group for saving configuration parameters. [Router-GigabitEthernet2/1/1] ipv6 dhcp client pd 1 rapid-commit option-group 1 [Router-GigabitEthernet2/1/1] quit Verifying the configuration # Display DHCPv6 client information. The output shows that the DHCPv6 client has obtained an IPv6 prefix and other configuration parameters from the DHCPv6 server. [Router] display ipv6 dhcp client GigabitEthernet2/1/1: Type: Stateful client requesting prefix State: OPEN IAID: 0xf0019 Client DUID: fe2ff0000 Preferred server: Reachable via address: FE80::200:5EFF:FE0A:2303 Server DUID: fe20a0a00 Prefix: 12:34::/32 Preferred lifetime 90 sec, valid lifetime 90 sec T1 45 sec, T2 72 sec Will expire on Feb at 15:37:20 (80 seconds left) DNS server addresses: 2000::FF Domain name: example.com SIP server addresses: 2:2::4 SIP server domain names: bbb.com # Display information about the dynamic IPv6 prefix. The output shows that the client has obtained an IPv6 prefix. [Router] display ipv6 prefix 1 Number: 1 Type : Dynamic Prefix: 12:34::/32 Preferred lifetime 90 sec, valid lifetime 90 sec # Display information about the dynamic DHCPv6 option group. The output shows that the client has created a dynamic DHCPv6 option group for saving configuration parameters. [Router] display ipv6 dhcp option-group 1 250
264 DHCPv6 option group: 1 DNS server addresses: Type: Dynamic (DHCPv6 prefix allocation) Interface: GigabitEthernet2/1/1 2000::FF Domain name: Type: Dynamic (DHCPv6 prefix allocation) Interface: GigabitEthernet2/1/1 example.com SIP server addresses: Type: Dynamic (DHCPv6 prefix allocation) Interface: GigabitEthernet2/1/1 2:2::4 SIP server domain names: Type: Dynamic (DHCPv6 prefix allocation) Interface: GigabitEthernet2/1/1 bbb.com Stateless DHCPv6 configuration example Network requirements As shown in Figure 97, configure GigabitEthernet 2/1/1 on Router A to use stateless DHCPv6 to obtain configuration parameters except IPv6 address and IPv6 prefix. Router B acts as the gateway and advertises RA messages periodically. Figure 97 Network diagram Configuration procedure You must configure the DHCPv6 server before configuring the DHCPv6 client. For information about configuring the DHCPv6 server, see "Configuring the DHCPv6 server." 1. Configure the gateway Router B: # Configure an IPv6 address for GigabitEthernet 2/1/1. <RouterB> system-view [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] ipv6 address 1::1 64 # Set the O flag in RA messages to 1. [RouterB-GigabitEthernet2/1/1] ipv6 nd autoconfig other-flag # Allow the interface to advertise RA messages. [RouterB-GigabitEthernet2/1/1] undo ipv6 nd ra halt 251
265 2. Configure the DHCPv6 client on Router A: # Enable stateless IPv6 address autoconfiguration on GigabitEthernet 2/1/1. <RouterA> system-view [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ipv6 address auto With stateless IPv6 address autoconfiguration enabled, but no IPv6 address configured for GigabitEthernet 2/1/1, Router A generates a link local address. It sends an RS message to Router B to request configuration information for IPv6 address generation. Upon receiving the RS message, Router B sends back an RA message. After receiving an RA message with the M flag set to 0 and the O flag set to 1, Router A performs stateless DHCPv6 to get other configuration parameters. Verifying the configuration # Display DHCPv6 client information for GigabitEthernet 2/1/1. [RouterA-GigabitEthernet2/1/1] display ipv6 dhcp client interface gigabitethernet 2/1/1 GigabitEthernet2/1/1: Type: Stateless client State: OPEN IAID: 0xf0019 Client DUID: fe2ff0000 Preferred server: Reachable via address: FE80::213:7FFF:FEF6:C818 Server DUID: ff6c818 DNS server addresses: 1:2:4::5 1:2:4::7 Domain name: abc.com # Display DHCPv6 client statistics. [RouterA-GigabitEthernet2/1/1] display ipv6 dhcp client statistics Interface : GigabitEthernet2/1/1 Packets received : 1 Reply : 1 Advertise : 0 Reconfigure : 0 Invalid : 0 Packets sent : 5 Solicit : 0 Request : 0 Renew : 0 Rebind : 0 Information-request : 5 Release : 0 Decline : 0 252
266 Configuring DHCPv6 snooping In this chapter, "MSR1000" refers to MSR "MSR2000" refers to MSR2003, MSR , MSR "MSR3000" collectively refers to MSR3012, MSR3024, MSR3044, MSR3064. "MSR4000" collectively refers to MSR4060 and MSR4080. Overview DHCPv6 snooping works between the DHCPv6 client and server, or between the DHCPv6 client and DHCPv6 relay agent. It guarantees that DHCPv6 clients obtain IP addresses from authorized DHCPv6 servers. Also, it records IP-to-MAC bindings of DHCPv6 clients (called DHCPv6 snooping entries) for security purposes. DHCPv6 snooping does not work between the DHCPv6 server and DHCPv6 relay agent. DHCPv6 snooping defines trusted and untrusted ports to make sure that clients obtain IPv6 addresses only from authorized DHCPv6 servers. Trusted A trusted port can forward DHCPv6 messages correctly to make sure the clients get IPv6 addresses from authorized DHCPv6 servers. Untrusted An untrusted port discards received messages sent by DHCPv6 servers to prevent unauthorized servers from assigning IPv6 addresses. DHCPv6 snooping reads DHCP-ACK messages received from trusted ports and DHCP-REQUEST messages to create DHCPv6 snooping entries. A DHCPv6 snooping entry includes the MAC and IP addresses of a client, the port that connects to the DHCPv6 client, and the VLAN. You can use the display ipv6 dhcp snooping binding command to display the IP addresses of users for management. Application of trusted and untrusted ports Configure ports facing the DHCPv6 server as trusted ports, and configure other ports as untrusted ports. As shown in Figure 98, configure the DHCPv6 snooping device's port that is connected to the DHCPv6 server as a trusted port. The trusted port forwards response messages from the DHCPv6 server to the client. The untrusted port connected to the unauthorized DHCPv6 server discards incoming DHCPv6 response messages. 253
267 Figure 98 Trusted and untrusted ports Feature and hardware compatibility This feature is supported only on the following models: MSR routers that hold an Layer 2 switching module. The built-in Layer 2 interfaces of the MSR1000, MSR and MSR routers. HP implementation of Option 18 and Option 37 Option 18 for DHCPv6 snooping Option 18, also called the interface-id option, is used by the DHCPv6 relay agent to determine the interface to use to forward RELAY-REPLY message. In HP implementation, the DHCPv6 snooping device adds Option 18 to the received DHCPv6 request message before forwarding it to the DHCPv6 server. The server then assigns IP address to the client based on the client information in Option 18. Figure 99 Option 18 format Figure 99 shows the Option 18 fields: Option code Option code. Option length Size of the option data. 254
268 Port index Port that receives the DHCPv6 request from the client. VLAN ID ID of the outer VLAN. Second VLAN ID ID of the inner VLAN. DUID DUID of the DHCPv6 client. NOTE: The Second VLAN ID field is optional. If the received DHCPv6 request does not contain a second VLAN, Option 18 also does not contain it. DHCPv6 snooping support for Option 37 Option 37, also called the remote-id option, is used to identify the client. In HP implementation, the DHCPv6 snooping device adds Option 37 to the received DHCPv6 request message before forwarding it to the DHCPv6 server. This option provides client information about address allocation. Figure 100 Option 37 format Figure 100 shows the Option 37 fields: Option code Option code. Option length Size of the option data. Enterprise number Enterprise number. Port index Port that receives the DHCPv6 request from the client. VLAN ID ID of the outer VLAN. Second VLAN ID ID of the inner VLAN. DUID DUID of the DHCPv6 client. NOTE: The Second VLAN ID field is optional. If the received DHCPv6 request does not contain a second VLAN, Option 37 also does not contain it. 255
269 DHCPv6 snooping configuration task list Tasks at a glance (Required.) Configuring basic DHCPv6 snooping (Optional.) Configuring Option 18 and Option 37 (Optional.) Saving DHCPv6 snooping entries (Optional.) Setting the maximum number of DHCPv6 snooping entries (Optional.) Enabling DHCPv6-REQUEST check Configuring basic DHCPv6 snooping To make sure DHCPv6 clients can obtain valid IPv6 addresses, specify the ports connected to authorized DHCPv6 servers as trusted ports. The trusted ports and the ports connected to DHCPv6 clients must be in the same VLAN. To configure basic DHCPv6 snooping: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable DHCPv6 snooping. ipv6 dhcp snooping enable By default, DHCPv6 snooping is disabled. 3. Enter interface view. 4. Specify the port as a trusted port. interface interface-type interface-number ipv6 dhcp snooping trust This interface must connect to the DHCPv6 server. By default, all ports are untrusted ports after DHCPv6 snooping is enabled. 5. Return to system view. quit N/A 6. Enter interface view. 7. (Optional.) Enable recording of client information in DHCPv6 snooping entries. interface interface-type interface-number ipv6 dhcp snooping binding record This interface must connect to the DHCPv6 client. By default, DHCPv6 snooping does not record client information. Configuring Option 18 and Option 37 Step Command Remarks 1. Enter system view. system-view N/A 256
270 Step Command Remarks 2. Enter Layer 2 Ethernet interface view. interface interface-type interface-number N/A 3. Enable support for Option (Optional.) Specify the content as the interface ID. 5. Enable support for Option 37. (Optional.) Specify the content as the remote ID. ipv6 dhcp snooping option interface-id enable ipv6 dhcp snooping option interface-id [ vlan vlan-id ] string interface-id ipv6 dhcp snooping option remote-id enable ipv6 dhcp snooping option remote-id [ vlan vlan-id ] string remote-id By default, Option 18 is not supported. By default, the DHCPv6 snooping device uses its DUID as the content for Option 18. By default, Option 37 is not supported. By default, the DHCPv6 snooping device uses its DUID as the content for Option 37. Saving DHCPv6 snooping entries DHCPv6 snooping entries cannot survive a reboot. You can save DHCPv6 snooping entries to a file so that DHCPv6 snooping can read DHCPv6 snooping entries from this file during a reboot. This allows security features (such as IP source guard) that use DHCPv6 snooping entries to continue to use these entries to check the user validity of DHCPv6 clients. IMPORTANT: If you disable DHCPv6 snooping with the undo ipv6 dhcp snooping enable command, the device deletes all DHCPv6 snooping entries, including those stored in the specified database file. To save DHCPv6 snooping entries: Step Command Remarks 1. Enter system view. system-view N/A 2. Specify a file to store DHCPv6 snooping entries. 3. (Optional.) Manually save DHCPv6 snooping entries to the database file. ipv6 dhcp snooping binding database filename { filename url url [ username username [ password { cipher simple } key ] ] } ipv6 dhcp snooping binding database update now By default, no file is specified. This command enables the device to immediately save DHCPv6 snooping entries to the specified database file. If the file does not exist, the device automatically creates the file. The device does not update the file for a specific amount of time after a DHCPv6 snooping entry changes. The default period is 300 seconds. To change the value, use the ipv6 dhcp snooping binding database update interval command. DHCPv6 snooping entries are saved to the database file each time this command is executed. 257
271 Step Command Remarks 4. (Optional.) Set the amount of time to wait to update the database file after DHCPv6 snooping entry changes. ipv6 dhcp snooping binding database update interval seconds The default setting is 300 seconds. When a DHCPv6 snooping entry is learned or removed, the device does not update the database file until after the specified waiting period. All changed entries during that period will be updated. Setting the maximum number of DHCPv6 snooping entries Perform this task to prevent the system resources from being overused. To set the maximum number of DHCPv6 snooping entries: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Set the maximum number of DHCPv6 snooping entries for the interface to learn. interface interface-type interface-number ipv6 dhcp snooping max-learning-num number N/A By default, the number of DHCPv6 snooping entries for an interface to learn is not limited. Enabling DHCPv6-REQUEST check Perform this task to use the DHCPv6-REQUEST check function to protect the DHCPv6 server against DHCPv6 client spoofing attacks. Attackers can forge DHCPv6-RENEW messages to renew leases for legitimate DHCPv6 clients that no longer need the IP addresses. The forged messages disable the victim DHCPv6 server from releasing the IP addresses. Attackers can also forge DHCPv6-DECLINE or DHCPv6-RELEASE messages to terminate leases for legitimate DHCPv6 clients that still need the IP addresses. The DHCPv6-REQUEST check function enables the DHCPv6 snooping device to check every received DHCPv6-RENEW, DHCPv6-DECLINE, or DHCPv6-RELEASE message against DHCPv6 snooping entries. If any of the criteria in an entry is matched, the device compares the entry with the message information. If they are consistent, the device considers the message valid and forwards it to the DHCPv6 server. If they are different, the device considers the message forged and discards it. If no matching entry is found, the device forwards the message to the DHCPv6 server. To enable DHCPv6-REQUEST check: 258
272 Step Command Remarks 1. Enter system view. system-view N/A 2. Enter interface view. 3. Enable DHCPv6-REQUEST check. interface interface-type interface-number ipv6 dhcp snooping check request-message N/A By default, DHCPv6-REQUEST check is disabled. You can enable the function only on Layer 2 Ethernet interfaces. Displaying and maintaining DHCPv6 snooping Execute display commands in any view, and reset commands in user view. Task Display information about trusted ports. Display DHCPv6 snooping entries. Display information about the file that stores DHCPv6 snooping entries. Display DHCPv6 packet statistics for DHCPv6 snooping (MSR1000/MSR2000/MSR3000). Display DHCPv6 packet statistics for DHCPv6 snooping (MSR4000). Clear DHCPv6 snooping entries. Clear DHCPv6 packet statistics for DHCPv6 snooping (MSR1000/MSR2000/MSR3000). Clear DHCPv6 packet statistics for DHCPv6 snooping (MSR4000). Command display ipv6 dhcp snooping trust display ipv6 dhcp snooping binding [ address ipv6-address [ vlan vlan-id ] ] display ipv6 dhcp snooping binding database display ipv6 dhcp snooping packet statistics display ipv6 dhcp snooping packet statistics [ slot slot-number ] reset ipv6 dhcp snooping binding { all address ipv6-address [ vlan vlan-id ] } reset ipv6 dhcp snooping packet statistics reset ipv6 dhcp snooping packet statistics [ slot slot-number ] DHCPv6 snooping configuration example Network requirements As shown in Figure 101, configure GigabitEthernet 2/1/1 connecting to the DHCPv6 server as a trusted port. Enable DHCPv6 snooping to record client information in DHCPv6 snooping entries. 259
273 Figure 101 Network diagram Configuration procedure # Enable DHCPv6 snooping. <RouterB> system-view [RouterB] ipv6 dhcp snooping enable # Specify GigabitEthernet 2/1/1 as a trusted port. [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] ipv6 dhcp snooping trust [RouterB-GigabitEthernet2/1/1] quit # Enable recording of client information in DHCPv6 snooping entries. [RouterB]interface gigabitethernet 2/1/2 [RouterB-GigabitEthernet2/1/2] ipv6 dhcp snooping binding record [RouterB-GigabitEthernet2/1/2] quit Verifying the configuration The DHCPv6 client obtains an IPv6 address and other configuration parameters from the authorized DHCPv6 server. You can use the display ipv6 dhcp snooping binding command to display DHCPv6 snooping entries on the authorized DHCPv6 server. 260
274 Configuring IPv6 fast forwarding Overview Fast forwarding reduces route lookup time and improves packet forwarding efficiency by using a high-speed cache and data-flow-based technology. It identifies a data flow by using the following fields: Source IPv6 address. Destination IPv6 address. Source port number. Destination port number. Protocol number. VPN instance name. After the first packet of a flow is forwarded through the routing table, fast forwarding creates an entry for the flow and uses the entry to forward subsequent packets of the flow. Configuration procedure To configure IPv6 fast forwarding: Step Command Remarks 1. Enter system view. system-view N/A 2. Enable IPv6 fast-forwarding load sharing. 3. Set the aging time of IPv6 fast forwarding entries. ipv6 fast-forwarding load-sharing ipv6 fast-forwarding aging-time aging-time By default, IPv6 fast-forwarding load sharing is enabled. By default, the aging time of IPv6 fast forwarding entries is 30 seconds. Displaying and maintaining IPv6 fast forwarding Execute display commands in any view and reset commands in user view. Task Display IPv6 fast forwarding table information (MSR1000/MSR2000/MSR3000). Display IPv6 fast forwarding table information (MSR4000). Display the aging time of the IPv6 fast forwarding entry. Command display ipv6 fast-forwarding cache [ ipv6-address ] display ipv6 fast-forwarding cache [ ipv6-address ] [ slot slot-number ] display ipv6 fast-forwarding aging-time 261
275 Task Clear IPv6 fast forwarding table information (MSR1000/MSR2000/MSR3000). Clear IPv6 fast forwarding table information (MSR4000). Command reset ipv6 fast-forwarding cache reset ipv6 fast-forwarding cache [ slot slot-number ] IPv6 fast forwarding configuration example Network requirements As shown in Figure 102, enable IPv6 fast forwarding on Router B. Figure 102 Network diagram Configuration procedure 1. Configure Router A: # Specify the IPv6 address of interface GigabitEthernet 2/1/1. <RouterA> system-view [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ipv6 address 2002::1 64 [RouterA-GigabitEthernet2/1/1] quit # Configure a static route. [RouterA] ipv6 route-static 2001:: ::2 2. Configure Router C: # Specify the IPv6 address of interface GigabitEthernet 2/1/2. <RouterC> system-view [RouterC] interface gigabitethernet 2/1/2 [RouterC-GigabitEthernet2/1/2] ipv6 address 2001::1 64 [RouterC-GigabitEthernet2/1/2] quit # Configure a static route. [RouterC] ipv6 route-static 2002:: ::2 3. Configure Router B: # Enable IPv6 fast forwarding. <RouterB> system-view [RouterB] ipv6 fast-forwarding # Specify the IPv6 addresses of interface GigabitEthernet 2/1/1 and interface GigabitEthernet 2/1/2. [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] ipv6 address 2002::
276 [RouterB-GigabitEthernet2/1/1] quit [RouterB] interface gigabitethernet 2/1/2 [RouterB-GigabitEthernet2/1/2] ipv6 address 2001::2 64 [RouterB-GigabitEthernet2/1/2] quit Verifying the configuration # Display the IPv6 fast forwarding table on Router B. [RouterB] display ipv6 fast-forwarding cache No IPv6 fast-forwarding entries. The output shows that no IPv6 fast forwarding entry exists. # Ping the IPv6 address of GigabitEthernet 2/1/2 on Router C from Router A. Reply packets can be received. [RouterA] ping ipv6 2001::1 PING 2001::1 : 56 data bytes, press CTRL_C to break Reply from 2001::1 bytes=56 Sequence=1 hop limit=64 time = 69 ms Reply from 2001::1 bytes=56 Sequence=2 hop limit=64 time = 1 ms Reply from 2001::1 bytes=56 Sequence=3 hop limit=64 time = 1 ms Reply from 2001::1 bytes=56 Sequence=4 hop limit=64 time = 1 ms Reply from 2001::1 bytes=56 Sequence=5 hop limit=64 time = 1 ms ::1 ping statistics packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 1/14/69 ms # Display the IPv6 fast forwarding table on Router B. [RouterB] display ipv6 fast-forwarding cache Total number of IPv6 fast-forwarding items: 2 Src IP: 2002::1 Src port: 129 Dst IP: 2001::1 Dst port: 0 Protocol: 58 VPN instance: N/A Input interface: GE2/1/1 Output interface: GE2/1/2 Src IP: 2001::1 Src port: 128 Dst IP: 2002::1 Dst port: 0 Protocol: 58 VPN instance: N/A Input interface: GE2/1/2 Output interface: GE2/1/1 263
277 The output shows that IPv6 fast forwarding entries have been created. 264
278 Configuring tunneling In this chapter, "MSR1000" refers to MSR "MSR2000" refers to MSR2003, MSR , MSR "MSR3000" collectively refers to MSR3012, MSR3024, MSR3044, MSR3064. "MSR4000" collectively refers to MSR4060 and MSR4080. Overview Tunneling is an encapsulation technology. One network protocol encapsulates packets of another network protocol and transfers them over a virtual point-to-point connection. The virtual connection is called a tunnel. Packets are encapsulated at the tunnel source end and de-encapsulated at the tunnel destination end. Tunneling refers to the whole process from data encapsulation to data transfer to data de-encapsulation. Tunneling supports the following technologies: Transition techniques, such as IPv6 over IPv4 tunneling, to interconnect IPv4 and IPv6 networks. VPN, such as IPv4 over IPv4 tunneling, IPv4/IPv6 over IPv6 tunneling, GRE, DVPN, and IPsec tunneling. Traffic engineering, such as MPLS TE to prevent network congestion. Unless otherwise specified, the term "tunnel" in this document refers to IPv6 over IPv4, IPv4 over IPv4, IPv4 over IPv6, and IPv6 over IPv6 tunnels. IPv6 over IPv4 tunneling Implementation IPv6 over IPv4 tunneling enables isolated IPv6 networks to communicate, as shown in Figure 103. NOTE: The devices at the ends of an IPv6 over IPv4 tunnel must support the IPv4/IPv6 dual stack. Figure 103 IPv6 over IPv4 tunnel The IPv6 over IPv4 tunnel processes packets by using the following steps: 265
279 Tunnel modes 1. A host in the IPv6 network sends an IPv6 packet to Device A at the tunnel source. 2. After Device A receives the IPv6 packet, it processes the packet as follows: a. Searches the routing table to identify the outgoing interface for the IPv6 packet. The outgoing interface is the tunnel interface, so Device A knows that the packet needs to be forwarded through the tunnel. b. Encapsulates the IPv6 packet with an IPv4 header and forwards it through the physical interface of the tunnel. In the IPv4 header, the source IPv4 address is the IPv4 address of the tunnel source, and the destination IPv4 address is the IPv4 address of the tunnel destination. 3. Upon receiving the packet, Device B de-encapsulates the packet. 4. If the destination address of the IPv6 packet is itself, Device B forwards it to the upper-layer protocol. If not, Device B forwards it according to the routing table. IPv6 over IPv4 tunnels include manually configured tunnels and automatic tunnels, depending on how the IPv4 address of the tunnel destination is acquired. Manually configured tunnel The destination IPv4 address of the tunnel cannot be automatically acquired from the destination IPv6 address of an IPv6 packet at the tunnel source. It must be manually configured. Automatic tunnel The destination IPv4 address of the tunnel can be automatically acquired from the destination IPv6 address (with an IPv4 address embedded) of an IPv6 packet at the tunnel source. According to the way an IPv6 packet is encapsulated, IPv6 over IPv4 tunnels are divided into the following modes. Table 11 IPv6 over IPv4 tunnel modes and key parameters Tunnel type Tunnel mode Tunnel source/destination address Destination IPv6 address format Manually configured tunnel IPv6 over IPv4 manual tunneling The source and destination IPv4 addresses are manually configured. Ordinary IPv6 address Automatic tunnel Automatic IPv4-compatible IPv6 tunneling The source IPv4 address is manually configured. The destination IPv4 address is automatically obtained. IPv4-compatible IPv6 address, in the format of ::IPv4-destination-address/96, where the IPv4-destination-address is the IPv4 address of the tunnel destination. 6to4 tunneling The source IPv4 address is manually configured. The destination IPv4 address is automatically obtained. 6to4 address, in the format of 2002:IPv4-destination-address::/ 48, where the IPv4-destination-address is the IPv4 address of the tunnel destination. 266
280 Tunnel type Tunnel mode Tunnel source/destination address Destination IPv6 address format ISATAP tunneling The source IPv4 address is manually configured. The destination IPv4 address is automatically obtained. ISATAP address, in the format of Prefix:0:5EFE:IPv4-destination-ad dress/64 where the IPv4-destination-address is the IPv4 address of the tunnel destination. IPv6 over IPv4 manual tunneling A point-to-point link and its source and destination IPv4 addresses are manually configured. This type of tunneling provides the following solutions: Connect isolated IPv6 networks over an IPv4 network. Connect an IPv6 network to an IPv4/IPv6 dual-stack host over an IPv4 network. Automatic IPv4-compatible IPv6 tunneling A point-to-multipoint link. Both ends of the tunnel use IPv4-compatible IPv6 addresses. The address format is 0:0:0:0:0:0:a.b.c.d/96, where a.b.c.d is the IPv4 address of the tunnel destination. This mechanism simplifies tunnel establishment. Automatic IPv4-compatible IPv6 tunnels have limitations because IPv4-compatible IPv6 addresses must use globally unique IPv4 addresses. 6to4 tunneling Ordinary 6to4 tunneling A point-to-multipoint automatic tunnel. It is used to connect multiple isolated IPv6 networks over an IPv4 network. The destination IPv4 address of a 6to4 tunnel is embedded in the destination 6to4 address of packets. This mechanism enables the device to automatically obtain the tunnel destination address, simplifying tunnel establishment. The 6to4 address format is 2002:abcd:efgh:subnet number::interface ID/ is the fixed IPv6 address prefix, and abcd:efgh represents a 32-bit globally unique IPv4 address in hexadecimal notation. For example, can be represented by 0101:0101. The IPv4 address identifies a 6to4 network (an IPv6 network where all hosts use 6to4 addresses). The border router of a 6to4 network must have the IPv4 address abcd:efgh configured on the interface connected to the IPv4 network. The subnet number identifies a subnet in the 6to4 network. The subnet number::interface ID uniquely identifies a host in the 6to4 network. 6to4 tunneling uses an IPv4 address to identify a 6to4 network. This method overcomes the limitations of automatic IPv4-compatible IPv6 tunneling. 6to4 relay Connects a 6to4 network and an IPv6 network that uses an IP prefix other than 2002::/16. A 6to4 relay router is a gateway that forwards packets from a 6to4 network to an IPv6 network. As shown in Figure 104, 6to4 network Site 1 communicates with IPv6 network Site 3 over a 6to4 tunnel. Configure a static route on the border router (Device A) in the 6to4 network. The next-hop address must be the 6to4 address of the 6to4 relay router (Device C). Device A forwards all packets destined for the IPv6 network over the 6to4 tunnel, and Device C then forwards them to the IPv6 network. 267
281 Figure 104 Principle of 6to4 tunneling and 6to4 relay ISATAP tunneling An ISATAP tunnel is a point-to-multipoint automatic tunnel. It provides a solution to connect an IPv6 host to an IPv6 network over an IPv4 network. The destination addresses of IPv6 packets are all ISATAP addresses. The ISATAP address format is prefix:0:5efe:abcd:efgh. The 64-bit prefix is a valid IPv6 unicast address prefix. The abcd:efgh/64 segments represent a 32-bit IPv4 address, which identifies the tunnel destination but does not require global uniqueness. ISATAP tunnels are mainly used for communication between IPv6 routers or between an IPv6 host and an IPv6 router over an IPv4 network. Figure 105 Principle of ISATAP tunneling IPv4 over IPv4 tunneling IPv4 over IPv4 tunneling (RFC 1853) enables isolated IPv4 networks to communicate. For example, an IPv4 over IPv4 tunnel can connect isolated private IPv4 networks over a public IPv4 network. Figure 106 IPv4 over IPv4 tunnel 268
282 Packets traveling through a tunnel undergo encapsulation and de-encapsulation, as shown in Figure 106. Encapsulation: a. Device A receives an IP packet from an IPv4 host and submits it to the IP protocol stack. b. The IPv4 protocol stack determines how to forward the packet according to the destination address in the IP header. If the packet is destined for the IPv4 host connected to Device B, Device A delivers the packet to the tunnel interface. c. The tunnel interface adds a new IPv4 header to the IPv4 packet and submits it to the IP protocol stack. In the new header, the source IP address specifies the tunnel source, and the destination IP address specifies the tunnel destination. The IP protocol stack uses the destination IP address of the new IP header to look up the routing table, and then sends the packet out. De-encapsulation: d. After receiving the packet, Device B delivers it to the IP protocol stack. e. If the protocol number is 4 (indicating an IPv4 packet is encapsulated within the packet), the IP protocol stack delivers the packet to the tunnel module for de-encapsulation. f. The tunnel module de-encapsulates the IP packet and sends it back to the IP protocol stack. g. The protocol stack forwards the de-encapsulated packet. IPv4 over IPv6 tunneling Implementation IPv4 over IPv6 tunneling adds an IPv6 header to IPv4 packets so that IPv4 packets can pass an IPv6 network through a tunnel to realize interworking between isolated IPv4 networks. Figure 107 IPv4 over IPv6 tunnel Packets traveling through a tunnel undergo encapsulation and de-encapsulation, as shown in Figure 107. Encapsulation: a. Upon receiving an IPv4 packet, Device A delivers it to the IPv4 protocol stack. b. The IPv4 protocol stack uses the destination address of the packet to determine the egress interface. If the egress interface is the tunnel interface, the IPv4 protocol stack delivers the packet to the tunnel interface. c. The tunnel interface adds an IPv6 header to the original IPv4 packet and delivers the packet to the IPv6 protocol stack. 269
283 Tunnel modes d. The IPv6 protocol stack uses the destination IPv6 address of the packet to look up the routing table, and then sends it out. De-encapsulation: e. Upon receiving the IPv6 packet from the attached IPv6 network, Device B delivers the packet to the IPv6 protocol stack to examine the protocol type encapsulated in the data portion of the packet. f. If the protocol type is IPv4, the IPv6 protocol stack delivers the packet to the tunneling module. g. The tunneling module removes the IPv6 header and delivers the remaining IPv4 packet to the IPv4 protocol stack. h. The IPv4 protocol stack forwards the IPv4 packet. IPv4 over IPv6 tunnels include the following modes: IPv4 over IPv6 manual tunnel A point-to-point link and its source and destination IPv6 addresses are manually configured. You can establish an IPv4 over IPv6 manual tunnel to connect isolated IPv4 networks over an IPv6 network. DS-Lite tunnel Dual Stack Lite (DS-Lite) is a combination of the tunneling and NAT technologies. NAT translates the private IPv4 addresses of the IPv4 hosts before the hosts reach the IPv4 public network. DS-Lite tunnel supports only an IPv4 host in a private network initiating communication with an IPv4 host on the Internet. It does not support an IPv4 host on the Internet initiating communication with an IPv4 host in a private network. Figure 108 DS-Lite tunnel As shown in Figure 108, the DS-Lite feature contains the following components: Basic Bridging BroadBand (B4) element The B4 element is typically a CPE router that connects end hosts. IPv4 packets entering the B4 router are encapsulated into IPv6 packets and sent to the AFTR. IPv6 packets from the AFTR are de-encapsulated into IPv4 packets and sent to the subscriber's network. Hosts that can serve as the B4 router are referred to as DS-Lite hosts. 270
284 Address Family Transition Router (AFTR) An AFTR resides in the ISP network and terminates the tunnel from the B4 router. NAT is also implemented on the interface that connects the public IPv4 network. AFTR de-encapsulates the tunneled packet, translates the network address, and routes the packet to the destination IPv4 network. For IPv4 packets coming from the public IPv4 network, AFTR performs reverse address translation and sends them to the B4 router by using the DS-Lite tunnel. Figure 109 Packet forwarding process in DS-Lite /24 IPv4 host /24 1::1/64 2::1/ /24 Private IPv6 network IPv4 network IPv4 network DS-Lite tunnel B4 AFTR /24 IPv4 host IPv4 dst: IPv4 src: TCP dst: 80 TCP src: Adds an IPv6 header IPv6 dst: 2::1 IPv6 src: 1::1 IPv4 dst: IPv4 src: TCP dst: 80 TCP src: Removes the IPv6 header and performs NAT IPv4 dst: IPv4 src: TCP dst: 80 TCP src: 5000 IPv6 dst: 1::1 IPv6 src: 2::1 IPv4 dst: IPv4 src: TCP dst: TCP src: 80 Performs NAT and adds an IPv6 header IPv4 dst: IPv4 src: TCP dst: 5000 TCP src: 80 IPv4 dst: IPv4 src: TCP dst: TCP src: 80 Removes the IPv6 header Figure 109 shows a packet passing through a DS-Lite tunnel between IPv4 networks. a. Upon receiving a packet from the private IPv4 network, the B4 router adds an IPv6 header to the packet and sends the IPv6 packet to the AFTR through the tunnel. b. The AFTR does the following: Removes the IPv6 header of the tunneled packet. Assigns a tunnel ID for the B4 router. Records the mapping between the IPv6 address of the B4 router (the source IPv6 address of the packet), and the tunnel ID. c. After de-encapsulation, the AFTR translates the source private IPv4 address of the packet into a public IPv4 address and sends the packet to the destination IPv4 host. The AFTR also maps the NAT entries to the tunnel ID so that IPv4 networks connected to different B4 routers can use the same address space. d. Upon receiving the response packet from the public network, the AFTR translates the destination public IPv4 address into the private IPv4 address. The AFTR does the following: 271
285 Looks up the IPv6 address-tunnel ID mapping to obtain the IP address of the B4 router. Uses the address as the destination address of the encapsulated IPv6 packet. Forwards the packet to the B4 router. Figure 109 shows an example of PAT translation for dynamic NAT. DS-Lite tunneling also supports static NAT and NO-PAT. Typically, dynamic NAT is used. When you use static NAT for DS-Lite tunneling, make sure the IP addresses of private IPv4 networks connecting to different B4 routers do not overlap. For more information about NAT, see "Configuring NAT." IPv6 over IPv6 tunneling IPv6 over IPv6 tunneling (RFC 2473) enables isolated IPv6 networks to communicate with each other over another IPv6 network. For example, two isolated IPv6 networks that do not want to show their addresses to the Internet can use an IPv6 over IPv6 tunnel to communicate with each other. Figure 110 Principle of IPv6 over IPv6 tunneling Figure 110 shows the encapsulation and de-encapsulation processes. Encapsulation: a. After receiving an IPv6 packet, Device A submits it to the IPv6 protocol stack. b. The IPv6 protocol stack uses the destination IPv6 address of the packet to find the egress interface. If the egress interface is the tunnel interface, the stack delivers it to the tunnel interface. c. After receiving the packet, the tunnel interface adds an IPv6 header to it and submits it to the IPv6 protocol stack. d. The IPv6 protocol stack forwards the packet according to its destination IPv6 address. De-encapsulation: e. Upon receiving the IPv6 packet, Device B delivers it to the IPv6 protocol stack. f. The IPv6 protocol stack checks the protocol type of the data portion encapsulated in the IPv6 packet. If the encapsulation protocol is IPv6, the stack delivers the packet to the tunnel module. g. The tunnel module de-encapsulates the packet and sends it back to the IPv6 protocol stack. h. The IPv6 protocol stack forwards the IPv6 packet. Protocols and standards RFC 1853, IP in IP Tunneling 272
286 RFC 2473, Generic Packet Tunneling in IPv6 Specification RFC 2893, Transition Mechanisms for IPv6 Hosts and Routers RFC 3056, Connection of IPv6 Domains via IPv4 Clouds RFC 4214, Intra-Site Automatic Tunnel Addressing Protocol (ISATAP) RFC 6333, Dual-Stack Lite Broadband Deployments Following IPv4 Exhaustion Tunneling configuration task list Tasks at a glance (Required.) Configuring a tunnel interface Perform one of the following tasks: Configuring an IPv6 over IPv4 tunnel: Configuring an IPv6 over IPv4 manual tunnel Configuring an automatic IPv4-compatible IPv6 tunnel Configuring a 6to4 tunnel Configuring an ISATAP tunnel Configuring an IPv4 over IPv4 tunnel Configuring an IPv4 over IPv6 tunnel: Configuring an IPv4 over IPv6 manual tunnel Configuring a DS-Lite tunnel Configuring an IPv6 over IPv6 tunnel Configuring a tunnel interface Configure a Layer 3 virtual tunnel interface on each device on a tunnel so that devices at both ends can send, identify, and process packets from the tunnel. When an active/standby switchover occurs or the standby card is removed on an MSR4000 router, the tunnel interfaces configured on the active or standby card still exist. To delete a tunnel interface, use the undo interface tunnel command. To configure a tunnel interface: Step Command Remarks 1. Enter system view. system-view N/A 273
287 Step Command Remarks 2. Create a tunnel interface, specify the tunnel mode, and enter tunnel interface view. 3. (Optional.) Configure a description for the interface. 4. (Optional.) Specify a service card for forwarding the traffic on the tunnel interface (MSR4000). interface tunnel number mode { ds-lite-aftr gre [ ipv6 ] ipv4-ipv4 ipv6 ipv6-ipv4 [ 6to4 auto-tunnel isatap ] mpls-te } description text service slot slot-number By default, no tunnel interface is created. When you create a new tunnel interface, you must specify the tunnel mode. When you enter the view of an existing tunnel interface, you do not need to specify the tunnel mode. The two ends of a tunnel must use the same tunnel mode. Otherwise, packet tunneling will fail. By default, the description of a tunnel interface is Tunnel number Interface. By default, no service card is specified. 5. Set the MTU of the tunnel interface. mtu mtu-size By default, the MTU is bytes. 6. Set the expected bandwidth for the tunnel interface. bandwidth bandwidth-value By default, the expected bandwidth is 64 kbps. The expected bandwidth for the tunnel interface affects the link cost value. For more information, see Layer 3 IP Routing Configuration Guide. 7. Set the ToS for tunneled packets. tunnel tos tos-value 8. Set the TTL for tunneled packets. tunnel ttl ttl-value The default setting is the same as the ToS of the original packet. The default TTL for tunneled packets is Set the VPN to which the tunnel destination belongs. 10. (Optional.) Restore the default settings of the tunnel interface. 11. (Optional.) Shut down the tunnel interface. tunnel vpn-instance vpn-instance-name default shutdown By default, the tunnel destination belongs to the public network. To set the VPN for the tunnel source, use the ip binding vpn-instance command. The tunnel source and destination must belong to the same VPN. Otherwise, the tunnel interface cannot go up. N/A By default, the tunnel interface is up. 274
288 Configuring an IPv6 over IPv4 manual tunnel Follow these guidelines when you configure an IPv6 over IPv4 manual tunnel: The tunnel destination address specified on the local device must be identical with the tunnel source address specified on the tunnel peer device. Do not specify the same tunnel source and destination addresses for the tunnels in the same mode on a device. To ensure correct packet forwarding, identify whether the destination IPv6 network and the IPv6 address of the local tunnel interface are on the same subnet. If not, configure a route reaching the destination IPv6 network through the tunnel interface. You can configure the route by using one of the following methods: Configure a static route, and specify the local tunnel interface as the egress interface or specify the IPv6 address of the peer tunnel interface as the next hop. Enable a dynamic routing protocol on both tunnel interfaces to achieve the same purpose. For more information about route configuration, see Layer 3 IP Routing Configuration Guide. To configure an IPv6 over IPv4 manual tunnel: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter IPv6 over IPv4 manual tunnel interface view. 3. Specify an IPv6 address for the tunnel interface. 4. Configure a source address or source interface for the tunnel interface. 5. Configure a destination address for the tunnel interface. 6. (Optional.) Set the DF bit for tunneled packets. interface tunnel number [ mode ipv6-ipv4 ] For configuration details, see "Configuring basic IPv6 settings." source { ip-address interface-type interface-number } destination ip-address tunnel dfbit enable N/A No IPv6 address is configured for the tunnel interface by default. By default, no source address or source interface is configured for the tunnel interface. The specified source address or the primary IP address of the specified source interface is used as the source IP address of tunneled packets. By default, no destination address is configured for the tunnel interface. The tunnel destination address must be the IP address of the receiving interface on the tunnel peer. It is used as the destination IP address of tunneled packets. The DF bit is not set for tunneled packets by default. 7. Return to system view. quit N/A 8. (Optional.) Enable dropping of IPv6 packets using IPv4-compatible IPv6 addresses. tunnel discard ipv4-compatible-packet This feature is disabled by default. 275
289 Configuration example Network requirements As shown in Figure 111, configure an IPv6 over IPv4 tunnel between Router A and Router B so the two IPv6 networks can reach each other over the IPv4 network. Because the tunnel destination IPv4 address cannot be automatically obtained from the destination IPv6 addresses of packets, configure an IPv6 over IPv4 manual tunnel. Figure 111 Network diagram Configuration procedure Make sure Router A and Router B can reach each other through IPv4. Configure Router A: # Specify an IPv4 address for GigabitEthernet 2/1/2. <RouterA> system-view [RouterA] interface gigabitethernet 2/1/2 [RouterA-GigabitEthernet2/1/2] ip address [RouterA-GigabitEthernet2/1/2] quit # Specify an IPv6 address for GigabitEthernet 2/1/1. [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ipv6 address 3002::1 64 [RouterA-GigabitEthernet2/1/1] quit # Configure an IPv6 over IPv4 manual tunnel interface tunnel 0. [RouterA] interface tunnel 0 mode ipv6-ipv4 # Specify an IPv6 address for the tunnel interface. [RouterA-Tunnel0] ipv6 address 3001::1/64 # Specify GigabitEthernet 2/1/2 as the source interface of the tunnel interface. [RouterA-Tunnel0] source gigabitethernet 2/1/2 # Specify the destination address for the tunnel interface as the IP address of GigabitEthernet 2/1/2 on Router B. [RouterA-Tunnel0] destination [RouterA-Tunnel0] quit # Configure a static route destined for IPv6 network 2 through Tunnel 0 on Router A. [RouterA] ipv6 route-static 3003:: 64 tunnel 0 Configure Router B: # Specify an IPv4 address for GigabitEthernet 2/1/2. <RouterB> system-view [RouterB] interface gigabitethernet 2/1/2 276
290 [RouterB-GigabitEthernet2/1/2] ip address [RouterB-GigabitEthernet2/1/2] quit # Specify an IPv6 address for GigabitEthernet 2/1/1. [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] ipv6 address 3003::1 64 [RouterB-GigabitEthernet2/1/1] quit # Configure an IPv6 over IPv4 manual tunnel interface tunnel 0. [RouterB] interface tunnel 0 mode ipv6-ipv4 # Specify an IPv6 address for the tunnel interface. [RouterB-Tunnel0] ipv6 address 3001::2/64 # Specify GigabitEthernet 2/1/2 as the source interface of the tunnel interface. [RouterB-Tunnel0] source gigabitethernet 2/1/2 # Specify the destination address for the tunnel interface as the IP address of GigabitEthernet 2/1/2 on Router A. [RouterB-Tunnel0] destination [RouterB-Tunnel0] quit # Configure a static route destined for IPv6 network 1 through Tunnel 0 on Router B. [RouterB] ipv6 route-static 3002:: 64 tunnel 0 Verifying the configuration # Use the display ipv6 interface command to display tunnel interface status on Router A and Router B. The output shows that the interface tunnel 0 is up. (Details not shown.) # Router B and Router A can ping the IPv6 address of GigabitEthernet 2/1/1 of each other. For example, ping the IPv6 address of GigabitEthernet 2/1/1 on Router B from Router A. [RouterA] ping ipv6 3003::1 Ping6(56 data bytes) 3001::1 --> 3003::1, press CTRL C to break 56 bytes from 3003::1, icmp_seq=0 hlim=64 time= ms 56 bytes from 3003::1, icmp_seq=1 hlim=64 time= ms 56 bytes from 3003::1, icmp_seq=2 hlim=64 time=4.000 ms 56 bytes from 3003::1, icmp_seq=3 hlim=64 time= ms 56 bytes from 3003::1, icmp_seq=4 hlim=64 time= ms --- Ping6 statistics for 3003:: packet(s) transmitted, 5 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 4.000/16.000/45.000/ ms Configuring an automatic IPv4-compatible IPv6 tunnel Follow these guidelines when you configure an automatic IPv4-compatible IPv6 tunnel: You do not need to configure a destination address for an automatic IPv4-compatible IPv6 tunnel. The destination address of the tunnel is embedded in the destination IPv4-compatible IPv6 address of packets. The source addresses of local tunnels of the same tunnel mode cannot be the same. To configure an automatic IPv4-compatible IPv6 tunnel: 277
291 Step Command Remarks 1. Enter system view. system-view N/A 2. Enter automatic IPv4-compatible IPv6 tunnel interface view. 3. Specify an IPv6 address for the tunnel interface. 4. Configure a source address or source interface for the tunnel interface. 5. (Optional.) Set the DF bit for tunneled packets. interface tunnel number [ mode ipv6-ipv4 auto-tunnel ] For configuration details, see "Configuring basic IPv6 settings." source { ip-address interface-type interface-number } tunnel dfbit enable N/A No IPv6 address is configured for the tunnel interface by default. By default, no source address or source interface is configured for the tunnel interface. The specified source address or the primary IP address of the specified source interface is used as the source IP address of tunneled packets. The DF bit is not set for tunneled packets by default. Configuration example Network requirements As shown in Figure 112, dual-stack routers Router A and Router B communicate over an IPv4 network. Configure an automatic IPv4-compatible IPv6 tunnel between the two routers to enable IPv6 communications over the IPv4 network. Figure 112 Network diagram Configuration procedure Before configuring an automatic IPv4-compatible IPv6 tunnel, make sure Router A and Router B can reach each other through IPv4. Configure Router A: # Specify an IPv4 address for GigabitEthernet 2/1/1. <RouterA> system-view [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ip address [RouterA-GigabitEthernet2/1/1] quit # Create an automatic IPv4-compatible IPv6 tunnel. [RouterA] interface tunnel 0 mode ipv6-ipv4 auto-tunnel # Specify an IPv4-compatible IPv6 address for the tunnel interface. [RouterA-Tunnel0] ipv6 address :: /96 278
292 # Specify GigabitEthernet 2/1/1 as the source interface of the tunnel interface. [RouterA-Tunnel0] source gigabitethernet 2/1/1 Configure Router B: Verifying the configuration # Specify an IPv4 address for GigabitEthernet 2/1/1. <RouterB> system-view [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] ip address [RouterB-GigabitEthernet2/1/1] quit # Configure an automatic IPv4-compatible IPv6 tunnel. [RouterB] interface tunnel 0 mode ipv6-ipv4 auto-tunnel # Specify an IPv4-compatible IPv6 address for the tunnel interface. [RouterB-Tunnel0] ipv6 address :: /96 # Specify GigabitEthernet 2/1/1 as the source interface of the tunnel interface. [RouterB-Tunnel0] source gigabitethernet 2/1/1 # Use the display ipv6 interface command to display tunnel interface status on Router A and Router B. The output shows that the interface tunnel 0 is up. (Details not shown.) # Router B and Router A can ping the IPv4-compatible IPv6 address of each other. For example, ping the IPv4-compatible IPv6 address on Router B from Router A. [RouterA-Tunnel0] ping ipv6 :: Ping6(56 data bytes) :: > :: , press CTRL_C to break 56 bytes from :: , icmp_seq=0 hlim=64 time= ms 56 bytes from :: , icmp_seq=1 hlim=64 time=9.000 ms 56 bytes from :: , icmp_seq=2 hlim=64 time= ms 56 bytes from :: , icmp_seq=3 hlim=64 time=9.000 ms 56 bytes from :: , icmp_seq=4 hlim=64 time= ms --- Ping6 statistics for :: packet(s) transmitted, 5 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 9.000/11.400/17.000/2.939 ms Configuring a 6to4 tunnel Follow these guidelines when you configure a 6to4 tunnel: You do not need to configure a destination address for a 6to4 tunnel, because the destination IPv4 address is embedded in the 6to4 IPv6 address. The source addresses of local tunnels of the same tunnel mode cannot be the same. Automatic tunnels do not support dynamic routing. You must configure a static route destined for the destination IPv6 network if the destination IPv6 network is not in the same subnet as the IPv6 address of the tunnel interface. You can specify the local tunnel interface as the egress interface of the route or specify the IPv6 address of the peer tunnel interface as the next hop of the route. For more information about route configuration, see Layer 3 IP Routing Configuration Guide. To configure a 6to4 tunnel: 279
293 Step Command Remarks 1. Enter system view. system-view N/A 2. Enter 6to4 tunnel interface view. 3. Specify an IPv6 address for the tunnel interface. 4. Configure a source address or source interface for the tunnel interface. 5. (Optional.) Set the DF bit for tunneled packets. interface tunnel number [ mode ipv6-ipv4 6to4 ] For configuration details, see "Configuring basic IPv6 settings." source { ip-address interface-type interface-number } tunnel dfbit enable N/A No IPv6 address is configured for the tunnel interface by default. By default, no source address or source interface is configured for the tunnel interface. The specified source address or the primary IP address of the specified source interface is used as the source IP address of tunneled packets. The DF bit is not set for tunneled packets by default. 6. Return to system view. quit N/A 7. (Optional.) Enable dropping of IPv6 packets using IPv4-compatible IPv6 addresses. tunnel discard ipv4-compatible-packet Optional. The default setting is disabled. 6to4 tunnel configuration example Network requirements As shown in Figure 113, configure a 6to4 tunnel between 6to4 routers Router A and Router B so Host A and Host B can reach each other over the IPv4 network. Figure 113 Network diagram Configuration considerations To enable communication between 6to4 networks, configure 6to4 addresses for 6to4 routers and hosts in the 6to4 networks. The IPv4 address of GigabitEthernet 2/1/2 on Router A is /24, and the corresponding 6to4 prefix is 2002:0201:0101::/48. Host A must use this prefix. 280
294 The IPv4 address of GigabitEthernet 2/1/2 on Router B is /24, and the corresponding 6to4 prefix is 2002:0501:0101::/48. Host B must use this prefix. Configuration procedure Before configuring a 6to4 tunnel, make sure Router A and Router B can reach each other through IPv4. Configure Router A: # Specify an IPv4 address for GigabitEthernet 2/1/2. <RouterA> system-view [RouterA] interface gigabitethernet 2/1/2 [RouterA-GigabitEthernet2/1/2] ip address [RouterA-GigabitEthernet2/1/2] quit # Specify a 6to4 address for GigabitEthernet 2/1/1. [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ipv6 address 2002:0201:0101:1::1/64 [RouterA-GigabitEthernet2/1/1] quit # Create a 6to4 tunnel interface tunnel 0. [RouterB] interface tunnel 0 mode ipv6-ipv4 6to4 # Specify an IPv6 address for the tunnel interface. [RouterA-Tunnel0] ipv6 address 3001::1/64 # Specify the source interface as GigabitEthernet 2/1/2 for the tunnel interface. [RouterA-Tunnel0] source gigabitethernet 2/1/2 [RouterA-Tunnel0] quit # Configure a static route destined for 2002::/16 through the tunnel interface. [RouterA] ipv6 route-static 2002:: 16 tunnel 0 Configure Router B: # Specify an IPv4 address for GigabitEthernet 2/1/2. <RouterB> system-view [RouterB] interface gigabitethernet 2/1/2 [RouterB-GigabitEthernet2/1/2] ip address [RouterB-GigabitEthernet2/1/2] quit # Specify a 6to4 address for GigabitEthernet 2/1/1. [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] ipv6 address 2002:0501:0101:1::1/64 [RouterB-GigabitEthernet2/1/1] quit # Create a 6to4 tunnel interface. [RouterB] interface tunnel 0 mode ipv6-ipv4 6to4 # Specify an IPv6 address for the tunnel interface. [RouterB-Tunnel0] ipv6 address 3002::1/64 # Specify the source interface as GigabitEthernet 2/1/2 for the tunnel interface. [RouterB-Tunnel0] source gigabitethernet 2/1/2 [RouterB-Tunnel0] quit # Configure a static route destined for 2002::/16 through the tunnel interface. [RouterB] ipv6 route-static 2002:: 16 tunnel 0 Verifying the configuration # Ping Host B from Host A or ping Host A from Host B. The ping operation succeeds. 281
295 D:\>ping6 -s 2002:201:101:1::2 2002:501:101:1::2 Pinging 2002:501:101:1::2 from 2002:201:101:1::2 with 32 bytes of data: Reply from 2002:501:101:1::2: bytes=32 time=13ms Reply from 2002:501:101:1::2: bytes=32 time=1ms Reply from 2002:501:101:1::2: bytes=32 time=1ms Reply from 2002:501:101:1::2: bytes=32 time<1ms Ping statistics for 2002:501:101:1::2: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 13ms, Average = 3ms 6to4 relay configuration example Network requirements As shown in Figure 114, Router A is a 6to4 router, and 6to4 addresses are used on the connected IPv6 network. Router B serves as a 6to4 relay router and is connected to an IPv6 network (2001::/16). Configure a 6to4 tunnel between Router A and Router B to make Host A and Host B reachable to each other. The configuration on a 6to4 relay router is similar to that on a 6to4 router. However, to enable communication between the 6to4 network and the IPv6 network, you must configure a route to the IPv6 network on the 6to4 router. The IPv4 address of GigabitEthernet 2/1/2 on the relay router is /24 and its corresponding 6to4 prefix is 2002:0601:0101::/48. The next hop of the static route must be an address using this prefix. Figure 114 Network diagram Configuration procedure Make sure Router A and Router B can reach each other through IPv4. Configure Router A: # Specify an IPv4 address for GigabitEthernet 2/1/2. <RouterA> system-view [RouterA] interface gigabitethernet 2/1/2 282
296 [RouterA-GigabitEthernet2/1/2] ip address [RouterA-GigabitEthernet2/1/2] quit # Specify a 6to4 address for GigabitEthernet 2/1/1. [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ipv6 address 2002:0201:0101:1::1/64 [RouterA-GigabitEthernet2/1/1] quit # Configure a 6to4 tunnel interface tunnel 0. [RouterA] interface tunnel 0 mode ipv6-ipv4 6to4 # Specify an IPv6 address for the tunnel interface. [RouterA-Tunnel0] ipv6 address 2002::1/64 # Specify GigabitEthernet 2/1/2 as the source interface of the tunnel interface. [RouterA-Tunnel0] source gigabitethernet 2/1/2 [RouterA-Tunnel0] quit # Configure a static route to the 6to4 relay router. [RouterA] ipv6 route-static 2002:0601:0101:: 64 tunnel 0 # Configure a default route to reach the IPv6 network, which specifies the next hop as the 6to4 address of the relay router. [RouterA] ipv6 route-static :: :0601:0101::1 Configure Router B: # Specify an IPv4 address for GigabitEthernet 2/1/2. <RouterB> system-view [RouterB] interface gigabitethernet 2/1/2 [RouterB-GigabitEthernet2/1/2] ip address [RouterB-GigabitEthernet2/1/2] quit # Specify an IPv6 address for GigabitEthernet 2/1/1. [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] ipv6 address 2001::1/16 [RouterB-GigabitEthernet2/1/1] quit # Configure a 6to4 tunnel interface tunnel 0. [RouterB] interface tunnel 0 mode ipv6-ipv4 6to4 # Specify an IPv6 address for the tunnel interface. [RouterB-Tunnel0] ipv6 address 2003::1/64 # Specify GigabitEthernet 2/1/2 as the source interface of the tunnel interface. [RouterB-Tunnel0] source gigabitethernet 2/1/2 [RouterB-Tunnel0] quit # Configure a static route destined for 2002::/16 through the tunnel interface. [RouterB] ipv6 route-static 2002:: 16 tunnel 0 Verifying the configuration # Ping Host B from Host A or ping Host A from Host B. The ping operation succeeds. D:\>ping6 -s 2002:201:101:1::2 2001::2 Pinging 2001::2 from 2002:201:101:1::2 with 32 bytes of data: Reply from 2001::2: bytes=32 time=13ms 283
297 Reply from 2001::2: bytes=32 time=1ms Reply from 2001::2: bytes=32 time=1ms Reply from 2001::2: bytes=32 time<1ms Ping statistics for 2001::2: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 13ms, Average = 3ms Configuring an ISATAP tunnel Follow these guidelines when you configure an ISATAP tunnel: You do not need to configure a destination address for an ISATAP tunnel, because the destination IPv4 address is embedded in the ISATAP address. Because automatic tunnels do not support dynamic routing, configure a static route destined for the destination IPv6 network at each tunnel end. You can specify the local tunnel interface as the egress interface of the route or specify the IPv6 address of the peer tunnel interface as the next hop of the route. For more information about route configuration, see Layer 3 IP Routing Configuration Guide. The source addresses of local tunnels of the same tunnel mode cannot be the same. To configure an ISATAP tunnel: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter ISATAP tunnel interface view. 3. Specify an IPv6 address for the tunnel interface. 4. Configure a source address or source interface for the tunnel interface. 5. (Optional.) Set the DF bit for tunneled packets. interface tunnel number [ mode ipv6-ipv4 isatap ] For configuration details, see "Configuring basic IPv6 settings." source { ip-address interface-type interface-number } tunnel dfbit enable N/A By default, no IPv6 address is configured for the tunnel interface. By default, no source address or source interface is configured for the tunnel interface. The specified source address or the primary IP address of the specified source interface is used as the source IP address of tunneled packets. The DF bit is not set for tunneled packets by default. 6. Return to system view. quit N/A 7. (Optional.) Enable dropping of IPv6 packets using IPv4-compatible IPv6 addresses. tunnel discard ipv4-compatible-packet The default setting is disabled. 284
298 Configuration example Network requirements As shown in Figure 115, configure an ISATAP tunnel between the router and the ISATAP host so the ISATAP host in the IPv4 network can access the IPv6 network. Figure 115 Network diagram Configuration procedure Configure the router: # Specify an IPv6 address for GigabitEthernet 2/1/2. <Router> system-view [Router] interface gigabitethernet 2/1/2 [Router-GigabitEthernet2/1/2] ipv6 address 3001::1/64 [Router-GigabitEthernet2/1/2] quit # Specify an IPv4 address for GigabitEthernet 2/1/1. [Router] interface gigabitethernet 2/1/1 [Router-GigabitEthernet2/1/1] ip address [Router-GigabitEthernet2/1/1] quit # Create an ISATAP tunnel interface tunnel 0. [Router] interface tunnel 0 mode ipv6-ipv4 isatap # Specify an EUI-64 IPv6 address for the tunnel interface. [Router-Tunnel0] ipv6 address 2001:: 64 eui-64 # Specify GigabitEthernet 2/1/1 as the source interface of the tunnel interface. [Router-Tunnel0] source gigabitethernet 2/1/1 # Disable RA suppression so that the ISATAP host can acquire information such as the address prefix from the RA message advertised by the ISATAP router. [Router-Tunnel0] undo ipv6 nd ra halt [Router-Tunnel0] quit Configure the ISATAP host: Configurations on the ISATAP host vary by operating system. The following example is performed on Windows XP. # Install IPv6. C:\>ipv6 install # On a host running Windows XP, the ISATAP interface is typically interface 2. Display information about the ISATAP interface. C:\>ipv6 if 2 Interface 2: Automatic Tunneling Pseudo-Interface 285
299 Guid {48FCE3FC-EC30-E50E-F1A AEEE3AE} does not use Neighbor Discovery does not use Router Discovery routing preference 1 EUI-64 embedded IPv4 address: router link-layer address: preferred link-local fe80::5efe: , life infinite link MTU 1280 (true link MTU 65515) current hop limit 128 reachable time 42500ms (base 30000ms) retransmission interval 1000ms DAD transmits 0 default site prefix length 48 # Specify an IPv4 address for the ISATAP router. C:\>netsh interface ipv6 isatap set router # Display information about the ISATAP interface. C:\>ipv6 if 2 Interface 2: Automatic Tunneling Pseudo-Interface Guid {48FCE3FC-EC30-E50E-F1A AEEE3AE} does not use Neighbor Discovery uses Router Discovery routing preference 1 EUI-64 embedded IPv4 address: router link-layer address: preferred global 2001::5efe: , life 29d23h59m46s/6d23h59m46s (public) preferred link-local fe80::5efe: , life infinite link MTU 1500 (true link MTU 65515) current hop limit 255 reachable time 42500ms (base 30000ms) retransmission interval 1000ms DAD transmits 0 default site prefix length 48 The host has acquired the prefix 2001::/64 and has automatically generated the global unicast address 2001::5efe: The message "uses Router Discovery" indicates that the router discovery function is enabled on the host. # Display information about IPv6 routes on the host. C:\>ipv6 rt 2001::/64 -> 2 pref 1if+8=9 life 29d23h59m43s (autoconf) ::/0 -> 2/fe80::5efe: pref 1if+256=257 life 29m43s (autoconf) Configure the IPv6 host: # Configure a route to the boarder router. C:\>netsh interface ipv6 set route 2001::/ ::1 Verifying the configuration # Ping the IPv6 host from the ISATAP host. The ping operation succeeds, indicating that an ISATAP tunnel has been established. C:\>ping 3001::2 286
300 Pinging 3001::2 with 32 bytes of data: Reply from 3001::2: time=1ms Reply from 3001::2: time=1ms Reply from 3001::2: time=1ms Reply from 3001::2: time=1ms Ping statistics for 3001::2: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 1ms, Maximum = 1ms, Average = 1ms Configuring an IPv4 over IPv4 tunnel Follow these guidelines when you configure an IPv4 over IPv4 tunnel: The destination address specified for the local tunnel interface must be the source address specified for the peer tunnel interface, and vice versa. The source/destination addresses of local tunnels of the same tunnel mode cannot be the same. The IPv4 address of the local tunnel interface cannot be on the same subnet as the destination address configured on the tunnel interface. To ensure correct packet forwarding, identify whether the destination IPv4 network and the IPv4 address of the local tunnel interface are on the same subnet. If not, configure a route reaching the destination IPv4 network through the tunnel interface. You can configure the route by using one of the following methods: Configure a static route, and specify the local tunnel interface as the egress interface or specify the IPv4 address of the peer tunnel interface as the next hop. Enable a dynamic routing protocol on both tunnel interfaces to achieve the same purpose. For more information about route configuration, see Layer 3 IP Routing Configuration Guide. The destination address of the route passing the tunnel interface must not be on the same subnet as the destination address configured on the tunnel interface. To configure an IPv4 over IPv4 tunnel: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter IPv4 over IPv4 tunnel interface view. 3. Configure an IPv4 address for the tunnel interface. interface tunnel number [ mode ipv4-ipv4 ] ip address ip-address { mask mask-length } [ sub ] N/A By default, no IPv4 address is configured for the tunnel interface. 287
301 Step Command Remarks 4. Configure a source address or source interface for the tunnel interface. 5. Configure a destination address for the tunnel interface. 6. (Optional.) Set the DF bit for tunneled packets. source { ip-address interface-type interface-number } destination ip-address tunnel dfbit enable By default, no source address or source interface is configured for the tunnel interface. The specified source address or the IPv6 address of the specified source interface is used as the source IP address of tunneled packets. By default, no destination address is configured for the tunnel interface. The tunnel destination address must be the IP address of the receiving interface on the tunnel peer. It is used as the destination IP address of tunneled packets. The DF bit is not set for tunneled packets by default. Configuration example Network requirements As shown in Figure 116, the two subnets Group 1 and Group 2 use private IPv4 addresses. Configure an IPv4 over IPv4 tunnel between Router A and Router B to make the two subnets reachable to each other. Figure 116 Network diagram Configuration procedure Make sure Router A and Router B can reach each other through IPv4. Configure Router A: # Specify an IPv4 address for GigabitEthernet 2/1/1. <RouterA> system-view [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ip address [RouterA-GigabitEthernet2/1/1] quit # Specify an IPv4 address for Serial 2/2/0, which is the physical interface of the tunnel. [RouterA] interface serial 2/2/0 [RouterA-Serial2/2/0] ip address [RouterA-Serial2/2/0] quit 288
302 # Create an IPv4 over IPv4 tunnel interface tunnel 1. [RouterA] interface tunnel 1 mode ipv4-ipv4 # Specify an IPv4 address for the tunnel interface. [RouterA-Tunnel1] ip address # Specify the IP address of Serial 2/2/0 as the source address for the tunnel interface. [RouterA-Tunnel1] source # Specify the IP address of Serial 2/2/1 on Router B as the destination address for the tunnel interface. [RouterA-Tunnel1] destination [RouterA-Tunnel1] quit # Configure a static route destined for the IP network Group 2 through the tunnel interface. [RouterA] ip route-static tunnel 1 Configure Router B: # Specify an IPv4 address for GigabitEthernet 2/1/1. <RouterB> system-view [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] ip address [RouterB-GigabitEthernet2/1/1] quit # Specify an IPv4 address for Serial 2/2/1, which is the physical interface of the tunnel. [RouterB] interface serial 2/2/1 [RouterB-Serial2/2/1] ip address [RouterB-Serial2/2/1] quit # Create an IPv4 over IPv4 tunnel interface tunnel 2. [RouterB] interface tunnel 2 mode ipv4-ipv4 # Specify an IPv4 address for the tunnel interface. [RouterB-Tunnel2] ip address # Specify the IP address of Serial 2/2/1 as the source address for the tunnel interface. [RouterB-Tunnel2] source # Specify the IP address of Serial 2/2/0 on Router A as a destination address for the tunnel interface. [RouterB-Tunnel2] destination [RouterB-Tunnel2] quit # Configure a static route destined for the IP network Group 1 through the tunnel interface. [RouterB] ip route-static tunnel 2 Verifying the configuration # Use the display interface tunnel command to display the status of the tunnel interfaces on Router A and Router B. The output shows that the tunnel interfaces are up. (Details not shown.) # Ping the IPv4 address of the peer interface GigabitEthernet 2/1/1 from each router. The following shows the output on Router A. [RouterA] ping -a Ping ( ) from : 56 data bytes, press CTRL_C to break 56 bytes from : icmp_seq=0 ttl=255 time=2.000 ms 56 bytes from : icmp_seq=1 ttl=255 time=1.000 ms 56 bytes from : icmp_seq=2 ttl=255 time=0.000 ms 56 bytes from : icmp_seq=3 ttl=255 time=1.000 ms 289
303 56 bytes from : icmp_seq=4 ttl=255 time=1.000 ms --- Ping statistics for packet(s) transmitted, 5 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.000/1.000/2.000/0.632 ms Configuring an IPv4 over IPv6 manual tunnel Follow these guidelines when you configure an IPv4 over IPv6 manual tunnel: The destination address specified for the local tunnel interface must be the source address specified for the peer tunnel interface, and vice versa. The source/destination addresses of local tunnels of the same tunnel mode cannot be the same. To ensure correct packet forwarding, identify whether the destination IPv4 network and the IPv4 address of the local tunnel interface are on the same subnet. If not, configure a route reaching the destination IPv4 network through the tunnel interface. You can configure the route by using one of the following methods: Configure a static route, and specify the local tunnel interface as the egress interface or specify the IPv6 address of the peer tunnel interface as the next hop. Enable a dynamic routing protocol on both tunnel interfaces to achieve the same purpose. For more information about route configuration, see Layer 3 IP Routing Configuration Guide. To configure an IPv4 over IPv6 manual tunnel: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter tunnel interface view. 3. Configure an IPv4 address for the tunnel interface. 4. Configure the source address or interface for the tunnel interface. 5. Configure the destination address for the tunnel interface. interface tunnel number [ mode ipv6 ] ip address ip-address { mask mask-length } [ sub ] source { ipv6-address interface-type interface-number } destination ipv6-address N/A By default, no IPv4 address is configured for the tunnel interface. By default, no source address or interface is configured for the tunnel. The specified source address or the primary IPv6 address of the specified source interface is used as the source IPv6 address of tunneled packets. By default, no destination address is configured for the tunnel. The tunnel destination address must be the IPv6 address of the receiving interface on the tunnel peer. It is used as the destination IPv6 address of tunneled packets. 290
304 Configuration example Network requirements As shown in Figure 117, configure an IPv4 over IPv6 manual tunnel between Router A and Router B so the two IPv4 networks can reach each other over the IPv6 network. Figure 117 Network diagram GE2/1/ /24 Router A S2/2/0 2001::1:1/64 Tunnel /24 IPv6 network IPv4 over IPv6 tunnel S2/2/1 2002::2:1/64 Tunnel /24 Router B GE2/1/ /24 IPv4 network 1 IPv4 network 2 Configuration procedure Make sure Router A and Router B can reach each other through IPv6. Configure Router A: # Specify an IPv4 address for GigabitEthernet 2/1/1. <RouterA> system-view [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ip address [RouterA-GigabitEthernet2/1/1] quit # Specify an IPv6 address for Serial 2/2/0, which is the physical interface of the tunnel. [RouterA] interface serial 2/2/0 [RouterA-Serial2/2/0] ipv6 address 2001::1:1 64 [RouterA-Serial2/2/0] quit # Create an IPv6 tunnel interface tunnel 1. [RouterA] interface tunnel 1 mode ipv6 # Specify an IPv4 address for the tunnel interface. [RouterA-Tunnel1] ip address # Specify the IP address of Serial 2/2/0 as the source address for the tunnel interface. [RouterA-Tunnel1] source 2001::1:1 # Specify the IP address of Serial 2/2/1 on Router B as the destination address for the tunnel interface. [RouterA-Tunnel1] destination 2002::2:1 [RouterA-Tunnel1] quit # Configure a static route destined for IPv4 network 2 through the tunnel interface. [RouterA] ip route-static tunnel 1 Configure Router B: # Specify an IPv4 address for GigabitEthernet 2/1/1. <RouterB> system-view [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] ip address
305 [RouterB-GigabitEthernet2/1/1] quit # Specify an IPv6 address for Serial 2/2/1, which is the physical interface of the tunnel. [RouterB] interface serial 2/2/1 [RouterB-Serial2/2/1] ipv6 address 2002::2:1 64 [RouterB-Serial2/2/1] quit # Create an IPv6 tunnel interface tunnel 2. [RouterB] interface tunnel 2 mode ipv6 # Specify an IPv4 address for the tunnel interface. [RouterB-Tunnel2] ip address # Specify the IP address of Serial 2/2/1 as the source address for the tunnel interface. [RouterB-Tunnel2] source 2002::2:1 # Specify the IP address of Serial 2/2/0 on Router A as the destination address for the tunnel interface. [RouterB-Tunnel2] destination 2001::1:1 [RouterB-Tunnel2] quit # Configure a static route destined for IPv4 network 1 through the tunnel interface. [RouterB] ip route-static tunnel 2 Verifying the configuration # Use the display interface tunnel command to display the status of the tunnel interfaces on Router A and Router B. The output shows that the tunnel interfaces are up. (Details not shown.) # Ping the IPv4 address of the peer interface GigabitEthernet 2/1/1 from each router. The following shows the output on Router A. [RouterA] ping -a Ping ( ) from : 56 data bytes, press CTRL_C to break 56 bytes from : icmp_seq=0 ttl=255 time=3.000 ms 56 bytes from : icmp_seq=1 ttl=255 time=1.000 ms 56 bytes from : icmp_seq=2 ttl=255 time=0.000 ms 56 bytes from : icmp_seq=3 ttl=255 time=1.000 ms 56 bytes from : icmp_seq=4 ttl=255 time=1.000 ms --- Ping statistics for packet(s) transmitted, 5 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.000/1.200/3.000/0.980 ms Configuring a DS-Lite tunnel A B4 tunnel interface can establish a tunnel with only one AFTR tunnel interface, but an AFTR tunnel interface can establish tunnels with multiple B4 tunnel interfaces. Follow these guidelines when you configure the B4 router of a DS-Lite tunnel: The source addresses of local tunnels of the same tunnel mode cannot be the same. The destination address specified for the tunnel interface on the B4 router must be the source address specified for the tunnel interface on the AFTR. To ensure correct packet forwarding, identify whether the destination IPv4 network and the IPv4 address of the local tunnel interface are on the same subnet. If not, configure a route reaching the 292
306 destination IPv4 network through the tunnel interface. You can configure the route by using one of the following methods: Configure a static route, and specify the local tunnel interface as the egress interface or specify the IPv6 address of the peer tunnel interface as the next hop. Enable a dynamic routing protocol on both tunnel interfaces to achieve the same purpose. For more information about route configuration, see Layer 3 IP Routing Configuration Guide. Follow these guidelines when you configure the AFTR of a DS-Lite tunnel: The source addresses of local tunnels of the same tunnel mode cannot be the same. Enable NAT on the interface that connects to the public IPv4 interface. The tunnel destination cannot be configured on the AFTR. The AFTR uses the address of the B4 router as the IPv6 address of the tunnel destination. It is not necessary to configure a route to the destination IPv4 address for forwarding packets through the tunnel interface. This section only covers the AFTR configuration. For information about B4 router configuration, see "Configuring an IPv4 over IPv6 manual tunnel." To configure the AFTR of a DS-Lite tunnel: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter the view of the tunnel interface on the AFTR. 3. Specify an IPv4 address for the tunnel interface. 4. Specify the source address or source interface for the tunnel. interface tunnel number [ mode ds-lite-aftr ] ip address ip-address { mask mask-length } [ sub ] source { ipv6-address interface-type interface-number } N/A By default, no IPv4 address is specified for the tunnel interface. By default, no source address or interface is specified for the tunnel. If you specify a source address, it is used as the source address of the encapsulated IPv6 packets. If you specify a source interface, the address of this interface is used as the source address of the encapsulated IPv6 packets. 5. Return to system view. quit N/A 6. Enter the view of the interface that connects the IPv4 public network. 7. Enable DS-Lite tunneling on the interface. interface interface-type interface-number ds-lite enable N/A By default, DS-Lite tunneling is disabled. Only after you use this command, the AFTR can tunnel IPv4 packets from the public IPv4 network to the B4 router. 293
307 Configuration example Network requirements As shown in Figure 118, configure a DS-Lite tunnel between Router A and Router B, and configure NAT on GigabitEthernet 2/1/1 on the AFTR, so hosts in the private IPv4 network can access the public IPv4 network. Figure 118 Network diagram Configuration procedure Make sure Router A and Router B can reach each other through IPv6. Configure Router A: # Specify an IPv4 address for GigabitEthernet 2/1/1. <RouterA> system-view [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ip address [RouterA-GigabitEthernet2/1/1] quit # Specify an IPv6 address for GigabitEthernet 2/1/2, which is the physical interface of the tunnel. [RouterA] interface gigabitethernet 2/1/2 [RouterA-GigabitEthernet2/1/2] ipv6 address 1::1 64 [RouterA-GigabitEthernet2/1/2] quit # Create an IPv6 tunnel interface tunnel1. [RouterA] interface tunnel 1 mode ipv6 # Specify an IPv4 address for the tunnel interface. [RouterA-Tunnel1] ip address # Specify the IP address of GigabitEthernet 2/1/2 as the source address for the tunnel interface. [RouterA-Tunnel1] source 1::1 # Specify IP address of GigabitEthernet 2/1/2 on Router B as the destination address for the tunnel interface. [RouterA-Tunnel1] destination 2::2 [RouterA-Tunnel1] quit # Configure a static route to the public IPv4 network through the tunnel interface. [RouterA] ip route-static tunnel 1 Configure Router B: # Specify an IPv4 address for GigabitEthernet 2/1/1. <RouterB> system-view [RouterB] interface gigabitethernet 2/1/1 294
308 [RouterB-GigabitEthernet2/1/1] ip address [RouterB-GigabitEthernet2/1/1] quit # Specify an IPv6 address for GigabitEthernet 2/1/2, which is the physical interface of the tunnel. [RouterB] interface gigabitethernet 2/1/2 [RouterB-GigabitEthernet2/1/2] ipv6 address 2::2 64 [RouterB-GigabitEthernet2/1/2] quit # Configure a DS-Lite tunnel interface tunnel2. [RouterB] interface tunnel 2 mode ds-lite-aftr # Configure an IPv4 address for the tunnel interface. [RouterB-Tunnel2] ip address # Specify GigabitEthernet 2/1/2 as the source interface of the tunnel interface. [RouterB-Tunnel2] source gigabitethernet 2/1/2 [RouterB-Tunnel2] quit # Enable DS-Lite tunneling on GigabitEthernet 2/1/1. [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] ds-lite enable # Enable NAT on GigabitEthernet 2/1/1 and use the IP address of GigabitEthernet 2/1/1 as the translated address. [RouterB-GigabitEthernet2/1/1] nat outbound [RouterB-GigabitEthernet2/1/1] quit On host A, specify the IP address for the host as and configure a static route to /24 with next hop (Details not shown.) On host B, specify the IP address for the host as (Details not shown.) Verifying the configuration # Use the display interface tunnel command to display the status of the tunnel interfaces on Router A and Router B. The output shows that the tunnel interfaces are up. (Details not shown.) # Ping the IPv4 address of host B from host A. The ping operation succeeds. C:\> ping Pinging with 32 bytes of data: Reply from : bytes=32 time=51ms TTL=255 Reply from : bytes=32 time=44ms TTL=255 Reply from : bytes=32 time=1ms TTL=255 Reply from : bytes=32 time=1ms TTL=255 Ping statistics for : Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 1ms, Maximum = 51ms, Average = 24ms Configuring an IPv6 over IPv6 tunnel Follow these guidelines when you configure an IPv6 over IPv6 tunnel: The destination address specified for the local tunnel interface must be the source address specified for the peer tunnel interface, and vice versa. The source/destination addresses of local tunnels of the same tunnel mode cannot be the same. 295
309 The IPv6 address of the tunnel interface must not be on the same subnet as the destination address configured for the tunnel interface. To ensure correct packet forwarding, identify whether the destination IPv6 network and the IPv6 address of the local tunnel interface are on the same subnet. If not, configure a route reaching the destination IPv6 network through the tunnel interface. You can configure the route by using one of the following methods: Configure a static route, and specify the local tunnel interface as the egress interface or specify the IPv6 address of the peer tunnel interface as the next hop. Enable a dynamic routing protocol on both tunnel interfaces to achieve the same purpose. For more information about route configuration, see Layer 3 IP Routing Configuration Guide. The destination address of the route passing the tunnel interface must not be on the same subnet as the destination address configured for the tunnel interface. To configure an IPv6 over IPv6 tunnel: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter IPv6 tunnel interface view. 3. Configure an IPv6 address for the tunnel interface. 4. Configure the source address or source interface for the tunnel interface. 5. Configure the destination address for the tunnel interface. 6. (Optional.) Configure the maximum number of nested encapsulations of a packet. interface tunnel number [ mode ipv6 ] For configuration details, see "Configuring basic IPv6 settings." source { ipv6-address interface-type interface-number } destination ipv6-address encapsulation-limit number N/A No IPv6 address is configured for the tunnel interface by default. By default, no source address or interface is configured for the tunnel. The specified source address or the IPv6 address of the specified source interface is used as the source IPv6 address of tunneled packets. By default, no destination address is configured for the tunnel. The tunnel destination address must be the IPv6 address of the receiving interface on the tunnel peer. It is used as the destination IPv6 address of tunneled packets. By default, there is no limit to the nested encapsulations of a packet. 7. Return to system view. quit N/A 8. (Optional.) Enable dropping of IPv6 packets using IPv4-compatible IPv6 addresses. tunnel discard ipv4-compatible-packet The default setting is disabled. 296
310 Configuration example Network requirements As shown in Figure 119, configure an IPv6 over IPv6 tunnel between Router A and Router B so the two IPv6 networks can reach each other without disclosing their IPv6 addresses. Figure 119 Network diagram Configuration procedure Make sure Router A and Router B can reach each other through IPv6. Configure Router A: # Specify an IPv6 address for GigabitEthernet 2/1/1. <RouterA> system-view [RouterA] interface gigabitethernet 2/1/1 [RouterA-GigabitEthernet2/1/1] ipv6 address 2002:1::1 64 [RouterA-GigabitEthernet2/1/1] quit # Specify an IPv6 address for Serial 2/2/0, which is the physical interface of the tunnel. [RouterA] interface serial 2/2/0 [RouterA-Serial2/2/0] ipv6 address 2001::11:1 64 [RouterA-Serial2/2/0] quit # Create an IPv6 tunnel interface tunnel 1. [RouterA] interface tunnel 1 mode ipv6 # Specify an IPv6 address for the tunnel interface. [RouterA-Tunnel1] ipv6 address 3001::1:1 64 # Specify the IP address of Serial 2/2/0 as the source address for the tunnel interface. [RouterA-Tunnel1] source 2001::11:1 # Specify the IP address of Serial 2/2/1 on Router B as the destination address for the tunnel interface. [RouterA-Tunnel1] destination 2002::22:1 [RouterA-Tunnel1] quit # Configure a static route destined for the IPv6 network group 2 through the tunnel interface. [RouterA] ipv6 route-static 2002:3:: 64 tunnel 1 Configure Router B: # Specify an IPv6 address for GigabitEthernet 2/1/1. <RouterB> system-view [RouterB] interface gigabitethernet 2/1/1 [RouterB-GigabitEthernet2/1/1] ipv6 address 2002:3::
311 [RouterB-GigabitEthernet2/1/1] quit # Specify an IPv6 address for Serial 2/2/1, which is the physical interface of the tunnel. [RouterB] interface serial 2/2/1 [RouterB-Serial2/2/1] ipv6 address 2002::22:1 64 [RouterB-Serial2/2/1] quit # Create an IPv6 tunnel interface tunnel 2. [RouterB] interface tunnel 2 mode ipv6 # Specify an IPv6 address for the tunnel interface. [RouterB-Tunnel2] ipv6 address 3001::1:2 64 # Specify the IP address of Serial 2/2/1 as the source address for the tunnel interface. [RouterB-Tunnel2] source 2002::22:1 # Specify the IP address of Serial 2/2/0 on Router A as the destination address for the tunnel interface. [RouterB-Tunnel2] destination 2001::11:1 [RouterB-Tunnel2] quit # Configure a static route destined for the IPv6 network group 1 through the tunnel interface. [RouterB] ipv6 route-static 2002:1:: 64 tunnel 2 Verifying the configuration # Use the display ipv6 interface command to display the status of the tunnel interfaces on Router A and Router B. The output shows that the tunnel interfaces are up. (Details not shown.) # Ping the IPv6 address of the peer interface GigabitEthernet 2/1/1 from each router. The following shows the output on Router A. [RouterA] ping ipv6 -a 2002:1::1 2002:3::1 Ping6(56 data bytes) 2002:1::1 --> 2002:3::1, press CTRL_C to break 56 bytes from 2002:3::1, icmp_seq=0 hlim=64 time=0.000 ms 56 bytes from 2002:3::1, icmp_seq=1 hlim=64 time=0.000 ms 56 bytes from 2002:3::1, icmp_seq=2 hlim=64 time=0.000 ms 56 bytes from 2002:3::1, icmp_seq=3 hlim=64 time=0.000 ms 56 bytes from 2002:3::1, icmp_seq=4 hlim=64 time=0.000 ms --- Ping6 statistics for 2002:3:: packet(s) transmitted, 5 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.000/0.000/0.000/0.000 ms Displaying and maintaining tunneling configuration Execute display commands in any view and reset commands in user view. Task Display information about tunnel interfaces. Command display interface [ tunnel [ number ] ] [ brief [ description down ] ] Display IPv6 information on tunnel interfaces. display ipv6 interface [ tunnel [ number ] ] [ brief ] Clear statistics on tunnel interfaces. reset counters interface [ tunnel [ number ] ] 298
312 For more information about the display ipv6 interface command, see Layer 3 IP Services Command Reference. Troubleshooting tunneling configuration Symptom Analysis Solution A tunnel interface configured with related parameters such as tunnel source address, tunnel destination address, and tunnel mode cannot go up. The physical interface of the tunnel does not go up, or the tunnel destination is unreachable. 1. Perform the following tasks to resolve the problem: Use the display interface or display ipv6 interface command to check whether the physical interface of the tunnel is up. If the physical interface is down, check the network connection. Use the display ipv6 routing-table or display ip routing-table command to check whether the tunnel destination is reachable. If the route is not available, configure a route to reach the tunnel destination. 2. If the problem persists, contact HP Support. 299
313 Configuring GRE Overview Generic Routing Encapsulation (GRE) is a tunneling protocol that can encapsulate any network layer protocol (such as IPv6) into a virtual point-to-point tunnel over an IP network (such as an IPv4 network). Packets are encapsulated at one tunnel end and de-encapsulated at the other tunnel end. The network layer protocol of the packets before encapsulation and after encapsulation can be the same or different. GRE encapsulation format Figure 120 GRE encapsulation format As shown in Figure 120, a GRE-tunneled packet includes the following parts: Payload packet Original packet. The protocol type of the payload packet is called the passenger protocol. The passenger protocol can be any network layer protocol. GRE header Header that is added to the payload packet to change the payload packet to a GRE packet. A GRE header includes the number of encapsulations, version, passenger protocol type, checksum, and key. GRE is called the encapsulation protocol. Delivery header Header that is added to the GRE packet to deliver it to the tunnel end. The transport protocol (or deliver protocol) is the network layer protocol that transfers GRE packets. The device supports IPv4 and IPv6 as the transport protocols. When the transport protocol is IPv4, the GRE tunnel is called the "GRE over IPv4 tunnel." When the transport protocol is IPv6, the GRE tunnel is called the "GRE over IPv6 tunnel." 300
314 GRE tunnel operating principle Figure 121 IPv6 networks interconnected through a GRE tunnel As shown in Figure 121, an IPv6 protocol packet traverses an IPv4 network through a GRE tunnel as follows: 1. After receiving an IPv6 packet from the interface connected to IPv6 network 1, Device A processes the packet as follows: a. Looks up the routing table to identify the outgoing interface for the IPv6 packet. b. Submits the IPv6 packet to the outgoing interface the GRE tunnel interface Tunnel Upon receiving the packet, the tunnel interface encapsulates the packet with GRE and then with IPv4. In the IPv4 header: The source address is the tunnel's source address (the IP address of interface GigabitEthernet 1/0/1 of Device A). The destination address is the tunnel's destination address (the IP address of interface GigabitEthernet 1/0/1 of Device B). 3. Device A looks up the routing table according to the destination address in the IPv4 header, and forwards the IPv4 packet out of the physical interface (GigabitEthernet 1/0/1) of the GRE tunnel. 4. When the IPv4 arrives at the GRE tunnel destination Device B, Device B checks the destination address. Because the destination is Device B itself and the protocol number in the IP header is 47 (the protocol number for GRE), Device B submits the packet to GRE for de-encapsulation. 5. GRE first removes the IPv4 header, and then checks the GRE key, checksum, and packet sequence number. After GRE finishes the checking, it removes the GRE header, and submits the payload to the IPv6 protocol for forwarding. NOTE: GRE encapsulation and de-encapsulation can decrease the forwarding efficiency of tunnel-end devices. GRE security mechanisms GRE supports the following security mechanisms: GRE key Ensures packet validity. The sender adds a GRE key into a packet. The receiver compares the GRE key with its own GRE key. If the two keys are the same, the receiver accepts the packet. Otherwise, it drops the packet. GRE checksum Ensures packet integrity. The sender calculates a checksum for the GRE header and payload and sends the packet containing the checksum to the tunnel peer. The receiver 301
315 calculates a checksum for the received packet and compares it with that carried in the packet. If the checksums are the same, the receiver considers the packet intact and continues to process the packet. Otherwise, the receiver discards the packet. GRE application scenarios The following shows typical GRE application scenarios: Connecting networks running different protocols over a single backbone Figure 122 Network diagram IPv6 network 1 IPv6 network 2 Device A Internet GRE tunnel Device B IPv4 network 1 IPv4 network 2 As shown in Figure 122, IPv6 network 1 and IPv6 network 2 are IPv6 networks, and IPv4 network 1 and IPv4 network 2 are IPv4 networks. Through the GRE tunnel between Device A and Device B, IPv6 network 1 can communicate with IPv6 network 2 and IPv4 network 1 can communicate with IPv4 network 2, without affecting each other. Enlarging network scope Figure 123 Network diagram Device A Device D GRE tunnel IP network IP network Host A Device B Device C Host B IP network In an IP network, the maximum TTL value of a packet is 255. If two devices have more than 255 hops in between, they cannot communicate with each other. By using a GRE tunnel, you can hide some hops to enlarge the network scope. As shown in Figure 123, only the tunnel-end devices (Device A and Device D) of the GRE tunnel are counted in hop count calculation. Therefore, there are only three hops between Host A and Host B. 302
316 Constructing VPN Figure 124 Network diagram As shown in Figure 124, Site 1 and Site 2 both belong to VPN 1 and are located in different cities. Using a GRE tunnel can connect the two VPN sites across the WAN. Operating with IPsec Figure 125 Network diagram As shown in Figure 125, GRE can be used together with IPsec to form a GRE over IPsec tunnel. Packets (for example, routing protocol packets, voice data, and video data) are first encapsulated with GRE and then with IPsec. GRE over IPsec delivers the following benefits: Improves transmission security. Allows IPsec to protect not only unicast packets. GRE supports encapsulating multicast, broadcast, and non-ip packets. After GRE encapsulation, these packets become common unicast packets, which can be protected by IPsec. Simplifies IPsec configuration. Packets are first encapsulated by GRE. You can define the packets to be protected by IPsec according to the GRE tunnel's source and destination addresses, without considering the source and destination addresses of the original packets. GRE and IPsec can also form IPsec over GRE tunnels. HP recommends that you use GRE over IPsec tunnels instead of IPsec over GRE tunnels. For more information about IPsec, see Security Configuration Guide. Protocols and standards RFC 1701, Generic Routing Encapsulation (GRE) RFC 1702, Generic Routing Encapsulation over IPv4 networks RFC 2784, Generic Routing Encapsulation (GRE) 303
317 RFC 2890, Key and Sequence Number Extensions to GRE Configuring a GRE over IPv4 tunnel Follow these guidelines when you configure a GRE over IPv4 tunnel: You must configure the tunnel source address and destination address at both ends of a tunnel. The tunnel source or destination address at one end must be the tunnel destination or source address at the other end. HP recommends not configuring the same tunnel source and destination addresses for local tunnel interfaces that use the same tunnel mode. You can enable or disable the GRE checksum function at each end of a tunnel. If GRE checksum is enabled at a tunnel end, the tunnel end sends packets carrying the checksum to the peer end. A tunnel end checks the GRE checksum of a received packet if the packet carries a GRE checksum, whether or not the tunnel end is enabled with the GRE checksum function. To ensure correct packet forwarding, identify whether the destination network of packets and the IP address of the local tunnel interface are on the same subnet. If not, configure a route reaching the destination network through the tunnel interface. You can configure the route by using one of the following methods: Configure a static route, using the local tunnel interface as the outgoing interface of the route. Enable a dynamic routing protocol on both the tunnel interface and the interface connecting the private network. This allows the dynamic routing protocol to establish a routing entry with the tunnel interface as the outgoing interface. The IP address of the tunnel interface and the tunnel destination address configured on the tunnel interface must be in different subnets. For information about tunnel interfaces, and the interface tunnel, source, destination, tunnel dfbit enable, and tunnel discard ipv4-compatible-packet commands, see "Configuring tunneling." To configure a GRE over IPv4 tunnel: Step Command Remarks 1. Enter system view. system-view N/A 2. Create a GRE over IPv4 tunnel interface and enter its view. 3. Configure an IPv4 or IPv6 address for the tunnel interface. interface tunnel interface-number mode gre For information about how to assign an IPv4 address to an interface, see "Configuring IP addressing." For information about how to assign an IPv6 address to an interface, see "Configuring basic IPv6 settings." By default, the device has no tunnel interface. You must configure the same tunnel mode on both ends of a tunnel. Otherwise, packet delivery might fail. By default, no IPv4 or IPv6 address is configured for a tunnel interface. When the passenger protocol is IPv4, configure an IPv4 address for the tunnel interface. When the passenger protocol is IPv6, configure an IPv6 address for the tunnel interface. 304
318 Step Command Remarks 4. Configure a source address or source interface for the tunnel interface. 5. Configure a destination address for the tunnel interface. 6. (Optional.) Enable the GRE checksum function. 7. (Optional.) Configure a GRE key for the GRE tunnel interface. source { ip-address interface-type interface-number } destination ip-address gre checksum gre key key-number By default, no source address or interface is configured for a tunnel interface. If you configure a source address for a tunnel interface, the tunnel interface uses the source address as the source address of the encapsulated packets. If you configure a source interface for a tunnel interface, the tunnel interface uses the primary IP address of the source interface as the source address of the encapsulated packets. By default, no destination address is configured for a tunnel interface. The destination address is the address of the physical interface that the tunnel remote end uses to receive packets from the GRE tunnel. The tunnel local end uses this address as the destination address of the encapsulated packets. By default, GRE checksum is disabled. By default, no GRE key is configured for a GRE tunnel interface. The two ends of a GRE tunnel must have the same key or both have no key. 8. (Optional.) Set the DF bit for encapsulated packets. tunnel dfbit enable By default, the DF bit is not set, allowing encapsulated packets to be fragmented. 9. Return to system view. quit N/A 10. (Optional.) Configure the device to discard IPv6 packets with IPv4-compatible IPv6 addresses. tunnel discard ipv4-compatible-packet By default, the device does not discard such IPv6 packets. 305
319 Configuring a GRE over IPv6 tunnel Follow these guidelines when you configure a GRE over IPv6 tunnel: You must configure the tunnel source address and destination address at both ends of a tunnel. The tunnel source or destination address at one end must be the tunnel destination or source address at the other end. HP recommends not configuring the same tunnel source and destination addresses for local tunnel interfaces that use the same tunnel mode. You can enable or disable the GRE checksum function at each end of a tunnel. If GRE checksum is enabled at a tunnel end, the tunnel end sends packets carrying the checksum to the peer end. A tunnel end checks the GRE checksum of a received packet if the packet carries a GRE checksum, whether or not the tunnel end is enabled with the GRE checksum function or not. To ensure correct packet forwarding, identify whether the destination network of packets and the IP address of the local tunnel interface are on the same subnet. If not, configure a route reaching the destination network through the tunnel interface. You can configure the route by using the following methods: Configure a static route, using the local tunnel interface as the outgoing interface of the route. Enable a dynamic routing protocol on both the tunnel interface and the interface connecting the private network. This allows the dynamic routing protocol to establish a routing entry with the tunnel interface as the outgoing interface. The IP address of the tunnel interface and the tunnel destination address configured on the tunnel interface must be in different subnets. For information about tunnel interfaces, the interface tunnel, source, destination, and tunnel discard ipv4-compatible-packet commands, and additional configuration commands on a tunnel interface, see "Configuring tunneling." To configure a GRE over IPv6 tunnel: Step Command Remarks 1. Enter system view. system-view N/A 2. Create a GRE over IPv6 tunnel interface and enter its view. 3. Configure an IPv4 or IPv6 address for the tunnel interface. interface tunnel interface-number mode gre ipv6 For information about how to assign an IPv4 address to an interface, see "Configuring IP addressing." For information about how to assign an IPv6 address to an interface, see "Configuring basic IPv6 settings." By default, the device has no tunnel interface. You must configure the same tunnel mode on both ends of a tunnel. Otherwise, packet delivery might fail. By default, no IPv4 or IPv6 address is configured for a tunnel interface. When the passenger protocol is IPv4, configure an IPv4 address for the tunnel interface. When the passenger protocol is IPv6, configure an IPv6 address for the tunnel interface. 306
320 Step Command Remarks 4. Configure a source IPv6 address or source interface for the tunnel interface. 5. Configure a destination IPv6 address for the tunnel interface. 6. (Optional.) Enable the GRE checksum function. 7. (Optional.) Configure a GRE key for the tunnel interface. source { ipv6-address interface-type interface-number } destination ipv6-address gre checksum gre key key-number By default, no source IPv6 address or interface is configured for a tunnel interface. If you configure a source IPv6 address for a tunnel interface, the tunnel interface uses the source IPv6 address as the source IPv6 address of the encapsulated packets. If you configure a source interface for a tunnel interface, the tunnel interface uses the IPv6 address of the source interface as the source IPv6 address of the encapsulated packets. By default, no destination IPv6 address is configured for a tunnel interface. The destination IPv6 address is the IPv6 address of the physical interface that the tunnel remote end uses to receive packets from the GRE tunnel. The tunnel local end uses this address as the destination IPv6 address of the encapsulated packets. By default, GRE checksum is disabled. By default, no GRE key is configured for a GRE tunnel interface. The two ends of a GRE tunnel must have the same key or both have no key. 8. Return to system view. quit N/A 9. (Optional.) Configure the device to discard IPv6 packets with IPv4-compatible IPv6 addresses tunnel discard ipv4-compatible-packet By default, the device does not discard such IPv6 packets. Displaying and maintaining GRE Execute display commands in any view and the reset command in user view. For more information about the commands, see Layer 3 IP Services Command Reference. 307
321 Task Display information about tunnel interfaces. Command display interface [ tunnel [ number ] ] [ brief [ description down ] ] Display IPv6 information about tunnel interfaces. display ipv6 interface [ tunnel [ number ] ] [ brief ] Clear tunnel interface statistics. reset counters interface [ tunnel [ number ] ] GRE configuration examples GRE over IPv4 tunnel configuration example Network requirements Group 1 and Group 2 are two private IPv4 networks. The two networks both use private network addresses and belong to the same VPN. Establish a GRE tunnel between Router A and Router B to interconnect the two private IPv4 networks Group 1 and Group 2. Figure 126 Network diagram Configuration procedure Make sure Router A and Router B can reach each other. 1. Configure Router A: # Configure IP addresses for interfaces. (Details not shown.) # Create a tunnel interface Tunnel 0, and specify the tunnel mode as GRE over IPv4. <RouterA> system-view [RouterA] interface tunnel 0 mode gre # Configure an IP address for the tunnel interface. [RouterA-Tunnel0] ip address # Configure the source address of the tunnel interface as the IP address of GigabitEthernet 2/1/2 on Router A. [RouterA-Tunnel0] source # Configure the destination address of the tunnel interface as the IP address of GigabitEthernet 2/1/2 on Router B. [RouterA-Tunnel0] destination [RouterA-Tunnel0] quit # Configure a static route from Router A through the tunnel interface to Group 2. [RouterA] ip route-static tunnel 0 2. Configure Router B: # Configure IP addresses for interfaces. (Details not shown.) 308
322 # Create tunnel interface Tunnel 0 and specify the tunnel mode as GRE over IPv4. <RouterB> system-view [RouterB] interface tunnel 0 mode gre # Configure an IP address for the tunnel interface. [RouterB-Tunnel0] ip address # Configure the source address of the tunnel interface as the IP address of interface GigabitEthernet 2/1/2 on Router B. [RouterB-Tunnel0] source # Configure the destination address of the tunnel interface as the IP address of the interface GigabitEthernet 2/1/2 on Router A. [RouterB-Tunnel0] destination [RouterB-Tunnel0] quit # Configure a static route from Router B through the tunnel interface to Group 1. [RouterB] ip route-static tunnel 0 Verifying the configuration # Display tunnel interface information on Router A. [RouterA] display interface tunnel 0 Tunnel0 Current state: UP Line protocol state: UP Description: Tunnel0 Interface Bandwidth: 64kbps Maximum Transmit Unit: 1476 Internet Address is /24 Primary Tunnel source , destination Tunnel keepalive disabled Tunnel TTL 255 Tunnel protocol/transport GRE/IP GRE key disabled Checksumming of GRE packets disabled Output queue - Urgent queuing: Size/Length/Discards 0/100/0 Output queue - Protocol queuing: Size/Length/Discards 0/500/0 Output queue - FIFO queuing: Size/Length/Discards 0/75/0 Last clearing of counters: Never Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec Input: 0 packets, 0 bytes, 0 drops Output: 0 packets, 0 bytes, 0 drops # Display tunnel interface information on Router B. [RouterB] display interface tunnel 0 Tunnel0 Current state: UP Line protocol state: UP Description: Tunnel0 Interface Bandwidth: 64kbps Maximum Transmit Unit:
323 Internet Address is /24 Primary Tunnel source , destination Tunnel keepalive disabled Tunnel TTL 255 Tunnel protocol/transport GRE/IP GRE key disabled Checksumming of GRE packets disabled Output queue - Urgent queuing: Size/Length/Discards 0/100/0 Output queue - Protocol queuing: Size/Length/Discards 0/500/0 Output queue - FIFO queuing: Size/Length/Discards 0/75/0 Last clearing of counters: Never Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec Input: 0 packets, 0 bytes, 0 drops Output: 0 packets, 0 bytes, 0 drops # From Router B, ping the IP address of GigabitEthernet 2/1/1 on Router A. [RouterB] ping -a Ping ( ) from : 56 data bytes, press CTRL_C to break 56 bytes from : icmp_seq=0 ttl=255 time= ms 56 bytes from : icmp_seq=1 ttl=255 time=1.000 ms 56 bytes from : icmp_seq=2 ttl=255 time=0.000 ms 56 bytes from : icmp_seq=3 ttl=255 time=0.000 ms 56 bytes from : icmp_seq=4 ttl=255 time=0.000 ms --- Ping statistics for packet(s) transmitted, 5 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.000/2.400/11.000/4.317 ms The output shows that Router B can successfully ping Router A. GRE over IPv6 tunnel configuration example Network requirements Two IPv4 subnets Group 1 and Group 2 are connected to an IPv6 network. Create a GRE over IPv6 tunnel between Router A and Router B, so the two IPv4 subnets can communicate with each other through the GRE tunnel over the IPv6 network. Figure 127 Network diagram Configuration procedure Make sure Router A and Router B can reach each other. 1. Configure Router A: 310
324 # Configure IP addresses for interfaces. (Details not shown.) # Create a tunnel interface Tunnel 0, and specify the tunnel mode as GRE over IPv6. <RouterA> system-view [RouterA] interface tunnel 0 mode gre ipv6 # Configure an IP address for the tunnel interface. [RouterA-Tunnel0] ip address # Configure the source address of the tunnel interface as the IP address of interface GigabitEthernet 2/1/2 on Router A. [RouterA-Tunnel0] source 2002::1:1 # Configure the destination address of the tunnel interface as the IP address of interface GigabitEthernet 2/1/2 on Router B. [RouterA-Tunnel0] destination 2001::2:1 [RouterA-Tunnel0] quit # Configure a static route from Router A through the tunnel interface to Group 2. [RouterA] ip route-static tunnel 0 2. Configure Router B: # Configure IP addresses for interfaces. (Details not shown.) # Create a tunnel interface Tunnel 0, and specify the tunnel mode as GRE over IPv6. <RouterB> system-view [RouterB] interface tunnel 0 mode gre ipv6 # Configure an IP address for the tunnel interface. [RouterB-Tunnel0] ip address # Configure the source address of the tunnel interface as the IP address of interface GigabitEthernet 2/1/2 on Router B. [RouterB-Tunnel0] source 2001::2:1 # Configure the destination address of the tunnel interface as the IP address of interface GigabitEthernet 2/1/2 on Router A. [RouterB-Tunnel0] destination 2002::1:1 [RouterB-Tunnel0] quit # Configure a static route from Router B through the tunnel interface to Group 1. [RouterB] ip route-static tunnel 0 Verifying the configuration # Display tunnel interface information on Router A. [RouterA] display interface tunnel 0 Tunnel0 Current state: UP Line protocol state: UP Description: Tunnel0 Interface Bandwidth: 64kbps Maximum Transmit Unit: 1456 Internet Address is /24 Primary Tunnel source 2002::1:1, destination 2001::2:1 Tunnel TTL 255 Tunnel protocol/transport GRE/IPv6 GRE key disabled 311
325 Checksumming of GRE packets disabled Output queue - Urgent queuing: Size/Length/Discards 0/100/0 Output queue - Protocol queuing: Size/Length/Discards 0/500/0 Output queue - FIFO queuing: Size/Length/Discards 0/75/0 Last clearing of counters: Never Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec Input: 0 packets, 0 bytes, 0 drops Output: 0 packets, 0 bytes, 0 drops # Display tunnel interface information on Router B. [RouterB] display interface tunnel 0 Tunnel0 Current state: UP Line protocol state: UP Description: Tunnel0 Interface Bandwidth: 64kbps Maximum Transmit Unit: 1456 Internet Address is /24 Primary Tunnel source 2002::2:1, destination 2001::1:1 Tunnel TTL 255 Tunnel protocol/transport GRE/IPv6 GRE key disabled Checksumming of GRE packets disabled Output queue - Urgent queuing: Size/Length/Discards 0/100/0 Output queue - Protocol queuing: Size/Length/Discards 0/500/0 Output queue - FIFO queuing: Size/Length/Discards 0/75/0 Last clearing of counters: Never Last 300 seconds input rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec Input: 0 packets, 0 bytes, 0 drops Output: 0 packets, 0 bytes, 0 drops # From Router B, ping the IP address of interface GigabitEthernet 2/1/1 on Router A. [RouterB] ping -a Ping ( ) from : 56 data bytes, press CTRL_C to break 56 bytes from : icmp_seq=0 ttl=255 time=2.000 ms 56 bytes from : icmp_seq=1 ttl=255 time=1.000 ms 56 bytes from : icmp_seq=2 ttl=255 time=1.000 ms 56 bytes from : icmp_seq=3 ttl=255 time=0.000 ms 56 bytes from : icmp_seq=4 ttl=255 time=1.000 ms --- Ping statistics for packet(s) transmitted, 5 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.000/1.000/2.000/0.632 ms The output shows that Router B can successfully ping Router A. 312
326 Troubleshooting GRE The key to configuring GRE is to keep the configuration consistent. Most faults can be located by using the debugging gre or debugging tunnel command. This section analyzes one type of fault for illustration, with the scenario shown in Figure 128. Figure 128 Network diagram Symptom Analysis Solution The interfaces at both ends of the tunnel are configured correctly and can ping each other, but Host A and Host B cannot ping each other. It might be because that Device A or Device C has no route to reach the peer network. 1. Execute the display ip routing-table command on Device A and Device C to view whether Device A has a route over tunnel 0 to /16 and whether Device C has a route over tunnel 0 to / If such a route does not exist, execute the ip route-static command in system view to add the route. Take Device A as an example: [DeviceA] ip route-static tunnel 0 313
327 Configuring ADVPN Overview Auto Discovery Virtual Private Network (ADVPN) enables enterprise branches that use dynamic public addresses to establish a VPN network. ADVPN uses the VPN Address Management (VAM) protocol to collect, maintain, and distribute dynamic public addresses. VAM uses the client/server model. All VAM clients register their public addresses on the VAM server. A VAM client obtains the public addresses of other clients from the server to establish ADVPN tunnels. ADVPN structures ADVPN uses domains to identify VPNs. VAM clients in a VPN must be assigned to the same ADVPN domain. A VAM client can belong to only one ADVPN domain. A VAM server can serve multiple ADVPN domains and manage their clients. VAM clients include hubs and spokes: Hub A hub is the exchange center of routing information. A hub in a hub-spoke network is also a data forwarding center. Spoke A spoke is the gateway of a branch. It does not forward data received from other ADVPN nodes. ADVPN supports full-mesh, hub-spoke, and hub-group structures: Full-mesh In a full mesh ADVPN, spokes can directly communicate with each other. The hub acts as the route exchange center. As shown in Figure 129, the spokes register with the VAM server and get the hub information in the ADVPN domain. Then, they establish permanent tunnels to the hub. Any two spokes can establish a dynamic tunnel to directly exchange data. The tunnel is deleted if no data exits during the idle timeout time. 314
328 Figure 129 Full mesh ADVPN Hub-spoke In a hub-spoke ADVPN, spokes communicate with each other through the hub. The hub acts as both the route exchange center and data forwarding center. As shown in Figure 130, each spoke establishes a permanent tunnel to the hub. Spokes communicate with each other through the hub. Figure 130 Hub-spoke ADVPN Hub-group A hub-group ADVPN can accommodate more ADVPN clients. This structure solves the problem that one hub cannot manage all clients, for example, because of a routing protocol's limit to neighbors. As shown in Figure 131, a hub-group ADVPN contains multiple hub groups. Each hub group has one or multiple hubs and spokes. Use the following guidelines to classify hub groups: 315
329 All hubs must belong to the backbone hub group. This hub group forms the full-mesh backbone area. All hubs obtain information about other hubs from the VAM server and establish permanent ADVPN tunnels to each other. Spokes must belong to non-backbone hub groups. Each non-backbone hub group includes at least one hub and uses either the full-mesh or hub-spoke structure. Spokes obtain hub information in the ADVPN domain from the VAM server, and establish permanent tunnels to the hub. Tunnel establishment and data forwarding in a hub group depend on the network structure. Inter-group communications between spokes need to pass the hubs of the groups. To reduce the pressure on hubs during inter-group communications, you can allow spokes in different hub groups to establish a dynamic tunnel. The dynamic tunnel is deleted if no data exists during the idle-timeout time. Figure 131 Hub-group ADVPN Hub1 Tunnel 2 Tunnel 2 Tunnel 2 Hub3 Group 0 Tunnel 1 Hub2 Tunnel 1 Tunnel 1 VAM server Spoke1 Tunnel 1 Tunnel 1 Tunnel 1 Group 1 Spoke2 Group 2 Spoke3 Tunnel 1 Spoke4 Site 1 Site 2 Site 3 Site 4 Site 5 Site 6 Hub-to-Hub static tunnel Hub-to-Spoke static tunnel Spoke-to-Spoke dynamic tunnel in one group Spoke-to-Spoke dynamic tunnel between two groups How ADVPN operates The VAM server must have a static public address. VAM clients have both a public address and a private address. The public address is the address of the interface that connects to the public network. It can be manually configured or dynamically assigned. The private address is the address of the ADVPN tunnel interface. It must be manually configured. All the private addresses of clients in an ADVPN domain must belong to the same network segment. ADVPN operates in three phases: connection initialization, registration, and tunnel establishment. Connection initialization As shown in Figure 132, a client and a server take the following steps to initialize a connection: 316
330 1. The client sends encryption and authentication algorithms to the server in a connection request. 2. The server compares the algorithm list of the client to its own algorithm list in priority order. 3. The server sends the matching algorithms to the client. If no match is found, the negotiation fails. 4. The server and the client generate encryption and authentication keys based on the pre-shared key. If authentication and encryption are not needed, they do not generate keys. 5. The server and the client exchange negotiation acknowledgment packets protected by using the keys. 6. The server and the client use the keys to protect subsequent traffic if they can restore the protected negotiation acknowledgment packets. If they cannot restore the packets, the negotiation fails. Figure 132 Initialization process Registration phase Figure 133 shows the registration process: 1. The client sends a registration request that includes its public and private addresses to the server. 2. The server sends the client an identity authentication request that specifies the authentication algorithm. If authentication is not required, the server directly registers the client and sends the client a registration acknowledgement. VAM supports both PAP and CHAP authentication. 3. The client submits its identity information to the server. 4. The server performs authentication and accounting for the client through the AAA server. 5. The server sends a registration acknowledgement that includes the hub information to the client. Figure 133 Registration process Client Server 1) Registration request 2) Identity authentication request 3) Identity information 4) Registration acknowledgement 317
331 Tunnel establishment phase A spoke can establish permanent tunnels to any number of hubs. Hubs in an ADVPN domain must establish permanent tunnels. Figure 134 Tunnel establishment process Figure 134 shows the tunnel establishment process: 1. The initiator originates a tunnel establishment request. To establish a hub-spoke tunnel: The spoke checks whether a tunnel to each hub exists. If not, the spoke sends a tunnel establishment request to the hub. To establish a hub-hub tunnel: The hub checks whether a tunnel to each peer hub exists. If not, the hub sends a tunnel establishment request to the peer hub. To establish a spoke-spoke tunnel: In a full mesh network, when a spoke receives a data packet but finds no tunnel for forwarding the packet, it sends an address resolution request to the server and then, after receiving the resolved address, sends a tunnel establishment request to the peer spoke. 2. The receiver saves tunnel information in the request and sends a response to the sender. Route learning and packet forwarding Static or dynamic routing must be configured for private networks and ADVPN tunnel interfaces to achieve connectivity among private networks. A dynamic routing protocol discovers neighbors, updates routes, and establishes a routing table over ADVPN tunnels. From the perspective of private networks, ADVPN tunnels are common private links that connect different private networks. The routing protocol exchanges routes between hub and hub, and between hub and spoke. It does not directly exchange routes between spoke and spoke. When a spoke receives a packet destined to a remote private network, it performs the following steps to forward the packet: 1. Finds the private next hop from the routing table. 2. Uses the private next hop to obtain the corresponding public address from the VAM server. 3. Sends the packet to the public address over the ADVPN tunnel. Full-mesh and hub-spoke structures are determined by routing. If the next hop is a spoke, the structure is full-mesh. If the next hop is a hub, the structure is hub-spoke. 318
332 Figure 135 shows the format of ADVPN packets. ADVPN supports both GRE and UDP encapsulations. In the outer IP header, the source IP address is the public address of the local spoke, and the destination address is the public address corresponding to the private next hop. IPsec can be used to protect ADVPN tunnels. Figure 135 ADVPN packet format An ADVPN tunnel using UDP encapsulation can traverse a NAT gateway: If only the tunnel initiator resides behind a NAT gateway, a spoke-spoke tunnel can be established through the NAT gateway. If the tunnel receiver is behind a NAT gateway, packets must be forwarded by a hub before the receiver originates a tunnel establishment request. If the NAT gateway uses Endpoint-Independent Mapping, a spoke-spoke tunnel can be established through the NAT gateway. If both ends reside behind a NAT gateway, no tunnel can be established and packets between them must be forwarded by a hub. ADVPN configuration task list Tasks at a glance (Optional.) Configuring AAA (Required.) Configuring the VAM server (Required.) Configuring the VAM client (Required.) Configuring an ADVPN tunnel interface (Required.) Configuring routing (Optional.) Configuring IPsec for ADVPN tunnels Configuring AAA The VAM server can use AAA to authenticate clients. Clients passing AAA authentication can access the ADVPN domain. For information about AAA configuration, see Security Configuration Guide. Configuring the VAM server Task (Required.) Creating an ADVPN domain (Required.) Enabling the VAM server (Required.) Configuring a pre-shared key for the VAM server (Required.) Configuring hub groups (Optional.) Configuring the port number of the VAM server 319
333 Task (Optional.) Specifying authentication and encryption algorithms for the VAM server (Optional.) Configuring an authentication method (Optional.) Configuring keepalive parameters (Optional.) Configuring the retry timer Creating an ADVPN domain Specify a unique ID for an ADVPN domain. To create an ADVPN domain: Step Command Remarks 1. Enter system view. system-view N/A 2. Create an ADVPN domain and enter ADVPN domain view. vam server advpn-domain domain-name [ id domain-id ] By default, no ADVPN domain exists. Enabling the VAM server Step Command Remarks 1. Enter system view. system-view N/A 2. Enable the VAM server. Enable the VAM server for one or all ADVPN domains: vam server enable { all advpn-domain domain-name } Enable VAM server for an ADVPN domain: a. vam server advpn-domain domain-name [ id domain-id ] b. server enable Use either command. By default, the VAM server is disabled. Configuring a pre-shared key for the VAM server The pre-shared key is used to generate initial encryption and authentication keys during connection initialization. It is also used to generate encryption and authentication keys for subsequent packets if encryption and authentication are needed. The VAM server must have the same pre-shared key as the clients in the same ADVPN domain. If they have different pre-shared keys, they will fail to establish a connection. To configure a pre-shared key for the VAM server: Step Command Remarks 1. Enter system view. system-view N/A 320
334 Step Command Remarks 2. Enter ADVPN domain view. 3. Configure a pre-shared key for the VAM server. vam server advpn-domain domain-name [ id domain-id ] pre-shared-key { cipher cipher-string simple simple-string } N/A By default, no pre-shared key is configured. Configuring hub groups Hub groups apply to large ADVPN networks. You can classify spokes to different hub groups, and specify one or more hubs for each group. When a VAM client registers with the VAM server, the VAM server selects a hub group for the client as follows: 1. The server matches the private address of the client against the private addresses of hubs in different hub groups in lexicographic order. 2. If a matching hub is found, the server assigns the client to the hub group as a hub. 3. If no match is found, the server matches the client's private address against the private addresses of spokes in different hub groups in lexicographic order. 4. If a matching spoke is found, the server assigns the client to the hub group as a spoke. 5. If no match is found, the registration fails. The VAM server only assigns hub information in the matching hub group to the client. The client only establishes permanent ADVPN tunnels to the hubs in the hub group. Creating a hub group Step Command Remarks 1. Enter system view. system-view N/A 2. Enter ADVPN domain view. 3. Create a hub group and enter hub group view. vam server advpn-domain domain-name [ id domain-id ] hub-group group-name N/A By default, no hub group exists. Configuring hub private address in a hub group A hub group must have at least one hub private address. To configure hub private address in the hub group: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter ADVPN domain view. vam server advpn-domain domain-name [ id domain-id ] N/A 3. Enter hub group view. hub-group group-name N/A 321
335 Step Command Remarks 4. Configure a hub private address. Configure an IPv4 hub private address: hub private-address private-ip-address [ public-address { public-ip-address public-ipv6-address } [ advpn-port port-number ] ] Configure an IPv6 hub private address: hub ipv6 private-address private-ipv6-address [ public-address { public-ip-address public-ipv6-address } [ advpn-port port-number ] ] Use either command. By default, no hub private address is configured. Configuring a spoke private address range in a hub group You can configure multiple spoke private address ranges in a hub group. The ranges are listed from low to high. To configure a spoke private address range in a hub group: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter ADVPN domain view. vam server advpn-domain domain-name [ id domain-id ] N/A 3. Enter hub group view. hub-group group-name N/A 4. Configure a spoke private address range. Configure an IPv4 spoke private address range: spoke private-address { range start-address end-address network ip-address { mask-length mask } } Configure an IPv6 spoke private address range: spoke ipv6 private-address { range start-ipv6-address end-ipv6-address network prefix/prefix-length } Use either command. By default, no spoke private address range is configured. Configuring rules for establishing spoke-to-spoke tunnels The VAM server assigns the rules for establishing spoke-to-spoke tunnels to a hub. The hub uses the rules to match received packets. If a packet matches a rule, the hub sends a redirect packet to the spoke that sent the packet. The spoke then contacts the VAM server to obtain the public address of the remote spoke and establishes a direct tunnel to the remote spoke. To configure rules for establishing spoke-to-spoke tunnels: 322
336 Step Command Remarks 1. Enter system view. system-view N/A 2. Enter ADVPN domain view. vam server advpn-domain domain-name [ id domain-id ] N/A 3. Enter hub group view. hub-group group-name N/A 4. Configure rules for establishing spoke-to-spoke tunnels. Configure rules for establishing IPv4 spoke-to-spoke tunnels: shortcut interest { all acl { acl-number name acl-name } } Configure rules for establishing IPv6 spoke-to-spoke tunnels: shortcut ipv6 interest { all acl { ipv6-acl-number name ipv6-acl-name } } Use either command. By default, no rules for establishing IPv4 spoke-to-spoke tunnels are configured. Spokes are not allowed to establish direct tunnels. Configuring the port number of the VAM server Step Command Remarks 1. Enter system view. system-view N/A 2. Configure the port number of the VAM server. vam server listen-port port-number The default port number is Specifying authentication and encryption algorithms for the VAM server The VAM server uses the specified algorithms to negotiate with the VAM client. The VAM server and client use SHA-1 and AES-128 during connection initialization, and use the negotiated algorithms after connection initialization. The algorithms specified in a command line are in the descending order of priority. Newly specified algorithms do not affect registered VAM clients. They apply to subsequently registered VAM clients. To specify authentication and encryption algorithms for the VAM server: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter ADVPN domain view. 3. Specify authentication algorithms. vam server advpn-domain domain-name [ id domain-id ] authentication-algorithm { aes-xcbc-mac md5 none sha-1 sha-256 } * N/A The default authentication algorithm is SHA
337 Step Command Remarks 4. Specify encryption algorithms. encryption-algorithm { 3des-cbc aes-cbc-128 aes-cbc-192 aes-cbc-256 aes-ctr-128 aes-ctr-192 aes-ctr-256 des-cbc none } * The default encryption algorithms are AES-CBC-256, AES-CBC-192, AES-CBC-128, AES-CTR-256, AES-CTR-192, AES-CTR-128, 3DES-CBC, and DES-CBC in the descending order of priority. Configuring an authentication method The VAM server uses the specified method to authenticate clients in the ADVPN domain. The VAM server supports PAP and CHAP authentication. If the specified ISP domain does not exist, the authentication will fail. A newly configured authentication method does not affect registered VAM clients. It applies to subsequently registered VAM clients. To configure an authentication method: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter ADVPN domain view. 3. Specify a client authentication method. vam server advpn-domain domain-name [ id domain-id ] authentication-method { none { chap pap } [ domain isp-name ] } N/A By default, the authentication method is CHAP, and the default domain is used. Configuring keepalive parameters Keepalive parameters include a keepalive interval and a maximum number of keepalive attempts. The VAM server assigns the configured keepalive parameters to clients in the ADVPN domain. A client sends keepalives to the server at the specified interval. If a client receives no responses from the server after maximum keepalive attempts, the client stops sending keepalives. If the VAM server receives no keepalives from a client before the timeout timer expires, the server removes information about the client and logs off the client. The timeout time is the product of the keepalive interval and keepalive attempts. Newly configured keepalive parameters do not affect registered VAM clients. They apply to subsequently registered clients. To configure keepalive parameters: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter ADVPN domain view. 3. Configure keepalive parameters. vam server advpn-domain domain-name [ id domain-id ] keepalive interval time-interval retry retry-times N/A By default, the keepalive interval is 180 seconds, and the maximum number of keepalive attempts is
338 Configuring the retry timer The VAM server starts the retry timer after it sends a request to a client. If the server receives no response from the client before the retry timer expires, the server resends the request. The server stops sending the request after receiving a response from the client or after the timeout timer (product of the keepalive interval and keepalive attempts) expires. To configure the retry timer: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter ADVPN domain view. vam server advpn-domain domain-name [ id domain-id ] N/A 3. Configure the retry timer. retry interval time-interval By default, the retry timer is set to 5 seconds. Configuring the VAM client Tasks at a glance (Required.) Creating a VAM client (Required.) Enabling VAM clients (Required.) Specifying VAM servers (Required.) Specifying an ADVPN domain for a VAM client (Required.) Specifying a pre-shared key for a VAM client (Optional.) Setting the retry timer and retry times for a VAM client (Optional.) Setting the dumb timer for a VAM client (Optional.) Configuring a username and password for a VAM client Creating a VAM client Step Command Remarks 1. Enter system view. system-view N/A 2. Create a VAM client and enter its view. vam client name client-name By default, no client is created. Enabling VAM clients Step Command Remarks 1. Enter system view. system-view N/A 325
339 Step Command Remarks 2. Enable VAM clients. Enable one or all VAM clients: vam client enable { all name client-name } Enable a VAM client: a. vam client name client-name b. client enable Use either method. By default, no VAM client is enabled. Specifying VAM servers You can specify a primary VAM server and a secondary VAM server for a VAM client. The client registers with both servers, and accepts settings from the server that first registers the client. When the server fails, the client uses the settings from the other server. If the specified primary and secondary VAM servers have the same address or name, only the primary VAM server takes effect. The port number of a VAM server must be the same as that configured on the VAM server. To specify VAM servers for a client: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter VAM client view. vam client name client-name N/A 3. Specify the primary VAM server. 4. (Optional.) Specify the secondary VAM server. server primary { name host-name ip-address ip-address ipv6-address ipv6-address } [ port port-number ] server secondary { name host-name ip-address ip-address ipv6-address ipv6-address } [ port port-number ] By default, no VAM server is specified. By default, no VAM server is specified. Specifying an ADVPN domain for a VAM client Step Command Remarks 1. Enter system view. system-view N/A 2. Enter VAM client view. vam client name client-name N/A 3. Specify an ADVPN domain for the VAM client. advpn-domain domain-name By default, no ADVPN domain is specified for a VAM client. Specifying a pre-shared key for a VAM client The pre-shared key is used to generate initial encryption and authentication keys during connection initialization. It is also used to generate encryption and authentication keys for subsequent packets if encryption and authentication are needed. 326
340 All VAM clients and the VAM server in an ADVPN domain must have the same pre-shared key. If they have different pre-shared keys, they will fail to establish a connection. To specify a pre-shared key for a VAM client: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter VAM client view. vam client name client-name N/A 3. Specify a pre-shared key for the VAM client. pre-shared-key { cipher cipher-string simple simple-string } By default, no pre-shared key is specified for a VAM client. Setting the retry timer and retry times for a VAM client A VAM client starts a retry timer after sending a request to the server. If the client receives no response before the retry timer expires, it resends the request. If the client fails to receive a response after maximum attempts (retry times), the client considers the server is unreachable. The retry-times setting does not apply to register and update requests. The client sends those requests at the retry interval until it goes offline. To set the retry timer and retry times for a VAM client: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter VAM client view. vam client name client-name N/A 3. Set the retry timer and retry times. retry interval time-interval count retry-times By default, the retry timer is 5 seconds, and the retry times are 3. Setting the dumb timer for a VAM client The VAM client starts the dumb timer after the timeout timer expires. The client does not process any packets during the dumb time. When the dumb timer expires, the client sends a new connection request to the VAM server. To set the dumb timer for a VAM client: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter VAM client view. vam client name client-name N/A 3. Set the dumb timer. dumb-time time-interval By default, the dumb time is 120 seconds. Configuring a username and password for a VAM client The VAM client uses the configured username and password for authentication on the server. 327
341 To configure a username and password for a VAM client: Step Command Remarks 1. Enter system view. system-view N/A 2. Enter VAM client view. vam client name client-name N/A 3. Configure a username and password for the client. user username password { cipher cipher-string simple simple-string } By default, no username and password is configured for the client. Configuring an ADVPN tunnel interface ADVPN establishes tunnels over ADVPN tunnel interfaces. To configure an ADVPN tunnel interface: Step Command Remarks 1. Enter system view. system-view N/A 2. Create an ADVPN tunnel interface and enter its view. 3. Configure a private address for the tunnel interface. 4. Specify a source address or source interface for the tunnel interface. 5. (Optional.) Set the DF bit for ADVPN packets interface tunnel number [ mode advpn { gre udp } [ ipv6 ] ] Configure a private IPv4 address: ip address ip-address { mask mask-length } [ sub ]vam client enable { all name client-name } Configure a private IPv6 address: ipv6 address ipv6-address prefix-length source { ip-address interface-type interface-number } tunnel dfbit enable By default, no tunnel interface is created. The two ends of an ADVPN tunnel must use the same tunnel mode. Use either command. By default, no private address is configured for the tunnel interface. All tunnel interfaces in a hub group must reside in the same private network. By default, no source address or source interface is configured for a tunnel interface. The specified source address or the IP address of the specified source interface is used as the source address of ADVPN packets. If multiple GRE ADVPN tunnel interfaces have the same source address or source interface, you must configure different GRE keys for the interfaces. For information about GRE keys, see Layer 3 IP Services Configuration Guide. By default, the DF bit is not set for ADVPN packets. 328
342 Step Command Remarks By default, the source UDP port number of ADVPN packets is (Optional.) Set the source UDP port number of ADVPN packets. 7. Bind a VAM client to the tunnel interface. 8. (Optional.) Configure a private network for the tunnel interface. 9. (Optional.) Set the keepalive interval and keepalive attempts for the tunnel interface. 10. (Optional.) Set the idle timeout for the spoke-spoke tunnel. 11. (Optional.) Set the dumb time for the tunnel interface. advpn source-port port-number Bind an IPv4 VAM client to the tunnel interface: vam client client-name [ compatible advpn0 ] Bind an IPv6 VAM client to the tunnel interface: vam ipv6 client client-name Configure a private IPv4 network for the tunnel interface: advpn network ip-address { mask-length mask } [ preference preference-value ] Configure a private IPv6 network for the tunnel interface: advpn ipv6 network prefix/prefix-length [ preference preference-value ] keepalive interval time-interval retry retry-times dvpn session idle-time time-interval dvpn session dumb-time time-interval This command is available when the tunnel mode is UDP. If the vam client command configured on the tunnel interface has the compatible keyword, the tunnel interface must have a different source UDP port number from other tunnel interfaces. By default, no VAM client is bound to an ADVPN tunnel interface. A VAM client can be bound to only one IPv4 ADVPN tunnel interface. A VAM client can be bound to only one IPv6 ADVPN tunnel interface. By default: No private network is configured for the tunnel interface. The preference of the private network route is higher than other dynamic routing protocols, and is lower than a static route. By default, the keepalive interval is 180 seconds, and the keepalive attempts are 3. The keepalive interval and keepalive attempts must be the same on the tunnel interfaces in an ADVPN domain. By default, the idle timeout is 600 seconds. The new idle timeout setting applies to both existing and subsequently established spoke-spoke tunnels. By default, the dumb time is 120 seconds. The new dumb time setting only applies to subsequently established tunnels. For more information about tunnel interface configurations and commands, see Layer 3 IP Services Configuration Guide and Layer 3 IP Services Command Reference. 329
343 Configuring routing ADVPN supports OSPF, RIP, and BGP for IPv4: When OSPF is used, set the network type of an OSPF interface to broadcast in a full mesh network and to P2MP in a hub-spoke network. When RIP is used, you can use RIP-1 or RIP-2 broadcast in a full mesh network and use RIP-2 multicast and disable split horizon in a hub-spoke network. When BGP is used, configure a routing policy to make sure the next hop of a route destined for a remote private network is the IP address of the peer spoke in a full mesh network (EBGP does not support full-mesh), or is the IP address of the hub in a hub-spoke network. ADVPN supports OSPFv3, RIPng, and IPv6 BGP for IPv6: When OSPFv3 is used, set the network type of an OSPFv3 interface to broadcast in a full mesh network and to P2MP in a hub-spoke network. When RIPng is used, only the full-mesh network is supported. When IPv6 BGP is used, configure a routing policy to make sure the next hop of a route destined for a remote private network is the IP address of the peer spoke in a full mesh network (EBGP does not support full-mesh), or is the IP address of the hub in a hub-spoke network. For more information about routing protocols and policies, see Layer 3 IP Routing Configuration Guide. Configuring IPsec for ADVPN tunnels You can configure an IPsec profile to secure ADVPN tunnels: 1. Configure IPsec proposals. 2. Configure an IKE-mode IPsec profile that references the IPsec proposals. 3. Apply the IPsec profile to an ADVPN tunnel interface. For more information about IPsec configuration, see Security Configuration Guide. Displaying and maintaining ADVPN Execute display commands in any view and reset commands in user view. Task Display IPv4 private-to-public address mappings for VAM clients registered on the VAM server. Display IPv6 private-to-public address mappings for VAM clients registered on the VAM server. Display IPv4 private networks for VAM clients registered on the VAM server. Command display vam server address-map [ advpn-domain domain-name [ private-address private-ip-address ] ] [ verbose ] display vam server ipv6 address-map [ advpn-domain domain-name [ private-address private-ipv6-address ] ] [ verbose ] display vam server private-network [ advpn-domain domain-name [ private-address private-ip-address ] ] 330
344 Task Display IPv6 private networks for VAM clients registered on the VAM server. Display ADVPN domain statistics on the VAM server. Display FSM information for VAM clients. Command display vam server ipv6 private-network [ advpn-domain domain-name [ private-address private-ipv6-address ] ] display vam server statistics [ advpn-domain domain-name ] display vam client fsm [ name client-name ] Display statistics for VAM clients. display vam client statistics [ name client-name ] Display the rules for establishing IPv4 spoke-to-spoke tunnels for VAM clients. Display the rules for establishing IPv6 spoke-to-spoke tunnels for VAM clients. Display IPv4 ADVPN tunnel information. Display IPv6 ADVPN tunnel information. Clear IPv4 private-to-public address mappings for VAM clients registered on the VAM server. Clear IPv6 private-to-public address mappings for VAM clients registered on the VAM server. Clear ADVPN domain statistics on the VAM server. display vam client shortcut interest [ name client-name ] display vam client shortcut ipv6 interest [ name client-name ] display advpn session [ interface tunnel number [ private-address private-ip-address ] ] [ verbose ] display advpn ipv6 session [ interface tunnel number [ private-address private-ipv6-address ] ] [ verbose ] reset vam server address-map [ advpn-domain domain-name [ private-address private-ip-address ] ] reset vam server ipv6 address-map [ advpn-domain domain-name [ private-address private-ipv6-address ] ] reset vam server statistics [ advpn-domain domain-name ] Reset the FSM for VAM clients. reset vam client [ ipv6 ] fsm [ name client-name ] Clear statistics for VAM client. reset vam client statistics [ name client-name ] Delete IPv4 ADVPN tunnels. Delete IPv6 ADVPN tunnels. Clear statistics for IPv4 ADVPN tunnels. Clear statistics for IPv6 ADVPN tunnels. reset advpn session statistics [ interface tunnel number [ private-address private-ip-address ] ] reset advpn ipv6 session statistics [ interface tunnel number [ private-address private-ipv6-address ] ] reset advpn session statistics [ interface tunnel number [ private-address private-ip-address ] ] reset advpn ipv6 session statistics [ interface tunnel number [ private-address private-ipv6-address ] ] 331
345 ADVPN configuration examples IPv4 full-mesh ADVPN configuration example Network requirements As shown in Figure 136, the primary and secondary VAM servers manage and maintain VAM client information for all hubs and spokes. The AAA server performs authentication and accounting for VAM clients. The two hubs back up each other, and perform data forwarding and route exchange. Each spoke establishes a permanent ADVPN tunnel to each hub. Any two spokes in the same ADVPN domain can dynamically establish a temporary ADVPN tunnel. Figure 136 Network diagram Table 12 Interface and IP address assignment Device Interface IP address Device Interface IP address Hub 1 GE1/0/ /24 Spoke 1 GE1/0/ /24 Tunnel /24 GE1/0/ /24 Hub 2 GE1/0/ /24 Tunnel /24 Tunnel /24 Spoke 2 GE1/0/ /24 AAA server /24 GE1/0/ /24 Primary server GE1/0/ /24 Tunnel /24 Secondary server GE1/0/ /24 Configuring the primary VAM server 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure AAA: 332
346 # Configure RADIUS scheme abc. <PrimaryServer> system-view [PrimaryServer] radius scheme abc [PrimaryServer-radius-abc] primary authentication [PrimaryServer-radius-abc] primary accounting [PrimaryServer-radius-abc] key authentication simple 123 [PrimaryServer-radius-abc] key accounting simple 123 [PrimaryServer-radius-abc] user-name-format without-domain [PrimaryServer-radius-abc] quit [PrimaryServer] radius session-control enable # Configure AAA methods for the ISP domain abc. [PrimaryServer] domain abc [PrimaryServer-isp-abc] authentication advpn radius-scheme abc [PrimaryServer-isp-abc] accounting advpn radius-scheme abc [PrimaryServer-isp-abc] quit [PrimaryServer] domain default enable abc 3. Configure the VAM server: # Create ADVPN domain abc. [PrimaryServer] vam server advpn-domain abc id 1 # Create hub group 0. [PrimaryServer-vam-server-domain-abc] hub-group 0 # Specify hub private addresses. [PrimaryServer-vam-server-domain-abc-hub-group-0] hub private-address [PrimaryServer-vam-server-domain-abc-hub-group-0] hub private-address # Specify a spoke private network. [PrimaryServer-vam-server-domain-abc-hub-group-0] spoke private-address network [PrimaryServer-vam-server-domain-abc-hub-group-0] quit # Set the pre-shared key to [PrimaryServer-vam-server-domain-abc] pre-shared-key simple # Set the authentication mode to CHAP. [PrimaryServer-vam-server-domain-abc] authentication-method chap # Enable the VAM server for the ADVPN domain. [PrimaryServer-vam-server-domain-abc] server enable [PrimaryServer-vam-server-domain-abc] quit Configuring the secondary VAM server # Configure the secondary VAM server in the same way that the primary server is configured. (Details not shown.) Configuring Hub 1 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client hub1. <Hub1> system-view [Hub1] vam client name Hub1 333
347 # Specify ADVPN domain abc for the VAM client. [Hub1-vam-client-Hub1] advpn-domain abc # Set the pre-shared key to [Hub1-vam-client-Hub1] pre-shared-key simple # Set the username and password to hub1 [Hub1-vam-client-Hub1] user hub1 password simple hub1 # Specify the primary and secondary VAM servers. [Hub1-vam-client-Hub1] server primary ip-address [Hub1-vam-client-Hub1] server secondary ip-address # Enable the VAM client. [Hub1-vam-client-Hub1] client enable [Hub1-vam-client-Hub1] quit 3. Configure an IPsec profile: # Configure IKE. [Hub1] ike keychain abc [Hub1-ike-keychain-abc] pre-shared-key address key simple [Hub1-ike-keychain-abc] quit [Hub1] ike profile abc [Hub1-ike-profile-abc] keychain abc [Hub1-ike-profile-abc] quit # Configure the IPsec profile. [Hub1] ipsec transform-set abc [Hub1-ipsec-transform-set-abc] encapsulation-mode transport [Hub1-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Hub1-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Hub1-ipsec-transform-set-abc] quit [Hub1] ipsec profile abc isakmp [Hub1-ipsec-profile-isakmp-abc] transform-set abc [Hub1-ipsec-profile-isakmp-abc] ike-profile abc [Hub1-ipsec-profile-isakmp-abc] quit 4. Configure OSPF to advertise the private network. [Hub1] ospf 1 [Hub1-ospf-1] area 0 [Hub1-ospf-1-area ] network [Hub1-ospf-1-area ] quit [Hub1-ospf-1] quit 5. Configure GRE-mode ADVPN tunnel interface tunnel1. [Hub1] interface tunnel1 mode advpn gre [Hub1-Tunnel1] ip address [Hub1-Tunnel1] vam client Hub1 [Hub1-Tunnel1] ospf network-type broadcast [Hub1-Tunnel1] source gigabitethernet 1/0/1 [Hub1-Tunnel1] tunnel protection ipsec profile abc [Hub1-Tunnel1] undo shutdown [Hub1-Tunnel1] quit 334
348 Configuring Hub 2 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client Hub2. <Hub2> system-view [Hub2] vam client name Hub2 # Specify ADVPN domain abc for the VAM Client. [Hub2-vam-client-Hub2] advpn-domain abc # Set pre-shared key for the VAM client. [Hub2-vam-client-Hub2] pre-shared-key simple # Set the username and password to hub2. [Hub2-vam-client-Hub2] user hub2 password simple hub2 # Specify the primary and secondary VAM servers. [Hub2-vam-client-Hub2] server primary ip-address [Hub2-vam-client-Hub2] server secondary ip-address # Enable the VAM client. [Hub2-vam-client-Hub2] client enable [Hub2-vam-client-Hub2] quit 3. Configure the IPsec profile: # Configure IKE. [Hub2] ike keychain abc [Hub2-ike-keychain-abc] pre-shared-key address key simple [Hub2-ike-keychain-abc] quit [Hub2] ike profile abc [Hub2-ike-profile-abc] keychain abc [Hub2-ike-profile-abc] quit # Configure the IPsec profile. [Hub2] ipsec transform-set abc [Hub2-ipsec-transform-set-abc] encapsulation-mode transport [Hub2-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Hub2-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Hub2-ipsec-transform-set-abc] quit [Hub2] ipsec profile abc isakmp [Hub2-ipsec-profile-isakmp-abc] transform-set abc [Hub2-ipsec-profile-isakmp-abc] ike-profile abc [Hub2-ipsec-profile-isakmp-abc] quit 4. Configure OSPF to advertise the private network. [Hub2] ospf 1 [Hub2-ospf-1] area 0 [Hub2-ospf-1-area ] network [Hub2-ospf-1-area ] quit [Hub2-ospf-1] quit 5. Configure GRE-mode ADVPN tunnel interface tunnel1. [Hub2] interface tunnel 1 mode advpn gre [Hub2-Tunnel1] ip address
349 [Hub2-Tunnel1] vam client Hub2 [Hub2-Tunnel1] ospf network-type broadcast [Hub2-Tunnel1] source gigabitethernet 1/0/1 [Hub2-Tunnel1] tunnel protection ipsec profile abc [Hub2-Tunnel1] undo shutdown [Hub2-Tunnel1] quit Configuring Spoke 1 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client spoke1. <Spoke1> system-view [Spoke1] vam client name Spoke1 # Specify ADVPN domain abc for the VAM client. [Spoke1-vam-client-Spoke1] advpn-domain abc # Configure a pre-shared key for the VAM client. [Spoke1-vam-client-Spoke1] pre-shared-key simple # Set the username and password to spoke1. [Spoke1-vam-client-Spoke1] user spoke1 password simple spoke1 # Specify the primary and secondary VAM servers. [Spoke1-vam-client-Spoke1] server primary ip-address [Spoke1-vam-client-Spoke1] server secondary ip-address # Enable the VAM client. [Spoke1-vam-client-Spoke1] client enable [Spoke1-vam-client-Spoke1] quit 3. Configure the IPsec profile: # Configure IKE. [Spoke1] ike keychain abc [Spoke1-ike-keychain-abc] pre-shared-key address key simple [Spoke1-ike-keychain-abc] quit [Spoke1] ike profile abc [Spoke1-ike-profile-abc] keychain abc [Spoke1-ike-profile-abc] quit # Configure the IPsec profile. [Spoke1] ipsec transform-set abc [Spoke1-ipsec-transform-set-abc] encapsulation-mode transport [Spoke1-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Spoke1-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Spoke1-ipsec-transform-set-abc] quit [Spoke1] ipsec profile abc isakmp [Spoke1-ipsec-profile-isakmp-abc] transform-set abc [Spoke1-ipsec-profile-isakmp-abc] ike-profile abc [Spoke1-ipsec-profile-isakmp-abc] quit 4. Configure OSPF to advertise the private networks. [Spoke1] ospf 1 [Spoke1-ospf-1] area 0 336
350 [Spoke1-ospf-1-area ] network [Spoke1-ospf-1-area ] network [Spoke1-ospf-1-area ] quit [Spoke1-ospf-1] quit 5. Configure GRE-mode ADVPN tunnel interface tunnel1. Configure its DR priority as 0 so Spoke1 will not participate in DR/BDR election. [Spoke1] interface tunnel1 mode advpn gre [Spoke1-Tunnel1] ip address [Spoke1-Tunnel1] vam client Spoke1 [Spoke1-Tunnel1] ospf network-type broadcast [Spoke1-Tunnel1] ospf dr-priority 0 [Spoke1-Tunnel1] source gigabitethernet 1/0/1 [Spoke1-Tunnel1] tunnel protection ipsec profile abc [Spoke1-Tunnel1] undo shutdown [Spoke1-Tunnel1] quit Configuring Spoke 2 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client spoke2. <Spoke2> system-view [Spoke2] vam client name Spoke2 # Specify ADVPN domain abc for the VAM client. [Spoke2-vam-client-Spoke2] advpn-domain abc # Configure a pre-shared key for the VAM client. [Spoke2-vam-client-Spoke2] pre-shared-key simple # Set the username and password to spoke2. [Spoke2-vam-client-Spoke2] user spoke2 password simple spoke2 # Specify the primary and secondary VAM servers. [Spoke2-vam-client-Spoke2] server primary ip-address [Spoke2-vam-client-Spoke2] server secondary ip-address # Enable the VAM client. [Spoke2-vam-client-Spoke2] client enable [Spoke2-vam-client-Spoke2] quit 3. Configure the IPsec profile: # Configure IKE. [Spoke2] ike keychain abc [Spoke2-ike-keychain-abc] pre-shared-key address key simple [Spoke2-ike-keychain-abc] quit [Spoke2] ike profile abc [Spoke2-ike-profile-abc] keychain abc [Spoke2-ike-profile-abc] quit # Configure the IPsec profile. [Spoke2] ipsec transform-set abc [Spoke2-ipsec-transform-set-abc] encapsulation-mode transport [Spoke2-ipsec-transform-set-abc] esp encryption-algorithm des-cbc 337
351 [Spoke2-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Spoke2-ipsec-transform-set-abc] quit [Spoke2] ipsec profile abc isakmp [Spoke2-ipsec-profile-isakmp-abc] transform-set abc [Spoke2-ipsec-profile-isakmp-abc] ike-profile abc [Spoke2-ipsec-profile-isakmp-abc] quit 4. Configure OSPF to advertise the private network. [Spoke2] ospf 1 [Spoke2-ospf-1] area 0 [Spoke2-ospf-1-area ] network [Spoke2-ospf-1-area ] network [Spoke2-ospf-1-area ] quit [Spoke2-ospf-1] quit 5. Configure GRE-mode ADVPN tunnel interface tunnel1. Configure its DR priority as 0 so Spoke2 will not participate in DR/BDR election. [Spoke2] interface tunnel1 mode advpn gre [Spoke2-Tunnel1] ip address [Spoke2-Tunnel1] vam client Spoke2 [Spoke2-Tunnel1] ospf network-type broadcast [Spoke2-Tunnel1] ospf dr-priority 0 [Spoke2-Tunnel1] source gigabitethernet 1/0/1 [Spoke2-Tunnel1] tunnel protection ipsec profile abc [Spoke2-Tunnel1] undo shutdown [Spoke2-Tunnel1] quit Verifying the configuration # Display the address mapping information for all VAM clients registered with the primary VAM server. [PrimaryServer] display vam server address-map ADVPN domain name: 1 Total private address mappings: 4 Group Private address Public address Type NAT Holding time Hub No 0H 52M 7S Hub No 0H 47M 31S Spoke No 0H 28M 25S Spoke No 0H 19M 15S # Display the address mapping information for all VAM clients registered with the secondary VAM server. [SecondaryServer] display vam server address-map ADVPN domain name: 1 Total private address mappings: 4 Group Private address Public address Type NAT Holding time Hub No 0H 52M 7S Hub No 0H 47M 31S Spoke No 0H 28M 25S Spoke No 0H 19M 15S The above output shows that Hub 1, Hub 2, Spoke 1, Spoke 2, and Spoke 3 all have registered their address mapping information with the VAM servers. 338
352 # Display the ADVPN tunnel information for Hub 1. [Hub1] display advpn session Interface : Tunnel1 Number of sessions: 3 Private address Public address Port Type State Holding time H-H Success 0H 46M 8S H-S Success 0H 27M 27S H-S Success 0H 18M 18S The output shows that Hub 1 has established a permanent tunnel to Hub 2, Spoke 1, and Spoke 2. The ADVPN tunnel information for Hub 2 is similar to that of Hub 1. # Display the ADVPN tunnel information for Spoke 1. [Spoke1] display advpn session Interface : Tunnel1 Number of sessions: 2 Private address Public address Port Type State Holding time S-H Success 0H 46M 8S S-H Success 0H 46M 8S The output shows that Spoke 1 has established a permanent hub-spoke tunnel to Hub 1 and Hub 2. # Ping the private address of Spoke 2 from Spoke 1. [Spoke2] ping Ping ( ): 56 data bytes, press CTRL_C to break 56 bytes from : icmp_seq=0 ttl=255 time=4.000 ms 56 bytes from : icmp_seq=1 ttl=255 time=0.000 ms 56 bytes from : icmp_seq=2 ttl=255 time=0.000 ms 56 bytes from : icmp_seq=3 ttl=255 time=0.000 ms 56 bytes from : icmp_seq=4 ttl=255 time=1.000 ms --- Ping statistics for packets transmitted, 5 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.000/1.000/4.000/1.549 ms # Display ADVPN tunnel information on Spoke 1. [Spoke1] display advpn session Interface : Tunnel1 Number of sessions: 3 Private address Public address Port Type State Holding time S-H Success 0H 46M 8S S-H Success 0H 46M 8S S-S Success 0H 0M 1S The output shows that: Spoke 1 has established permanent hub-spoke tunnels to Hub 1 and Hub 2. Spoke 1 and Spoke 2 have established a temporary spoke-spoke tunnel. 339
353 IPv6 full-mesh ADVPN configuration example Network requirements As shown in Figure 137, the primary and secondary VAM servers manage and maintain VAM client information for all hubs and spokes. The AAA server performs authentication and accounting for VAM clients. The two hubs back up each other, and perform data forwarding and route exchange. Each spoke establishes a permanent ADVPN tunnel to each hub. Any two spokes in the same ADVPN domain can dynamically establish a temporary ADVPN tunnel. Figure 137 Network diagram Table 13 Interface and IP address assignment Device Interface IP address Device Interface IP address Hub 1 GE1/0/1 1::1/64 Spoke 1 GE1/0/1 1::3/64 Tunnel1 192:168::1/64 GE1/0/2 192:168:1::1/64 Hub 2 GE1/0/1 1::2/64 Tunnel1 192:168::3/64 Tunnel1 192:168::2/64 Spoke 2 GE1/0/1 1::4/64 AAA server 1::10/64 GE1/0/2 192:168:2::1/64 Primary server GE1/0/1 1::11/64 Tunnel1 192:168::4/64 Secondary server GE1/0/1 1::12/64 Configuring the primary VAM server 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure AAA: # Configure RADIUS scheme abc. <PrimaryServer> system-view 340
354 [PrimaryServer] radius scheme abc [PrimaryServer-radius-abc] primary authentication ipv6 1:: [PrimaryServer-radius-abc] primary accounting ipv6 1:: [PrimaryServer-radius-abc] key authentication simple 123 [PrimaryServer-radius-abc] key accounting simple 123 [PrimaryServer-radius-abc] user-name-format without-domain [PrimaryServer-radius-abc] quit [PrimaryServer] radius session-control enable # Configure AAA methods for the ISP domain abc. [PrimaryServer] domain abc [PrimaryServer-isp-abc] authentication advpn radius-scheme abc [PrimaryServer-isp-abc] accounting advpn radius-scheme abc [PrimaryServer-isp-abc] quit [PrimaryServer] domain default enable abc 3. Configure the VAM server: # Create ADVPN domain abc. [PrimaryServer] vam server advpn-domain abc id 1 # Create hub group 0. [PrimaryServer-vam-server-domain-abc] hub-group 0 # Specify hub private addresses. [PrimaryServer-vam-server-domain-abc-hub-group-0] hub ipv6 private-address 192:168::1 [PrimaryServer-vam-server-domain-abc-hub-group-0] hub ipv6 private-address 192:168::2 # Specify a spoke private network. [PrimaryServer-vam-server-domain-abc-hub-group-0] spoke ipv6 private-address network 192:168::0 64 # Set the pre-shared key to [PrimaryServer-vam-server-domain-abc] pre-shared-key simple # Set the authentication mode to CHAP. [PrimaryServer-vam-server-domain-abc] authentication-method chap # Enable the VAM server for the ADVPN domain. [PrimaryServer-vam-server-domain-abc] server enable [PrimaryServer-vam-server-domain-abc] quit Configuring the secondary VAM server # Configure the secondary VAM server in the same way that the primary server is configured. (Details not shown.) Configuring Hub 1 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client hub1. <Hub1> system-view [Hub1] vam client name Hub1 # Specify ADVPN domain abc for the VAM client. [Hub1-vam-client-Hub1] advpn-domain abc 341
355 # Set the pre-shared key to [Hub1-vam-client-Hub1] pre-shared-key simple # Set the username and password to hub1 [Hub1-vam-client-Hub1] user hub1 password simple hub1 # Specify the primary and secondary VAM servers. [Hub1-vam-client-Hub1] server primary ipv6-address 1::11 [Hub1-vam-client-Hub1] server secondary ipv6-address 1::12 # Enable the VAM client. [Hub1-vam-client-Hub1] client enable [Hub1-vam-client-Hub1] quit 3. Configure an IPsec profile: # Configure IKE. [Hub1] ike keychain abc [Hub1-ike-keychain-abc] pre-shared-key address ipv6 :: 0 key simple [Hub1-ike-keychain-abc] quit [Hub1] ike profile abc [Hub1-ike-profile-abc] keychain abc [Hub1-ike-profile-abc] quit # Configure the IPsec profile. [Hub1] ipsec transform-set abc [Hub1-ipsec-transform-set-abc] encapsulation-mode transport [Hub1-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Hub1-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Hub1-ipsec-transform-set-abc] quit [Hub1] ipsec profile abc isakmp [Hub1-ipsec-profile-isakmp-abc] transform-set abc [Hub1-ipsec-profile-isakmp-abc] ike-profile abc [Hub1-ipsec-profile-isakmp-abc] quit 4. Configure OSPFv3. [Hub1] ospfv3 1 [Hub1-ospfv3-1] router-id [Hub1-ospfv3-1] area 0 [Hub1-ospfv3-1-area ] quit [Hub1-ospfv3-1] quit 5. Configure GRE-mode ADVPN tunnel interface tunnel1. [Hub1] interface tunnel1 mode advpn gre ipv6 [Hub1-Tunnel1] ipv6 address 192:168::1 64 [Hub1-Tunnel1] ipv6 address fe80::1 link-local [Hub1-Tunnel1] vam ipv6 client Hub1 [Hub1-Tunnel1] ospfv3 1 area 0 [Hub1-Tunnel1] ospfv3 network-type broadcast [Hub1-Tunnel1] source gigabitethernet 1/0/1 [Hub1-Tunnel1] tunnel protection ipsec profile abc [Hub1-Tunnel1] undo shutdown [Hub1-Tunnel1] quit 342
356 Configuring Hub 2 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client Hub2. <Hub2> system-view [Hub2] vam client name Hub2 # Specify ADVPN domain abc for the VAM Client. [Hub2-vam-client-Hub2] advpn-domain abc # Set pre-shared key for the VAM client. [Hub2-vam-client-Hub2] pre-shared-key simple # Set the username and password to hub2. [Hub2-vam-client-Hub2] user hub2 password simple hub2 # Specify the primary and secondary VAM servers. [Hub2-vam-client-Hub2] server primary ipv6-address 1::11 [Hub2-vam-client-Hub2] server secondary ipv6-address 1::12 # Enable the VAM client. [Hub2-vam-client-Hub2] client enable [Hub2-vam-client-Hub2] quit 3. Configure the IPsec profile: # Configure IKE. [Hub2] ike keychain abc [Hub2-ike-keychain-abc] pre-shared-key address ipv6 :: 0 key simple [Hub2-ike-keychain-abc] quit [Hub2] ike profile abc [Hub2-ike-profile-abc] keychain abc [Hub2-ike-profile-abc] quit # Configure the IPsec profile. [Hub2] ipsec transform-set abc [Hub2-ipsec-transform-set-abc] encapsulation-mode transport [Hub2-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Hub2-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Hub2-ipsec-transform-set-abc] quit [Hub2] ipsec profile abc isakmp [Hub2-ipsec-profile-isakmp-abc] transform-set abc [Hub2-ipsec-profile-isakmp-abc] ike-profile abc [Hub2-ipsec-profile-isakmp-abc] quit 4. Configure OSPFv3. [Hub2] ospfv3 1 [Hub2-ospfv3-1] router-id [Hub2-ospfv3-1] area 0 [Hub2-ospfv3-1-area ] quit [Hub2-ospfv3-1] quit 5. Configure GRE-mode ADVPN tunnel interface tunnel1. [Hub2] interface tunnel1 mode advpn gre ipv6 [Hub2-Tunnel1] ipv6 address 192:168::
357 [Hub1-Tunnel1] ipv6 address fe80::2 link-local [Hub2-Tunnel1] vam ipv6 client Hub2 [Hub2-Tunnel1] ospfv3 1 area 0 [Hub2-Tunnel1] ospfv3 network-type broadcast [Hub2-Tunnel1] source gigabitethernet 1/0/1 [Hub2-Tunnel1] tunnel protection ipsec profile abc [Hub2-Tunnel1] undo shutdown [Hub2-Tunnel1] quit Configuring Spoke 1 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client spoke1. <Spoke1> system-view [Spoke1] vam client name Spoke1 # Specify ADVPN domain abc for the VAM client. [Spoke1-vam-client-Spoke1] advpn-domain abc # Configure a pre-shared key for the VAM client. [Spoke1-vam-client-Spoke1] pre-shared-key simple # Set the username and password to spoke1. [Spoke1-vam-client-Spoke1] user spoke1 password simple spoke1 # Specify the primary and secondary VAM servers. [Spoke1-vam-client-Spoke1] server primary ip-address [Spoke1-vam-client-Spoke1] server secondary ip-address # Enable the VAM client. [Spoke1-vam-client-Spoke1] client enable [Spoke1-vam-client-Spoke1] quit 3. Configure the IPsec profile: # Configure IKE. [Spoke1] ike keychain abc [Spoke1-ike-keychain-abc] pre-shared-key address ipv6 :: 0 key simple [Spoke1-ike-keychain-abc] quit [Spoke1] ike profile abc [Spoke1-ike-profile-abc] keychain abc [Spoke1-ike-profile-abc] quit # Configure the IPsec profile. [Spoke1] ipsec transform-set abc [Spoke1-ipsec-transform-set-abc] encapsulation-mode transport [Spoke1-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Spoke1-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Spoke1-ipsec-transform-set-abc] quit [Spoke1] ipsec profile abc isakmp [Spoke1-ipsec-profile-isakmp-abc] transform-set abc [Spoke1-ipsec-profile-isakmp-abc] ike-profile abc [Spoke1-ipsec-profile-isakmp-abc] quit 4. Configure OSPFv3. 344
358 [Spoke1] ospfv3 1 [Spoke1-ospfv3-1] router-id [Spoke1-ospfv3-1] area 0 [Spoke1-ospfv3-1-area ] quit [Spoke1-ospfv3-1] quit 5. Configure GRE-mode ADVPN tunnel interface tunnel1. Configure its DR priority as 0 so Spoke1 will not participate in DR/BDR election. [Spoke1] interface tunnel1 mode advpn gre ipv6 [Spoke1-Tunnel1] ipv6 address 192:168::3 64 [Spoke1-Tunnel1] ipv6 address fe80::3 link-local [Spoke1-Tunnel1] vam ipv6 client Spoke1 [Spoke1-Tunnel1] ospfv3 1 area 0 [Spoke1-Tunnel1] ospfv3 network-type broadcast [Spoke1-Tunnel1] ospfv3 dr-priority 0 [Spoke1-Tunnel1] source gigabitethernet 1/0/1 [Spoke1-Tunnel1] tunnel protection ipsec profile abc [Spoke1-Tunnel1] undo shutdown [Spoke1-Tunnel1] quit Configuring Spoke 2 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client spoke2. <Spoke2> system-view [Spoke2] vam client name Spoke2 # Specify ADVPN domain abc for the VAM client. [Spoke2-vam-client-Spoke2] advpn-domain abc # Configure a pre-shared key for the VAM client. [Spoke2-vam-client-Spoke2] pre-shared-key simple # Set the username and password to spoke2. [Spoke2-vam-client-Spoke2] user spoke2 password simple spoke2 # Specify the primary and secondary VAM servers. [Spoke2-vam-client-Spoke2] server primary ipv6-address 1::11 [Spoke2-vam-client-Spoke2] server secondary ipv6-address 1::12 # Enable the VAM client. [Spoke2-vam-client-Spoke2] client enable [Spoke2-vam-client-Spoke2] quit 3. Configure the IPsec profile: # Configure IKE. [Spoke2] ike keychain abc [Spoke2-ike-keychain-abc] pre-shared-key address ipv6 :: 0 key simple [Spoke2-ike-keychain-abc] quit [Spoke2] ike profile abc [Spoke2-ike-profile-abc] keychain abc [Spoke2-ike-profile-abc] quit # Configure the IPsec profile. 345
359 [Spoke2] ipsec transform-set abc [Spoke2-ipsec-transform-set-abc] encapsulation-mode transport [Spoke2-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Spoke2-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Spoke2-ipsec-transform-set-abc] quit [Spoke2] ipsec profile abc isakmp [Spoke2-ipsec-profile-isakmp-abc] transform-set abc [Spoke2-ipsec-profile-isakmp-abc] ike-profile abc [Spoke2-ipsec-profile-isakmp-abc] quit 4. Configure OSPFv3. [Spoke2] ospfv3 1 [Spoke2-ospfv3-1] router-id [Spoke2-ospfv3-1] area 0 [Spoke2-ospfv3-1-area ] quit [Spoke2-ospfv3-1] quit 5. Configure GRE-mode ADVPN tunnel interface tunnel1. Configure its DR priority as 0 so Spoke2 will not participate in DR/BDR election. [Spoke2] interface tunnel1 mode advpn gre ipv6 [Spoke2-Tunnel1] ipv6 address 192:168::4 64 [Spoke2-Tunnel1] ipv6 address fe80::4 link-local [Spoke2-Tunnel1] vam ipv6 client Spoke2 [Spoke2-Tunnel1] ospfv3 1 area 0 [Spoke2-Tunnel1] ospfv3 network-type broadcast [Spoke2-Tunnel1] ospfv3 dr-priority 0 [Spoke2-Tunnel1] source gigabitethernet 1/0/1 [Spoke2-Tunnel1] tunnel protection ipsec profile abc [Spoke2-Tunnel1] undo shutdown [Spoke2-Tunnel1] quit Verifying the configuration # Display the address mapping information for all VAM clients registered with the primary VAM server. [PrimaryServer] display vam server ipv6 address-map ADVPN domain name: 1 Total private address mappings: 4 Group Private address Public address Type NAT Holding time 0 192:168::1 1::1 Hub No 0H 52M 7S 0 192:168::2 1::2 Hub No 0H 47M 31S 0 192:168::3 1::3 Spoke No 0H 28M 25S 0 192:168::4 1::4 Spoke No 0H 19M 15S # Display the address mapping information for all VAM clients registered with the secondary VAM server. [SecondaryServer] display vam server ipv6 address-map ADVPN domain name: 1 Total private address mappings: 4 Group Private address Public address Type NAT Holding time 0 192:168::1 1::1 Hub No 0H 52M 7S 0 192:168::2 1::2 Hub No 0H 47M 31S 0 192:168::3 1::3 Spoke No 0H 28M 25S 346
360 0 192:168::4 1::4 Spoke No 0H 19M 15S The above output shows that Hub 1, Hub 2, Spoke 1, Spoke 2, and Spoke 3 all have registered their address mapping information with the VAM servers. # Display the ADVPN tunnel information for Hub 1. [Hub1] display advpn ipv6 session Interface : Tunnel1 Number of sessions: 3 Private address Public address Port Type State Holding time 192:168::2 1::2 -- H-H Success 0H 46M 8S 192:168::3 1::3 -- H-S Success 0H 27M 27S 192:168::4 1::4 -- H-S Success 0H 18M 18S The output shows that Hub 1 has established a permanent tunnel to Hub 2, Spoke 1, and Spoke 2. The ADVPN tunnel information for Hub 2 is similar to that of Hub 1. # Display the ADVPN tunnel information for Spoke 1. [Spoke1] display advpn ipv6 session Interface : Tunnel1 Number of sessions: 2 Private address Public address Port Type State Holding time 192:168::1 1::1 -- S-H Success 0H 46M 8S 192:168::2 1::2 -- S-H Success 0H 46M 8S The output shows that Spoke 1 has established a permanent hub-spoke tunnel to Hub 1 and Hub 2. # Ping the private address 192:168::4 of Spoke 2 from Spoke 1. [Spoke2] ping ipv6 192:168::4 Ping6(56 data bytes) 192:168::4 --> 192:168::4, press CTRL_C to break 56 bytes from 192:168::4, icmp_seq=0 hlim=64 time=3.000 ms 56 bytes from 192:168::4, icmp_seq=1 hlim=64 time=0.000 ms 56 bytes from 192:168::4, icmp_seq=2 hlim=64 time=1.000 ms 56 bytes from 192:168::4, icmp_seq=3 hlim=64 time=1.000 ms 56 bytes from 192:168::4, icmp_seq=4 hlim=64 time=1.000 ms --- Ping6 statistics for 192:168:: packets transmitted, 5 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.000/1.200/3.000/0.980 ms # Display ADVPN tunnel information on Spoke 1. [Spoke1] display advpn ipv6 session Interface : Tunnel1 Number of sessions: 3 Private address Public address Port Type State Holding time 192:168::1 1::1 -- S-H Success 0H 46M 8S 192:168::2 1::2 -- S-H Success 0H 46M 8S ::4 1::4 -- S-S Success 0H 0M 1S The output shows that: Spoke 1 has established permanent hub-spoke tunnels to Hub 1 and Hub 2. Spoke 1 and Spoke 2 have established a temporary spoke-spoke tunnel. 347
361 IPv4 hub-spoke ADVPN configuration example Network requirements As shown in Figure 138, the primary and secondary VAM servers manage and maintain VAM client information for all hubs and spokes. The AAA server performs authentication and accounting for VAM clients. The two hubs back up each other, and perform data forwarding and route exchange. Each spoke establishes a permanent ADVPN tunnel to each hub. Figure 138 Network diagram Table 14 Interface and IP address assignment Device Interface IP address Device Interface IP address Hub 1 GE1/0/ /24 Spoke 1 GE1/0/ /24 Tunnel /24 GE1/0/ /24 Hub 2 GE1/0/ /24 Tunnel /24 Tunnel /24 Spoke 2 GE1/0/ /24 AAA server /24 GE1/0/ /24 Primary server GE1/0/ /24 Tunnel /24 Secondary server GE1/0/ /24 Configuring the primary VAM server 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure AAA: # Configure RADIUS scheme abc. <PrimaryServer> system-view [PrimaryServer] radius scheme abc [PrimaryServer-radius-abc] primary authentication
362 [PrimaryServer-radius-abc] primary accounting [PrimaryServer-radius-abc] key authentication simple 123 [PrimaryServer-radius-abc] key accounting simple 123 [PrimaryServer-radius-abc] user-name-format without-domain [PrimaryServer-radius-abc] quit [PrimaryServer] radius session-control enable # Configure AAA methods for the ISP domain abc. [PrimaryServer] domain abc [PrimaryServer-isp-abc] authentication advpn radius-scheme abc [PrimaryServer-isp-abc] accounting advpn radius-scheme abc [PrimaryServer-isp-abc] quit [PrimaryServer] domain default enable abc 3. Configure the VAM server: # Create ADVPN domain abc. [PrimaryServer] vam server advpn-domain abc id 1 # Create hub group 0. [PrimaryServer-vam-server-domain-abc] hub-group 0 # Specify hub private addresses. [PrimaryServer-vam-server-domain-abc-hub-group-0] hub private-address [PrimaryServer-vam-server-domain-abc-hub-group-0] hub private-address # Specify a spoke private network. [PrimaryServer-vam-server-domain-abc-hub-group-0] spoke private-address network [PrimaryServer-vam-server-domain-abc-hub-group-0] quit # Set the pre-shared key to [PrimaryServer-vam-server-domain-abc] pre-shared-key simple # Set the authentication mode to CHAP. [PrimaryServer-vam-server-domain-abc] authentication-method chap # Enable the VAM server for the ADVPN domain. [PrimaryServer-vam-server-domain-abc] server enable [PrimaryServer-vam-server-domain-abc] quit Configuring the secondary VAM server # Configure the secondary VAM server in the same way that the primary server is configured. (Details not shown.) Configuring Hub 1 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client hub1. <Hub1> system-view [Hub1] vam client name Hub1 # Specify ADVPN domain abc for the VAM client. [Hub1-vam-client-Hub1] advpn-domain abc # Set the pre-shared key to [Hub1-vam-client-Hub1] pre-shared-key simple
363 # Set the username and password to hub1 [Hub1-vam-client-Hub1] user hub1 password simple hub1 # Specify the primary and secondary VAM servers. [Hub1-vam-client-Hub1] server primary ip-address [Hub1-vam-client-Hub1] server secondary ip-address # Enable the VAM client. [Hub1-vam-client-Hub1] client enable [Hub1-vam-client-Hub1] quit 3. Configure an IPsec profile: # Configure IKE. [Hub1] ike keychain abc [Hub1-ike-keychain-abc] pre-shared-key address key simple [Hub1-ike-keychain-abc] quit [Hub1] ike profile abc [Hub1-ike-profile-abc] keychain abc [Hub1-ike-profile-abc] quit # Configure the IPsec profile. [Hub1] ipsec transform-set abc [Hub1-ipsec-transform-set-abc] encapsulation-mode transport [Hub1-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Hub1-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Hub1-ipsec-transform-set-abc] quit [Hub1] ipsec profile abc isakmp [Hub1-ipsec-profile-isakmp-abc] transform-set abc [Hub1-ipsec-profile-isakmp-abc] ike-profile abc [Hub1-ipsec-profile-isakmp-abc] quit 4. Configure OSPF to advertise the private network. [Hub1] ospf 1 [Hub1-ospf-1] area 0 [Hub1-ospf-1-area ] network [Hub1-ospf-1-area ] quit [Hub1-ospf-1] quit 5. Configure GRE-mode ADVPN tunnel interface tunnel1. [Hub1] interface tunnel1 mode advpn gre [Hub1-Tunnel1] ip address [Hub1-Tunnel1] vam client Hub1 [Hub1-Tunnel1] ospf network-type p2mp [Hub1-Tunnel1] source gigabitethernet 1/0/1 [Hub1-Tunnel1] tunnel protection ipsec profile abc [Hub1-Tunnel1] undo shutdown [Hub1-Tunnel1] quit Configuring Hub 2 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client Hub2. <Hub2> system-view 350
364 [Hub2] vam client name Hub2 # Specify ADVPN domain abc for the VAM Client. [Hub2-vam-client-Hub2] advpn-domain abc # Set pre-shared key for the VAM client. [Hub2-vam-client-Hub2] pre-shared-key simple # Set the username and password to hub2. [Hub2-vam-client-Hub2] user hub2 password simple hub2 # Specify the primary and secondary VAM servers. [Hub2-vam-client-Hub2] server primary ip-address [Hub2-vam-client-Hub2] server secondary ip-address # Enable the VAM client. [Hub2-vam-client-Hub2] client enable [Hub2-vam-client-Hub2] quit 3. Configure the IPsec profile: # Configure IKE. [Hub2] ike keychain abc [Hub2-ike-keychain-abc] pre-shared-key address key simple [Hub2-ike-keychain-abc] quit [Hub2] ike profile abc [Hub2-ike-profile-abc] keychain abc [Hub2-ike-profile-abc] quit # Configure the IPsec profile. [Hub2] ipsec transform-set abc [Hub2-ipsec-transform-set-abc] encapsulation-mode transport [Hub2-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Hub2-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Hub2-ipsec-transform-set-abc] quit [Hub2] ipsec profile abc isakmp [Hub2-ipsec-profile-isakmp-abc] transform-set abc [Hub2-ipsec-profile-isakmp-abc] ike-profile abc [Hub2-ipsec-profile-isakmp-abc] quit 4. Configure OSPF to advertise the private network. [Hub2] ospf 1 [Hub2-ospf-1] area 0 [Hub2-ospf-1-area ] network [Hub2-ospf-1-area ] quit [Hub2-ospf-1] quit 5. Configure GRE-mode ADVPN tunnel interface tunnel1. [Hub2] interface tunnel1 mode advpn gre [Hub2-Tunnel1] ip address [Hub2-Tunnel1] vam client Hub2 [Hub2-Tunnel1] ospf network-type p2mp [Hub2-Tunnel1] source gigabitethernet 1/0/1 [Hub2-Tunnel1] tunnel protection ipsec profile abc [Hub2-Tunnel1] undo shutdown [Hub2-Tunnel1] quit 351
365 Configuring Spoke 1 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client spoke1. <Spoke1> system-view [Spoke1] vam client name Spoke1 # Specify ADVPN domain abc for the VAM client. [Spoke1-vam-client-Spoke1] advpn-domain abc # Configure a pre-shared key for the VAM client. [Spoke1-vam-client-Spoke1] pre-shared-key simple # Set the username and password to spoke1. [Spoke1-vam-client-Spoke1] user spoke1 password simple spoke1 # Specify the primary and secondary VAM servers. [Spoke1-vam-client-Spoke1] server primary ip-address [Spoke1-vam-client-Spoke1] server secondary ip-address # Enable the VAM client. [Spoke1-vam-client-Spoke1] client enable [Spoke1-vam-client-Spoke1] quit 3. Configure the IPsec profile: # Configure IKE. [Spoke1] ike keychain abc [Spoke1-ike-keychain-abc] pre-shared-key address key simple [Spoke1-ike-keychain-abc] quit [Spoke1] ike profile abc [Spoke1-ike-profile-abc] keychain abc [Spoke1-ike-profile-abc] quit # Configure the IPsec profile. [Spoke1] ipsec transform-set abc [Spoke1-ipsec-transform-set-abc] encapsulation-mode transport [Spoke1-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Spoke1-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Spoke1-ipsec-transform-set-abc] quit [Spoke1] ipsec profile abc isakmp [Spoke1-ipsec-profile-isakmp-abc] transform-set abc [Spoke1-ipsec-profile-isakmp-abc] ike-profile abc [Spoke1-ipsec-profile-isakmp-abc] quit 4. Configure OSPF to advertise the private networks. [Spoke1] ospf 1 [Spoke1-ospf-1] area 0 [Spoke1-ospf-1-area ] network [Spoke1-ospf-1-area ] network [Spoke1-ospf-1-area ] quit [Spoke1-ospf-1] quit 5. Configure GRE-mode ADVPN tunnel interface tunnel1. [Spoke1] interface tunnel1 mode advpn gre 352
366 [Spoke1-Tunnel1] ip address [Spoke1-Tunnel1] vam client Spoke1 [Spoke1-Tunnel1] ospf network-type p2mp [Spoke1-Tunnel1] source gigabitethernet 1/0/1 [Spoke1-Tunnel1] tunnel protection ipsec profile abc [Spoke1-Tunnel1] undo shutdown [Spoke1-Tunnel1] quit Configuring Spoke 2 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client spoke2. <Spoke2> system-view [Spoke2] vam client name Spoke2 # Specify ADVPN domain abc for the VAM client. [Spoke2-vam-client-Spoke2] advpn-domain abc # Configure a pre-shared key for the VAM client. [Spoke2-vam-client-Spoke2] pre-shared-key simple # Set the username and password to spoke2. [Spoke2-vam-client-Spoke2] user spoke2 password simple spoke2 # Specify the primary and secondary VAM servers. [Spoke2-vam-client-Spoke2] server primary ip-address [Spoke2-vam-client-Spoke2] server secondary ip-address # Enable the VAM client. [Spoke2-vam-client-Spoke2] client enable [Spoke2-vam-client-Spoke2] quit 3. Configure the IPsec profile: # Configure IKE. [Spoke2] ike keychain abc [Spoke2-ike-keychain-abc] pre-shared-key address key simple [Spoke2-ike-keychain-abc] quit [Spoke2] ike profile abc [Spoke2-ike-profile-abc] keychain abc [Spoke2-ike-profile-abc] quit # Configure the IPsec profile. [Spoke2] ipsec transform-set abc [Spoke2-ipsec-transform-set-abc] encapsulation-mode transport [Spoke2-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Spoke2-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Spoke2-ipsec-transform-set-abc] quit [Spoke2] ipsec profile abc isakmp [Spoke2-ipsec-profile-isakmp-abc] transform-set abc [Spoke2-ipsec-profile-isakmp-abc] ike-profile abc [Spoke2-ipsec-profile-isakmp-abc] quit 4. Configure OSPF to advertise the private networks. [Spoke2] ospf 1 353
367 [Spoke2-ospf-1] area 0 [Spoke2-ospf-1-area ] network [Spoke2-ospf-1-area ] network [Spoke2-ospf-1-area ] quit [Spoke2-ospf-1] quit 5. Configure GRE-mode ADVPN tunnel interface tunnel1. [Spoke2] interface tunnel1 mode advpn gre [Spoke2-Tunnel1] ip address [Spoke2-Tunnel1] vam client Spoke2 [Spoke2-Tunnel1] ospf network-type p2mp [Spoke2-Tunnel1] source gigabitethernet 1/0/1 [Spoke2-Tunnel1] tunnel protection ipsec profile abc [Spoke2-Tunnel1] undo shutdown [Spoke2-Tunnel1] quit Verifying the configuration # Display the address mapping information for all VAM clients registered with the primary VAM server. [PrimaryServer] display vam server address-map ADVPN domain name: 1 Total private address mappings: 4 Group Private address Public address Type NAT Holding time Hub No 0H 52M 7S Hub No 0H 47M 31S Spoke No 0H 28M 25S Spoke No 0H 19M 15S # Display the address mapping information for all VAM clients registered with the secondary VAM server. [SecondaryServer] display vam server address-map ADVPN domain name: 1 Total private address mappings: 4 Group Private address Public address Type NAT Holding time Hub No 0H 52M 7S Hub No 0H 47M 31S Spoke No 0H 28M 25S Spoke No 0H 19M 15S The above output shows that Hub 1, Hub 2, Spoke 1, Spoke 2, and Spoke 3 all have registered their address mapping information with the VAM servers. # Display the ADVPN tunnel information for Hub 1. [Hub1] display advpn session Interface : Tunnel1 Number of sessions: 3 Private address Public address Port Type State Holding time H-H Success 0H 46M 8S H-S Success 0H 27M 27S H-S Success 0H 18M 18S The output shows that Hub 1 has established a permanent tunnel to Hub 2, Spoke 1, and Spoke 2. The ADVPN tunnel information for Hub 2 is similar to that of Hub
368 # Display the ADVPN tunnel information for Spoke 1. [Spoke1] display advpn session Interface : Tunnel1 Number of sessions: 2 Private address Public address Port Type State Holding time S-H Success 0H 46M 8S S-H Success 0H 46M 8S The output shows that Spoke 1 has established a permanent hub-spoke tunnel to Hub 1 and Hub 2. # Ping the private address of Spoke 2 from Spoke 1. [Spoke2] ping Ping ( ): 56 data bytes, press CTRL_C to break 56 bytes from : icmp_seq=0 ttl=255 time=4.000 ms 56 bytes from : icmp_seq=1 ttl=255 time=0.000 ms 56 bytes from : icmp_seq=2 ttl=255 time=0.000 ms 56 bytes from : icmp_seq=3 ttl=255 time=0.000 ms 56 bytes from : icmp_seq=4 ttl=255 time=1.000 ms --- Ping statistics for packets transmitted, 5 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.000/1.000/4.000/1.549 ms IPv6 hub-spoke ADVPN configuration example Network requirements As shown in Figure 139, the primary and secondary VAM servers manage and maintain VAM client information for all hubs and spokes. The AAA server performs authentication and accounting for VAM clients. The two hubs back up each other, and perform data forwarding and route exchange. Each spoke establishes a permanent ADVPN tunnel to each hub. Figure 139 Network diagram 355
369 Table 15 Interface and IP address assignment Device Interface IP address Device Interface IP address Hub 1 GE1/0/1 1::1/64 Spoke 1 GE1/0/1 1::3/64 Tunnel1 192:168::1/64 GE1/0/2 192:168:1::1/64 Hub 2 GE1/0/1 1::2/64 Tunnel1 192:168::3/64 Tunnel1 192:168::2/64 Spoke 2 GE1/0/1 1::4/64 AAA server 1::10/64 GE1/0/2 192:168:2::1/64 Primary server GE1/0/1 1::11/64 Tunnel1 192:168::4/64 Secondary server GE1/0/1 1::12/64 Configuring the primary VAM server 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure AAA: # Configure RADIUS scheme abc. <PrimaryServer> system-view [PrimaryServer] radius scheme abc [PrimaryServer-radius-abc] primary authentication ipv6 1:: [PrimaryServer-radius-abc] primary accounting ipv6 1:: [PrimaryServer-radius-abc] key authentication simple 123 [PrimaryServer-radius-abc] key accounting simple 123 [PrimaryServer-radius-abc] user-name-format without-domain [PrimaryServer-radius-abc] quit [PrimaryServer] radius session-control enable # Configure AAA methods for the ISP domain abc. [PrimaryServer] domain abc [PrimaryServer-isp-abc] authentication advpn radius-scheme abc [PrimaryServer-isp-abc] accounting advpn radius-scheme abc [PrimaryServer-isp-abc] quit [PrimaryServer] domain default enable abc 3. Configure the VAM server: # Create ADVPN domain abc. [PrimaryServer] vam server advpn-domain abc id 1 # Create hub group 0. [PrimaryServer-vam-server-domain-abc] hub-group 0 # Specify hub private addresses. [PrimaryServer-vam-server-domain-abc-hub-group-0] hub ipv6 private-address 192:168::1 [PrimaryServer-vam-server-domain-abc-hub-group-0] hub ipv6 private-address 192:168::2 # Specify a spoke private network. [PrimaryServer-vam-server-domain-abc-hub-group-0] spoke ipv6 private-address network 192:168::0 64 [PrimaryServer-vam-server-domain-abc-hub-group-0] quit 356
370 # Set the pre-shared key to [PrimaryServer-vam-server-domain-abc] pre-shared-key simple # Set the authentication mode to CHAP. [PrimaryServer-vam-server-domain-abc] authentication-method chap # Enable the VAM server for the ADVPN domain. [PrimaryServer-vam-server-domain-abc] server enable [PrimaryServer-vam-server-domain-abc] quit Configuring the secondary VAM server # Configure the secondary VAM server in the same way that the primary server is configured. (Details not shown.) Configuring Hub 1 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client hub1. <Hub1> system-view [Hub1] vam client name Hub1 # Specify ADVPN domain abc for the VAM client. [Hub1-vam-client-Hub1] advpn-domain abc # Set the pre-shared key to [Hub1-vam-client-Hub1] pre-shared-key simple # Set the username and password to hub1 [Hub1-vam-client-Hub1] user hub1 password simple hub1 # Specify the primary and secondary VAM servers. [Hub1-vam-client-Hub1] server primary ipv6-address 1::11 [Hub1-vam-client-Hub1] server secondary ipv6-address 1::12 # Enable the VAM client. [Hub1-vam-client-Hub1] client enable [Hub1-vam-client-Hub1] quit 3. Configure an IPsec profile: # Configure IKE. [Hub1] ike keychain abc [Hub1-ike-keychain-abc] pre-shared-key address ipv6 :: 0 key simple [Hub1-ike-keychain-abc] quit [Hub1] ike profile abc [Hub1-ike-profile-abc] keychain abc [Hub1-ike-profile-abc] quit # Configure the IPsec profile. [Hub1] ipsec transform-set abc [Hub1-ipsec-transform-set-abc] encapsulation-mode transport [Hub1-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Hub1-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Hub1-ipsec-transform-set-abc] quit [Hub1] ipsec profile abc isakmp [Hub1-ipsec-profile-isakmp-abc] transform-set abc 357
371 [Hub1-ipsec-profile-isakmp-abc] ike-profile abc [Hub1-ipsec-profile-isakmp-abc] quit 4. Configure OSPFv3. [Hub1] ospfv3 1 [Hub1-ospfv3-1] router-id [Hub1-ospfv3-1] area 0 [Hub1-ospfv3-1-area ] quit [Hub1-ospfv3-1] quit 5. Configure GRE-mode ADVPN tunnel interface tunnel1. [Hub1] interface tunnel1 mode advpn gre ipv6 [Hub1-Tunnel1] ipv6 address 192:168::1 64 [Hub1-Tunnel1] ipv6 address fe80::1 link-local [Hub1-Tunnel1] vam ipv6 client Hub1 [Hub1-Tunnel1] ospfv3 1 area 0 [Hub1-Tunnel1] ospfv3 network-type p2mp [Hub1-Tunnel1] source gigabitethernet 1/0/1 [Hub1-Tunnel1] tunnel protection ipsec profile abc [Hub1-Tunnel1] undo shutdown [Hub1-Tunnel1] quit Configuring Hub 2 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client Hub2. <Hub2> system-view [Hub2] vam client name Hub2 # Specify ADVPN domain abc for the VAM Client. [Hub2-vam-client-Hub2] advpn-domain abc # Set pre-shared key for the VAM client. [Hub2-vam-client-Hub2] pre-shared-key simple # Set the username and password to hub2. [Hub2-vam-client-Hub2] user hub2 password simple hub2 # Specify the primary and secondary VAM servers. [Hub2-vam-client-Hub2] server primary ipv6-address 1::11 [Hub2-vam-client-Hub2] server secondary ipv6-address 1::12 # Enable the VAM client. [Hub2-vam-client-Hub2] client enable [Hub2-vam-client-Hub2] quit 3. Configure the IPsec profile: # Configure IKE. [Hub2] ike keychain abc [Hub2-ike-keychain-abc] pre-shared-key address ipv6 :: 0 key simple [Hub2-ike-keychain-abc] quit [Hub2] ike profile abc [Hub2-ike-profile-abc] keychain abc [Hub2-ike-profile-abc] quit 358
372 # Configure the IPsec profile. [Hub2] ipsec transform-set abc [Hub2-ipsec-transform-set-abc] encapsulation-mode transport [Hub2-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Hub2-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Hub2-ipsec-transform-set-abc] quit [Hub2] ipsec profile abc isakmp [Hub2-ipsec-profile-isakmp-abc] transform-set abc [Hub2-ipsec-profile-isakmp-abc] ike-profile abc [Hub2-ipsec-profile-isakmp-abc] quit 4. Configure OSPFv3. [Hub2] ospfv3 1 [Hub2-ospfv3-1] router-id [Hub2-ospfv3-1] area 0 [Hub2-ospfv3-1-area ] quit [Hub2-ospfv3-1] quit 5. Configure GRE-mode ADVPN tunnel interface tunnel1. [Hub2] interface tunnel1 mode advpn gre ipv6 [Hub2-Tunnel1] ipv6 address 192:168::2 64 [Hub2-Tunnel1] ipv6 address fe80::2 link-local [Hub2-Tunnel1] vam ipv6 client Hub2 [Hub2-Tunnel1] ospfv3 1 area 0 [Hub2-Tunnel1] ospfv3 network-type p2mp [Hub2-Tunnel1] source gigabitethernet 1/0/1 [Hub2-Tunnel1] tunnel protection ipsec profile abc [Hub2-Tunnel1] undo shutdown [Hub2-Tunnel1] quit Configuring Spoke 1 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client spoke1. <Spoke1> system-view [Spoke1] vam client name Spoke1 # Specify ADVPN domain abc for the VAM client. [Spoke1-vam-client-Spoke1] advpn-domain abc # Configure a pre-shared key for the VAM client. [Spoke1-vam-client-Spoke1] pre-shared-key simple # Set the username and password to spoke1. [Spoke1-vam-client-Spoke1] user spoke1 password simple spoke1 # Specify the primary and secondary VAM servers. [Spoke1-vam-client-Spoke1] server primary ipv6-address 1::11 [Spoke1-vam-client-Spoke1] server secondary ipv6-address 1::12 # Enable the VAM client. [Spoke1-vam-client-Spoke1] client enable [Spoke1-vam-client-Spoke1] quit 359
373 3. Configure the IPsec profile: # Configure IKE. [Spoke1] ike keychain abc [Spoke1-ike-keychain-abc] pre-shared-key address ipv6 :: 0 key simple [Spoke1-ike-keychain-abc] quit [Spoke1] ike profile abc [Spoke1-ike-profile-abc] keychain abc [Spoke1-ike-profile-abc] quit # Configure the IPsec profile. [Spoke1] ipsec transform-set abc [Spoke1-ipsec-transform-set-abc] encapsulation-mode transport [Spoke1-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Spoke1-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Spoke1-ipsec-transform-set-abc] quit [Spoke1] ipsec profile abc isakmp [Spoke1-ipsec-profile-isakmp-abc] transform-set abc [Spoke1-ipsec-profile-isakmp-abc] ike-profile abc [Spoke1-ipsec-profile-isakmp-abc] quit 4. Configure OSPFv3. [Spoke1] ospfv3 1 [Spoke1-ospfv3-1] router-id [Spoke1-ospfv3-1] area 0 [Spoke1-ospfv3-1-area ] quit [Spoke1-ospfv3-1] quit 5. Configure GRE-mode ADVPN tunnel interface tunnel1. [Spoke1] interface tunnel1 mode advpn gre ipv6 [Spoke1-Tunnel1] ipv6 address 192:168::3 64 [Spoke1-Tunnel1] ipv6 address fe80::3 link-local [Spoke1-Tunnel1] vam ipv6 client Spoke1 [Spoke1-Tunnel1] ospfv3 1 area 0 [Spoke1-Tunnel1] ospfv3 network-type p2mp [Spoke1-Tunnel1] source gigabitethernet 1/0/1 [Spoke1-Tunnel1] tunnel protection ipsec profile abc [Spoke1-Tunnel1] undo shutdown [Spoke1-Tunnel1] quit Configuring Spoke 2 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client spoke2. <Spoke2> system-view [Spoke2] vam client name Spoke2 # Specify ADVPN domain abc for the VAM client. [Spoke2-vam-client-Spoke2] advpn-domain abc # Configure a pre-shared key for the VAM client. [Spoke2-vam-client-Spoke2] pre-shared-key simple # Set the username and password to spoke2. 360
374 [Spoke2-vam-client-Spoke2] user spoke2 password simple spoke2 # Specify the primary and secondary VAM servers. [Spoke2-vam-client-Spoke2] server primary ipv6-address 1::11 [Spoke2-vam-client-Spoke2] server secondary ipv6-address 1::12 # Enable the VAM client. [Spoke2-vam-client-Spoke2] client enable [Spoke2-vam-client-Spoke2] quit 3. Configure the IPsec profile: # Configure IKE. [Spoke2] ike keychain abc [Spoke2-ike-keychain-abc] pre-shared-key address ipv6 :: 0 key simple [Spoke2-ike-keychain-abc] quit [Spoke2] ike profile abc [Spoke2-ike-profile-abc] keychain abc [Spoke2-ike-profile-abc] quit # Configure the IPsec profile. [Spoke2] ipsec transform-set abc [Spoke2-ipsec-transform-set-abc] encapsulation-mode transport [Spoke2-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Spoke2-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Spoke2-ipsec-transform-set-abc] quit [Spoke2] ipsec profile abc isakmp [Spoke2-ipsec-profile-isakmp-abc] transform-set abc [Spoke2-ipsec-profile-isakmp-abc] ike-profile abc [Spoke2-ipsec-profile-isakmp-abc] quit 4. Configure OSPFv3. [Spoke2] ospfv3 1 [Spoke2-ospfv3-1] router-id [Spoke2-ospfv3-1] area 0 [Spoke2-ospfv3-1-area ] quit [Spoke2-ospfv3-1] quit 5. Configure GRE-mode ADVPN tunnel interface tunnel1. [Spoke2] interface tunnel1 mode advpn gre ipv6 [Spoke2-Tunnel1] ipv6 address 192:168::4 64 [Spoke2-Tunnel1] ipv6 address fe80::4 link-local [Spoke2-Tunnel1] vam ipv6 client Spoke2 [Spoke2-Tunnel1] ospfv3 1 area 0 [Spoke2-Tunnel1] ospfv3 network-type p2mp [Spoke2-Tunnel1] source gigabitethernet 1/0/1 [Spoke2-Tunnel1] tunnel protection ipsec profile abc [Spoke2-Tunnel1] undo shutdown [Spoke2-Tunnel1] quit Verifying the configuration # Display the address mapping information for all VAM clients registered with the primary VAM server. [PrimaryServer] display vam server ipv6 address-map ADVPN domain name: 1 361
375 Total private address mappings: 4 Group Private address Public address Type NAT Holding time 0 192:168::1 1::1 Hub No 0H 52M 7S 0 192:168::2 1::2 Hub No 0H 47M 31S 0 192:168::3 1::3 Spoke No 0H 28M 25S 0 192:168::4 1::4 Spoke No 0H 19M 15S # Display the address mapping information for all VAM clients registered with the secondary VAM server. [SecondaryServer] display vam server ipv6 address-map ADVPN domain name: 1 Total private address mappings: 4 Group Private address Public address Type NAT Holding time 0 192:168::1 1::1 Hub No 0H 52M 7S 0 192:168::2 1::2 Hub No 0H 47M 31S 0 192:168::3 1::3 Spoke No 0H 28M 25S 0 192:168::4 1::4 Spoke No 0H 19M 15S The above output shows that Hub 1, Hub 2, Spoke 1, Spoke 2, and Spoke 3 all have registered their address mapping information with the VAM servers. # Display the ADVPN tunnel information for Hub 1. [Hub1] display advpn ipv6 session Interface : Tunnel1 Number of sessions: 3 Private address Public address Port Type State Holding time 192:168::2 1::2 -- H-H Success 0H 46M 8S 192:168::3 1::3 -- H-S Success 0H 27M 27S 192:168::4 1::4 -- H-S Success 0H 18M 18S The output shows that Hub 1 has established a permanent tunnel to Hub 2, Spoke 1, and Spoke 2. The ADVPN tunnel information for Hub 2 is similar to that of Hub 1. # Display the ADVPN tunnel information for Spoke 1. [Spoke1] display advpn ipv6 session Interface : Tunnel1 Number of sessions: 2 Private address Public address Port Type State Holding time 192:168::1 1::1 -- S-H Success 0H 46M 8S 192:168::2 1::2 -- S-H Success 0H 46M 8S The output shows that Spoke 1 has established a permanent hub-spoke tunnel to Hub 1 and Hub 2. # Ping the private address 192:168::4 of Spoke 2 from Spoke 1. [Spoke2] ping ipv6 192:168::4 Ping6(56 data bytes) 192:168::4 --> 192:168::4, press CTRL_C to break 56 bytes from 192:168::4, icmp_seq=0 hlim=64 time=3.000 ms 56 bytes from 192:168::4, icmp_seq=1 hlim=64 time=0.000 ms 56 bytes from 192:168::4, icmp_seq=2 hlim=64 time=1.000 ms 56 bytes from 192:168::4, icmp_seq=3 hlim=64 time=1.000 ms 56 bytes from 192:168::4, icmp_seq=4 hlim=64 time=1.000 ms --- Ping6 statistics for 192:168::
376 5 packets transmitted, 5 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.000/1.200/3.000/0.980 ms IPv4 multi-hub-group ADVPN configuration example Network requirements As shown in Figure 140, the primary and secondary VAM servers manage and maintain VAM client information for all hubs and spokes. The AAA server performs authentication and accounting for VAM clients. Configure three hub groups to accommodate all ADVPN nodes: Hub group 0 contains Hub 1, Hub 2, and Hub 3. Hub group 1 contains Hub 1, Hub 2, Spoke 1, and Spoke 2. Hub 1 and Hub 2 back up each other. Hub group 2 contains Hub 3, Spoke 3, and Spoke 4. Hub groups 1 and 2 use full-mesh networking. Any two spokes can establish a direct spoke-spoke tunnel. Figure 140 Network diagram Table 16 Interface and IP address assignment Device Interface IP address Device Interface IP address Hub 1 GE1/0/ /24 Spoke 1 GE1/0/ /24 Tunnel /24 GE1/0/ /24 Tunnel /24 Tunnel /24 363
377 Device Interface IP address Device Interface IP address Hub 2 GE1/0/ /24 Spoke 2 GE1/0/ /24 Tunnel /24 GE1/0/ /24 Tunnel /24 GE1/0/ /24 Hub 3 GE1/0/ /24 Tunnel /24 Tunnel /24 Spoke 3 GE1/0/ /24 Tunnel /24 GE1/0/ /24 AAA server /24 Tunnel /24 Primary server GE1/0/ /24 Spoke 4 GE1/0/ /24 Secondary server GE1/0/ /24 GE1/0/ /24 GE1/0/ /24 Tunnel /24 Configuring the primary VAM server 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure AAA: # Configure RADIUS scheme abc. <PrimaryServer> system-view [PrimaryServer] radius scheme abc [PrimaryServer-radius-abc] primary authentication [PrimaryServer-radius-abc] primary accounting [PrimaryServer-radius-abc] key authentication simple 123 [PrimaryServer-radius-abc] key accounting simple 123 [PrimaryServer-radius-abc] user-name-format without-domain [PrimaryServer-radius-abc] quit [PrimaryServer] radius session-control enable # Configure AAA methods for the ISP domain abc. [PrimaryServer] domain abc [PrimaryServer-isp-abc] authentication advpn radius-scheme abc [PrimaryServer-isp-abc] accounting advpn radius-scheme abc [PrimaryServer-isp-abc] quit [PrimaryServer] domain default enable abc 3. Configure the VAM server: # Create ADVPN domain abc. [PrimaryServer] vam server advpn-domain abc id 1 # Create hub group 0. [PrimaryServer-vam-server-domain-abc] hub-group 0 # Specify hub private addresses. [PrimaryServer-vam-server-domain-abc-hub-group-0] hub private-address [PrimaryServer-vam-server-domain-abc-hub-group-0] hub private-address [PrimaryServer-vam-server-domain-abc-hub-group-0] hub private-address [PrimaryServer-vam-server-domain-abc-hub-group-0] quit 364
378 # Create hub group 1. [PrimaryServer-vam-server-domain-abc] hub-group 1 # Specify hub private addresses. [PrimaryServer-vam-server-domain-abc-hub-group-1] hub private-address [PrimaryServer-vam-server-domain-abc-hub-group-1] hub private-address # Specify a spoke private network. [PrimaryServer-vam-server-domain-abc-hub-group-1] spoke private-address network # Allow establishing spoke-spoke tunnels. [PrimaryServer-vam-server-domain-abc-hub-group-1] shortcut interest all [PrimaryServer-vam-server-domain-abc-hub-group-1] quit # Create hub group 2. [PrimaryServer-vam-server-domain-abc] hub-group 2 # Specify the hub private address. [PrimaryServer-vam-server-domain-abc-hub-group-2] hub private-address # Specify a spoke private network. Allow establishing direct spoke-spoke tunnels. [PrimaryServer-vam-server-domain-abc-hub-group-2] spoke private-address network [PrimaryServer-vam-server-domain-abc-hub-group-2] shortcut interest all [PrimaryServer-vam-server-domain-abc-hub-group-2] quit # Set the pre-shared key to [PrimaryServer-vam-server-domain-abc] pre-shared-key simple # Set the authentication mode to CHAP. [PrimaryServer-vam-server-domain-abc] authentication-method chap # Enable the VAM server for the ADVPN domain. [PrimaryServer-vam-server-domain-abc] server enable [PrimaryServer-vam-server-domain-abc] quit Configuring the secondary VAM server # Configure the secondary VAM server in the same way that the primary server is configured. (Details not shown.) Configuring Hub 1 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client hub1group0. <Hub1> system-view [Hub1] vam client name Hub1Group0 # Specify ADVPN domain abc for the VAM client. [Hub1-vam-client-Hub1Group0] advpn-domain abc # Set the pre-shared key to [Hub1-vam-client-Hub1Group0] pre-shared-key simple # Set the username and password to hub1 [Hub1-vam-client-Hub1Group0] user hub1 password simple hub1 # Specify the primary and secondary VAM servers. [Hub1-vam-client-Hub1Group0] server primary ip-address
379 [Hub1-vam-client-Hub1Group0] server secondary ip-address # Enable the VAM client. [Hub1-vam-client-Hub1Group0] client enable [Hub1-vam-client-Hub1Group0] quit # Create VAM client Hub1Group1. [Hub1] vam client name Hub1Group1 # Specify ADVPN domain abc for the VAM client. [Hub1-vam-client-Hub1Group1] advpn-domain abc # Set the pre-shared key to [Hub1-vam-client-Hub1Group1] pre-shared-key simple # Set the username and password to hub1 [Hub1-vam-client-Hub1Group1] user hub1 password simple hub1 # Specify the primary and secondary VAM servers. [Hub1-vam-client-Hub1Group1] server primary ip-address [Hub1-vam-client-Hub1Group1] server secondary ip-address # Enable the VAM client. [Hub1-vam-client-Hub1Group1] client enable [Hub1-vam-client-Hub1Group1] quit 3. Configure an IPsec profile: # Configure IKE. [Hub1] ike keychain abc [Hub1-ike-keychain-abc] pre-shared-key address key simple [Hub1-ike-keychain-abc] quit [Hub1] ike profile abc [Hub1-ike-profile-abc] keychain abc [Hub1-ike-profile-abc] quit # Configure the IPsec profile. [Hub1] ipsec transform-set abc [Hub1-ipsec-transform-set-abc] encapsulation-mode transport [Hub1-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Hub1-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Hub1-ipsec-transform-set-abc] quit [Hub1] ipsec profile abc isakmp [Hub1-ipsec-profile-isakmp-abc] transform-set abc [Hub1-ipsec-profile-isakmp-abc] ike-profile abc [Hub1-ipsec-profile-isakmp-abc] quit 4. Configure OSPF to advertise the private networks. [Hub1] ospf 1 [Hub1-ospf-1] area 0 [Hub1-ospf-1-area ] network [Hub1-ospf-1-area ] quit [Hub1-ospf-1] area 1 [Hub1-ospf-1-area ] network [Hub1-ospf-1-area ] quit [Hub1-ospf-1] quit 5. Configure an ADVPN tunnel: 366
380 # Configure UDP-mode ADVPN tunnel interface tunnel1. [Hub1] interface tunnel1 mode advpn udp [Hub1-Tunnel1] ip address [Hub1-Tunnel1] vam client Hub1Group1 [Hub1-Tunnel1] ospf network-type broadcast [Hub1-Tunnel1] source gigabitethernet 1/0/1 [Hub1-Tunnel1] tunnel protection ipsec profile abc [Hub1-Tunnel1] undo shutdown [Hub1-Tunnel1] quit # Configure UDP-mode ADVPN tunnel interface tunnel2. [Hub1] interface tunnel2 mode advpn udp [Hub1-Tunnel1] ip address [Hub1-Tunnel1] vam client Hub1Group0 [Hub1-Tunnel1] ospf network-type broadcast [Hub1-Tunnel1] source gigabitethernet 1/0/1 [Hub1-Tunnel1] tunnel protection ipsec profile abc [Hub1-Tunnel1] undo shutdown [Hub1-Tunnel1] quit Configuring Hub 2 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client Hub2Group0. <Hub2> system-view [Hub2] vam client name Hub2Group0 # Specify ADVPN domain abc for the VAM Client. [Hub2-vam-client-Hub2Group0] advpn-domain abc # Set pre-shared key for the VAM client. [Hub2-vam-client-Hub2Group0] pre-shared-key simple # Set the username and password to hub2. [Hub2-vam-client-Hub2Group0] user hub2 password simple hub2 # Specify the primary and secondary VAM servers. [Hub2-vam-client-Hub2Group0] server primary ip-address [Hub2-vam-client-Hub2Group0] server secondary ip-address # Enable the VAM client. [Hub2-vam-client-Hub2Group0] client enable [Hub2-vam-client-Hub2Group0] quit # Create VAM client Hub2Group1. [Hub2] vam client name Hub2Group1 # Specify ADVPN domain abc for the VAM Client. [Hub2-vam-client-Hub2Group1] advpn-domain abc # Set pre-shared key for the VAM client. [Hub2-vam-client-Hub2Group1] pre-shared-key simple # Set the username and password to hub2. [Hub2-vam-client-Hub2Group1] user Hub2 password simple Hub2 # Specify the primary and secondary VAM servers. 367
381 [Hub2-vam-client-Hub2Group1] server primary ip-address [Hub2-vam-client-Hub2Group1] server secondary ip-address # Enable the VAM client. [Hub2-vam-client-Hub2Group1] client enable [Hub2-vam-client-Hub2Group1] quit 3. Configure the IPsec profile: # Configure IKE. [Hub2] ike keychain abc [Hub2-ike-keychain-abc] pre-shared-key address key simple [Hub2-ike-keychain-abc] quit [Hub2] ike profile abc [Hub2-ike-profile-abc] keychain abc [Hub2-ike-profile-abc] quit # Configure the IPsec profile. [Hub2] ipsec transform-set abc [Hub2-ipsec-transform-set-abc] encapsulation-mode transport [Hub2-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Hub2-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Hub2-ipsec-transform-set-abc] quit [Hub2] ipsec profile abc isakmp [Hub2-ipsec-profile-isakmp-abc] transform-set abc [Hub2-ipsec-profile-isakmp-abc] ike-profile abc [Hub2-ipsec-profile-isakmp-abc] quit 4. Configure OSPF to advertise the private networks. [Hub2] ospf 1 [Hub2-ospf-1] area 0 [Hub2-ospf-1-area ] network [Hub2-ospf-1-area ] quit [Hub2-ospf-1] area 1 [Hub2-ospf-1-area ] network [Hub2-ospf-1-area ] quit [Hub2-ospf-1] quit 5. Configure the ADVPN tunnel: # Configure UDP-mode ADVPN tunnel interface tunnel1. [Hub2] interface tunnel 1 mode advpn gre [Hub2-Tunnel1] ip address [Hub2-Tunnel1] vam client Hub2 [Hub2-Tunnel1] ospf network-type broadcast [Hub2-Tunnel1] source gigabitethernet 1/0/1 [Hub2-Tunnel1] tunnel protection ipsec profile abc [Hub2-Tunnel1] undo shutdown [Hub2-Tunnel1] quit # Configure UDP-mode ADVPN tunnel interface tunnel2. [Hub2] interface tunnel2 mode advpn udp [Hub2-Tunnel1] ip address [Hub2-Tunnel1] vam client Hub2Group0 [Hub2-Tunnel1] ospf network-type broadcast 368
382 [Hub2-Tunnel1] source gigabitethernet 1/0/1 [Hub2-Tunnel1] tunnel protection ipsec profile abc [Hub2-Tunnel1] undo shutdown [Hub2-Tunnel1] quit Configuring Hub 3 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client Hub3Group0. <Hub3> system-view [Hub3] vam client name Hub3Group0 # Specify ADVPN domain abc for the VAM Client. [Hub3-vam-client-Hub3Group0] advpn-domain abc # Set pre-shared key for the VAM client. [Hub3-vam-client-Hub3Group0] pre-shared-key simple # Set the username and password to hub3. [Hub3-vam-client-Hub3Group0] user hub3 password simple hub3 # Specify the primary and secondary VAM servers. [Hub2-vam-client-Hub2Group0] server primary ip-address [Hub2-vam-client-Hub2Group0] server secondary ip-address # Enable the VAM client. [Hub2-vam-client-Hub2Group0] client enable [Hub2-vam-client-Hub2Group0] quit # Create VAM client Hub3Group1. [Hub3] vam client name Hub3Group1 # Specify ADVPN domain abc for the VAM Client. [Hub3-vam-client-Hub3Group1] advpn-domain abc # Set pre-shared key for the VAM client. [Hub3-vam-client-Hub3Group1] pre-shared-key simple # Set the username and password to hub3. [Hub3-vam-client-Hub3Group1] user hub3 password simple hub3 # Specify the primary and secondary VAM servers. [Hub3-vam-client-Hub3Group1] server primary ip-address [Hub3-vam-client-Hub3Group1] server secondary ip-address # Enable the VAM client. [Hub2-vam-client-Hub2Group1] client enable [Hub2-vam-client-Hub2Group1] quit 3. Configure the IPsec profile: # Configure IKE. [Hub3] ike keychain abc [Hub3-ike-keychain-abc] pre-shared-key address key simple [Hub3-ike-keychain-abc] quit [Hub3] ike profile abc [Hub3-ike-profile-abc] keychain abc [Hub3-ike-profile-abc] quit 369
383 # Configure the IPsec profile. [Hub3] ipsec transform-set abc [Hub3-ipsec-transform-set-abc] encapsulation-mode transport [Hub3-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Hub3-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Hub3-ipsec-transform-set-abc] quit [Hub3] ipsec profile abc isakmp [Hub3-ipsec-profile-isakmp-abc] transform-set abc [Hub3-ipsec-profile-isakmp-abc] ike-profile abc [Hub3-ipsec-profile-isakmp-abc] quit 4. Configure OSPF to advertise the private networks. [Hub3] ospf 1 [Hub3-ospf-1] area 0 [Hub3-ospf-1-area ] network [Hub3-ospf-1-area ] quit [Hub3-ospf-1] area 2 [Hub3-ospf-1-area ] network [Hub3-ospf-1-area ] quit [Hub3-ospf-1] quit 5. Configure the ADVPN tunnel: # Configure UDP-mode ADVPN tunnel interface tunnel1. [Hub3] interface tunnel1 mode advpn udp [Hub3-Tunnel1] ip address [Hub3-Tunnel1] vam client Hub3Group1 [Hub3-Tunnel1] ospf network-type broadcast [Hub3-Tunnel1] source gigabitethernet 1/0/1 [Hub3-Tunnel1] tunnel protection ipsec profile abc [Hub3-Tunnel1] undo shutdown [Hub3-Tunnel1] quit # Configure UDP-mode ADVPN tunnel interface tunnel2. [Hub3] interface tunnel1 mode advpn udp [Hub3-Tunnel1] ip address [Hub3-Tunnel1] vam client Hub3Group0 [Hub3-Tunnel1] ospf network-type broadcast [Hub3-Tunnel1] source gigabitethernet 1/0/1 [Hub3-Tunnel1] tunnel protection ipsec profile abc [Hub3-Tunnel1] undo shutdown [Hub3-Tunnel1] quit Configuring Spoke 1 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client spoke1. <Spoke1> system-view [Spoke1] vam client name Spoke1 # Specify ADVPN domain abc for the VAM client. [Spoke1-vam-client-Spoke1] advpn-domain abc 370
384 # Configure a pre-shared key for the VAM client. [Spoke1-vam-client-Spoke1] pre-shared-key simple # Set the username and password to spoke1. [Spoke1-vam-client-Spoke1] user spoke1 password simple spoke1 # Specify the primary and secondary VAM servers. [Spoke1-vam-client-Spoke1] server primary ip-address [Spoke1-vam-client-Spoke1] server secondary ip-address # Enable the VAM client. [Spoke1-vam-client-Spoke1] client enable [Spoke1-vam-client-Spoke1] quit 3. Configure the IPsec profile: # Configure IKE. [Spoke1] ike keychain abc [Spoke1-ike-keychain-abc] pre-shared-key address key simple [Spoke1-ike-keychain-abc] quit [Spoke1] ike profile abc [Spoke1-ike-profile-abc] keychain abc [Spoke1-ike-profile-abc] quit # Configure the IPsec profile. [Spoke1] ipsec transform-set abc [Spoke1-ipsec-transform-set-abc] encapsulation-mode transport [Spoke1-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Spoke1-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Spoke1-ipsec-transform-set-abc] quit [Spoke1] ipsec profile abc isakmp [Spoke1-ipsec-profile-isakmp-abc] transform-set abc [Spoke1-ipsec-profile-isakmp-abc] ike-profile abc [Spoke1-ipsec-profile-isakmp-abc] quit 4. Configure OSPF to advertise the private networks. [Spoke1] ospf 1 [Spoke1-ospf-1] area 1 [Spoke1-ospf-1-area ] network [Spoke1-ospf-1-area ] network [Spoke1-ospf-1-area ] quit [Spoke1-ospf-1] quit 5. Configure UDP-mode ADVPN tunnel interface tunnel1. Configure its DR priority as 0 so Spoke1 will not participate in DR/BDR election. [Spoke1] interface tunnel1 mode advpn udp [Spoke1-Tunnel1] ip address [Spoke1-Tunnel1] vam client Spoke1 [Spoke1-Tunnel1] ospf network-type broadcast [Spoke1-Tunnel1] ospf dr-priority 0 [Spoke1-Tunnel1] advpn network [Spoke1-Tunnel1] source gigabitethernet 1/0/1 [Spoke1-Tunnel1] tunnel protection ipsec profile abc [Spoke1-Tunnel1] undo shutdown [Spoke1-Tunnel1] quit 371
385 Configuring Spoke 2 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client spoke2. <Spoke2> system-view [Spoke2] vam client name Spoke2 # Specify ADVPN domain abc for the VAM client. [Spoke2-vam-client-Spoke2] advpn-domain abc # Configure a pre-shared key for the VAM client. [Spoke2-vam-client-Spoke2] pre-shared-key simple # Set the username and password to spoke2. [Spoke2-vam-client-Spoke2] user spoke2 password simple spoke2 # Specify the primary and secondary VAM servers. [Spoke2-vam-client-Spoke2] server primary ip-address [Spoke2-vam-client-Spoke2] server secondary ip-address # Enable the VAM client. [Spoke2-vam-client-Spoke2] client enable [Spoke2-vam-client-Spoke2] quit 3. Configure the IPsec profile: # Configure IKE. [Spoke2] ike keychain abc [Spoke2-ike-keychain-abc] pre-shared-key address key simple [Spoke2-ike-keychain-abc] quit [Spoke2] ike profile abc [Spoke2-ike-profile-abc] keychain abc [Spoke2-ike-profile-abc] quit # Configure the IPsec profile. [Spoke2] ipsec transform-set abc [Spoke2-ipsec-transform-set-abc] encapsulation-mode transport [Spoke2-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Spoke2-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Spoke2-ipsec-transform-set-abc] quit [Spoke2] ipsec profile abc isakmp [Spoke2-ipsec-profile-isakmp-abc] transform-set abc [Spoke2-ipsec-profile-isakmp-abc] ike-profile abc [Spoke2-ipsec-profile-isakmp-abc] quit 4. Configure OSPF to advertise the private networks. [Spoke2] ospf 1 [Spoke2-ospf-1] area 1 [Spoke2-ospf-1-area ] network [Spoke2-ospf-1-area ] network [Spoke2-ospf-1-area ] network [Spoke2-ospf-1-area ] quit [Spoke2-ospf-1] quit 372
386 5. Configure UDP-mode ADVPN tunnel interface tunnel1. Configure its DR priority as 0 so Spoke2 will not participate in DR/BDR election. Configuring Spoke 3 [Spoke2] interface tunnel1 mode advpn udp [Spoke2-Tunnel1] ip address [Spoke2-Tunnel1] vam client Spoke2 [Spoke2-Tunnel1] ospf network-type broadcast [Spoke2-Tunnel1] ospf dr-priority 0 [Spoke2-Tunnel1] advpn network [Spoke2-Tunnel1] advpn network [Spoke2-Tunnel1] source gigabitethernet 1/0/1 [Spoke2-Tunnel1] tunnel protection ipsec profile abc [Spoke2-Tunnel1] undo shutdown [Spoke2-Tunnel1] quit 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client spoke3. <Spoke3> system-view [Spoke3] vam client name Spoke3 # Specify ADVPN domain abc for the VAM client. [Spoke3-vam-client-Spoke3] advpn-domain abc # Configure a pre-shared key for the VAM client. [Spoke3-vam-client-Spoke3] pre-shared-key simple # Set the username and password to spoke3. [Spoke3-vam-client-Spoke3] user spoke3 password simple spoke3 # Specify the primary and secondary VAM servers. [Spoke3-vam-client-Spoke3] server primary ip-address [Spoke3-vam-client-Spoke3] server secondary ip-address # Enable the VAM client. [Spoke3-vam-client-Spoke3] client enable [Spoke3-vam-client-Spoke3] quit 3. Configure the IPsec profile: # Configure IKE. [Spoke3] ike keychain abc [Spoke3-ike-keychain-abc] pre-shared-key address key simple [Spoke3-ike-keychain-abc] quit [Spoke3] ike profile abc [Spoke3-ike-profile-abc] keychain abc [Spoke3-ike-profile-abc] quit # Configure the IPsec profile. [Spoke3] ipsec transform-set abc [Spoke3-ipsec-transform-set-abc] encapsulation-mode transport [Spoke3-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Spoke3-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Spoke3-ipsec-transform-set-abc] quit 373
387 [Spoke3] ipsec profile abc isakmp [Spoke3-ipsec-profile-isakmp-abc] transform-set abc [Spoke3-ipsec-profile-isakmp-abc] ike-profile abc [Spoke3-ipsec-profile-isakmp-abc] quit 4. Configure OSPF to advertise the private networks. [Spoke3] ospf 1 [Spoke3-ospf-1] area 2 [Spoke3-ospf-1-area ] network [Spoke3-ospf-1-area ] network [Spoke3-ospf-1-area ] quit [Spoke3-ospf-1] quit 5. Configure UDP-mode ADVPN tunnel interface tunnel1. Configure its DR priority as 0 so Spoke3 will not participate in DR/BDR election. [Spoke3] interface tunnel 1 mode advpn udp [Spoke3-Tunnel1] ip address [Spoke3-Tunnel1] vam client Spoke3 [Spoke3-Tunnel1] ospf network-type broadcast [Spoke3-Tunnel1] ospf dr-priority 0 [Spoke3-Tunnel1] advpn network [Spoke3-Tunnel1] source gigabitethernet 1/0/1 [Spoke3-Tunnel1] tunnel protection ipsec profile abc [Spoke3-Tunnel1] undo shutdown [Spoke3-Tunnel1] quit Configuring Spoke 4 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client spoke4. <Spoke4> system-view [Spoke4] vam client name Spoke4 # Specify ADVPN domain abc for the VAM client. [Spoke4-vam-client-Spoke4] advpn-domain abc # Configure a pre-shared key for the VAM client. [Spoke4-vam-client-Spoke4] pre-shared-key simple # Set the username and password to spoke4. [Spoke4-vam-client-Spoke4] user spoke4 password simple spoke4 # Specify the primary and secondary VAM servers. [Spoke4-vam-client-Spoke4] server primary ip-address [Spoke4-vam-client-Spoke4] server secondary ip-address # Enable the VAM client. [Spoke4-vam-client-Spoke4] client enable [Spoke4-vam-client-Spoke4] quit 3. Configure the IPsec profile: # Configure IKE. [Spoke4] ike keychain abc [Spoke4-ike-keychain-abc] pre-shared-key address key simple
388 [Spoke4-ike-keychain-abc] quit [Spoke4] ike profile abc [Spoke4-ike-profile-abc] keychain abc [Spoke4-ike-profile-abc] quit # Configure the IPsec profile. [Spoke4] ipsec transform-set abc [Spoke4-ipsec-transform-set-abc] encapsulation-mode transport [Spoke4-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Spoke4-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Spoke4-ipsec-transform-set-abc] quit [Spoke4] ipsec profile abc isakmp [Spoke4-ipsec-profile-isakmp-abc] transform-set abc [Spoke4-ipsec-profile-isakmp-abc] ike-profile abc [Spoke4-ipsec-profile-isakmp-abc] quit 4. Configure OSPF to advertise the private networks. [Spoke4] ospf 1 [Spoke4-ospf-1] area 2 [Spoke4-ospf-1-area ] network [Spoke4-ospf-1-area ] network [Spoke4-ospf-1-area ] network [Spoke4-ospf-1-area ] quit [Spoke4-ospf-1] quit 5. Configure UDP-mode ADVPN tunnel interface tunnel1. Configure its DR priority as 0 so Spoke4 will not participate in DR/BDR election. [Spoke4] interface tunnel1 mode advpn udp [Spoke4-Tunnel1] ip address [Spoke4-Tunnel1] vam client Spoke4 [Spoke4-Tunnel1] ospf network-type broadcast [Spoke4-Tunnel1] ospf dr-priority 0 [Spoke4-Tunnel1] advpn network [Spoke4-Tunnel1] advpn network [Spoke4-Tunnel1] source gigabitethernet 1/0/1 [Spoke4-Tunnel1] tunnel protection ipsec profile abc [Spoke4-Tunnel1] undo shutdown [Spoke4-Tunnel1] quit Verifying the configuration # Display the address mapping information for all VAM clients registered with the primary VAM server. [PrimaryServer] display vam server address-map ADVPN domain name: 1 Total private address mappings: 10 Group Private address Public address Type NAT Holding time Hub No 0H 52M 7S Hub No 0H 47M 31S Hub No 0H 28M 25S Hub No 0H 52M 7S Hub No 0H 47M 31S Spoke No 0H 18M 26S 375
389 Spoke No 0H 28M 25S Hub No 0H 28M 25S Spoke No 0H 25M 40S Spoke No 0H 25M 31S # Display the address mapping information for all VAM clients registered with the secondary VAM server. [SecondaryServer] display vam server address-map ADVPN domain name: 1 Total private address mappings: 10 Group Private address Public address Type NAT Holding time Hub No 0H 52M 7S Hub No 0H 47M 31S Hub No 0H 28M 25S Hub No 0H 52M 7S Hub No 0H 47M 31S Spoke No 0H 18M 26S Spoke No 0H 28M 25S Hub No 0H 28M 25S Spoke No 0H 25M 40S Spoke No 0H 25M 31S The above output shows that Hub 1, Hub 2, Hub3, Spoke 1, Spoke 2, Spoke 3, and Spoke4 all have registered their address mapping information with the VAM servers. # Display the ADVPN tunnel information for Hub 1. [Hub1] display advpn session Interface : Tunnel1 Number of sessions: 3 Private address Public address Port Type State Holding time H-H Success 0H 46M 8S H-S Success 0H 27M 27S H-S Success 0H 18M 18S Interface : Tunnel2 Number of sessions: 2 Private address Public address Port Type State Holding time H-H Success 0H 46M 8S H-H Success 0H 27M 27S The output shows that Hub 1 has established a permanent tunnel to Hub 2, Hub3, Spoke 1, and Spoke 2. The ADVPN tunnel information for Hub 2 is similar to that of Hub 1. # Display the ADVPN tunnel information for Spoke 1. [Spoke1] display advpn session Interface : Tunnel1 Number of sessions: 2 Private address Public address Port Type State Holding time S-H Success 0H 46M 8S S-H Success 0H 46M 8S 376
390 The output shows that Spoke 1 has established a permanent hub-spoke tunnel to Hub 1 and Hub 2. # Display the ADVPN tunnel information for Spoke 3. [Spoke1] display advpn session Interface : Tunnel1 Number of sessions: 2 Private address Public address Port Type State Holding time S-H Success 0H 46M 8S S-H Success 0H 46M 8S The output shows that Spoke 3 has established a permanent hub-spoke tunnel to Hub 3. IPv6 multi-hub-group ADVPN configuration example Network requirements As shown in Figure 141, the primary and secondary VAM servers manage and maintain VAM client information for all hubs and spokes. The AAA server performs authentication and accounting for VAM clients. Configure three hub groups to accommodate all ADVPN nodes: Hub group 0 contains Hub1, Hub2, and Hub3. Hub group 1 contains Hub1, Hub2, Spoke1, and Spoke2. Hub1 and Hub2 back up each other. Hub group 2 contains Hub3, Spoke3, and Spoke4. Hub groups 1 and 2 use full-mesh networking. Any two spokes can establish a direct spoke-spoke tunnel. Figure 141 Network diagram 377
391 Table 17 Interface and IP address assignment Device Interface IP address Device Interface IP address Hub 1 GE1/0/1 1::1/64 Spoke 1 GE1/0/1 1::4/64 Tunnel1 192:168:1::1/64 GE1/0/2 192:168:10::1/64 Tunnel2 192:168::1/64 Tunnel1 192:168:1::3/64 Hub 2 GE1/0/1 1::2/64 Spoke 2 GE1/0/1 1::5/64 Tunnel1 192:168:1::2/64 GE1/0/2 192:168:20::1/64 Tunnel2 192:168::2/64 GE1/0/3 192:168:30::1/64 Hub 3 GE1/0/1 1::3/64 Tunnel1 192:168:1::4/64 Tunnel1 192:168:2::1/64 Spoke 3 GE1/0/1 1::6/64 Tunnel2 192:168::3/64 GE1/0/2 192:168:40::1/64 AAA server 1::10/64 Tunnel1 192:168:2::2/64 Primary server GE1/0/1 1::11/64 Spoke 4 GE1/0/1 1::7/64 Secondary server GE1/0/1 1::12/64 GE1/0/2 192:168:50::1/64 GE1/0/3 192:168:60::1/64 Tunnel1 192:168:2::3/64 Configuring the primary VAM server 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure AAA: # Configure RADIUS scheme abc. <PrimaryServer> system-view [PrimaryServer] radius scheme abc [PrimaryServer-radius-abc] primary authentication ipv6 1:: [PrimaryServer-radius-abc] primary accounting ipv6 1:: [PrimaryServer-radius-abc] key authentication simple 123 [PrimaryServer-radius-abc] key accounting simple 123 [PrimaryServer-radius-abc] user-name-format without-domain [PrimaryServer-radius-abc] quit [PrimaryServer] radius session-control enable # Configure AAA methods for the ISP domain abc. [PrimaryServer] domain abc [PrimaryServer-isp-abc] authentication advpn radius-scheme abc [PrimaryServer-isp-abc] accounting advpn radius-scheme abc [PrimaryServer-isp-abc] quit [PrimaryServer] domain default enable abc 3. Configure the VAM server: # Create ADVPN domain abc. [PrimaryServer] vam server advpn-domain abc id 1 # Create hub group 0. [PrimaryServer-vam-server-domain-abc] hub-group 0 378
392 # Specify hub private addresses. [PrimaryServer-vam-server-domain-abc-hub-group-0] hub ipv6 private-address 192:168::1 [PrimaryServer-vam-server-domain-abc-hub-group-0] hub ipv6 private-address 192:168::2 [PrimaryServer-vam-server-domain-abc-hub-group-0] hub ipv6 private-address 192:168::3 [PrimaryServer-vam-server-domain-abc-hub-group-0] quit # Create hub group 1. [PrimaryServer-vam-server-domain-abc] hub-group 1 # Specify hub private addresses. [PrimaryServer-vam-server-domain-abc-hub-group-1] hub ipv6 private-address 192:168:1::1 [PrimaryServer-vam-server-domain-abc-hub-group-1] hub ipv6 private-address 192:168:1::2 # Specify a spoke private network. [PrimaryServer-vam-server-domain-abc-hub-group-1] spoke ipv6 private-address network 192:168:1::0 64 # Allow establishing spoke-spoke tunnels. [PrimaryServer-vam-server-domain-abc-hub-group-1] shortcut ipv6 interest all [PrimaryServer-vam-server-domain-abc-hub-group-1] quit # Create hub group 2. [PrimaryServer-vam-server-domain-abc] hub-group 2 # Specify the hub private address. [PrimaryServer-vam-server-domain-abc-hub-group-2] hub ipv6 private-address 192:168:2::1 # Specify a spoke private network. [PrimaryServer-vam-server-domain-abc-hub-group-2] spoke ipv6 private-address network 192:168:2::0 64 [PrimaryServer-vam-server-domain-abc-hub-group-2] quit # Set the pre-shared key to [PrimaryServer-vam-server-domain-abc] pre-shared-key simple # Set the authentication mode to CHAP. [PrimaryServer-vam-server-domain-abc] authentication-method chap # Enable the VAM server for the ADVPN domain. [PrimaryServer-vam-server-domain-abc] server enable [PrimaryServer-vam-server-domain-abc] quit Configuring the secondary VAM server # Configure the secondary VAM server in the same way that the primary server is configured. (Details not shown.) Configuring Hub 1 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client hub1group0. <Hub1> system-view 379
393 [Hub1] vam client name Hub1Group0 # Specify ADVPN domain abc for the VAM client. [Hub1-vam-client-Hub1Group0] advpn-domain abc # Set the pre-shared key to [Hub1-vam-client-Hub1Group0] pre-shared-key simple # Set the username and password to hub1 [Hub1-vam-client-Hub1Group0] user hub1 password simple hub1 # Specify the primary and secondary VAM servers. [Hub1-vam-client-Hub1Group0] server primary ipv6-address 1::11 [Hub1-vam-client-Hub1Group0] server secondary ipv6-address 1::12 # Enable the VAM client. [Hub1-vam-client-Hub1Group0] client enable [Hub1-vam-client-Hub1Group0] quit # Create VAM client Hub1Group1. [Hub1] vam client name Hub1Group1 # Specify ADVPN domain abc for the VAM client. [Hub1-vam-client-Hub1Group1] advpn-domain abc # Set the pre-shared key to [Hub1-vam-client-Hub1Group1] pre-shared-key simple # Set the username and password to hub1 [Hub1-vam-client-Hub1Group1] user hub1 password simple hub1 # Specify the primary and secondary VAM servers. [Hub1-vam-client-Hub1Group1] server primary ipv6-address 1::11 [Hub1-vam-client-Hub1Group1] server secondary ipv6-address 1::12 # Enable the VAM client. [Hub1-vam-client-Hub1Group1] client enable [Hub1-vam-client-Hub1Group1] quit 3. Configure an IPsec profile: # Configure IKE. [Hub1] ike keychain abc [Hub1-ike-keychain-abc] pre-shared-key address :: 0 key simple [Hub1-ike-keychain-abc] quit [Hub1] ike profile abc [Hub1-ike-profile-abc] keychain abc [Hub1-ike-profile-abc] quit # Configure the IPsec profile. [Hub1] ipsec transform-set abc [Hub1-ipsec-transform-set-abc] encapsulation-mode transport [Hub1-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Hub1-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Hub1-ipsec-transform-set-abc] quit [Hub1] ipsec profile abc isakmp [Hub1-ipsec-profile-isakmp-abc] transform-set abc [Hub1-ipsec-profile-isakmp-abc] ike-profile abc [Hub1-ipsec-profile-isakmp-abc] quit 380
394 4. Configure OSPFv3. [Hub1] ospfv3 1 [Hub1-ospfv3-1] router-id [Hub1-ospfv3-1] area 0 [Hub1-ospfv3-1-area ] quit [Hub1-ospfv3-1] area 1 [Hub1-ospfv3-1-area ] quit [Hub1-ospfv3-1] quit 5. Configure an ADVPN tunnel: # Configure UDP-mode ADVPN tunnel interface tunnel1. [Hub1] interface tunnel1 mode advpn udp [Hub1-Tunnel1] ipv6 address 192:168:1::1 64 [Hub1-Tunnel1] ipv6 address fe80::1:1 link-local [Hub1-Tunnel1] vam ipv6 client Hub1Group1 [Hub1-Tunnel1] ospfv3 1 area 1 [Hub1-Tunnel1] ospfv3 network-type broadcast [Hub1-Tunnel1] source gigabitethernet 1/0/1 [Hub1-Tunnel1] tunnel protection ipsec profile abc [Hub1-Tunnel1] undo shutdown [Hub1-Tunnel1] quit # Configure UDP-mode ADVPN tunnel interface tunnel2. [Hub1] interface tunnel2 mode advpn udp [Hub1-Tunnel2] ipv6 address 192:168::1 64 [Hub1-Tunnel2] ipv6 address fe80::1 link-local [Hub1-Tunnel2] vam ipv6 client Hub1Group0 [Hub1-Tunnel2] ospfv3 1 area 0 [Hub1-Tunnel2] ospf network-type broadcast [Hub1-Tunnel2] source gigabitethernet 1/0/1 [Hub1-Tunnel2] tunnel protection ipsec profile abc [Hub1-Tunnel2] undo shutdown [Hub1-Tunnel2] quit Configuring Hub 2 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client Hub2Group0. <Hub2> system-view [Hub2] vam client name Hub2Group0 # Specify ADVPN domain abc for the VAM Client. [Hub2-vam-client-Hub2Group0] advpn-domain abc # Set pre-shared key for the VAM client. [Hub2-vam-client-Hub2Group0] pre-shared-key simple # Set the username and password to hub2. [Hub2-vam-client-Hub2Group0] user hub2 password simple hub2 # Specify the primary and secondary VAM servers. [Hub2-vam-client-Hub2Group0] server primary ipv6-address 1::11 [Hub2-vam-client-Hub2Group0] server secondary ipv6-address 1::12 381
395 # Enable the VAM client. [Hub2-vam-client-Hub2Group0] client enable [Hub2-vam-client-Hub2Group0] quit # Create VAM client Hub2Group1. [Hub2] vam client name Hub2Group1 # Specify ADVPN domain abc for the VAM Client. [Hub2-vam-client-Hub2Group1] advpn-domain abc # Set pre-shared key for the VAM client. [Hub2-vam-client-Hub2Group1] pre-shared-key simple # Set the username and password to hub2. [Hub2-vam-client-Hub2Group1] user Hub2 password simple Hub2 # Specify the primary and secondary VAM servers. [Hub2-vam-client-Hub2Group1] server primary ipv6-address 1::11 [Hub2-vam-client-Hub2Group1] server secondary ipv6-address 1::12 # Enable the VAM client. [Hub2-vam-client-Hub2Group1] client enable [Hub2-vam-client-Hub2Group1] quit 3. Configure the IPsec profile: # Configure IKE. [Hub2] ike keychain abc [Hub2-ike-keychain-abc] pre-shared-key address :: 0 key simple [Hub2-ike-keychain-abc] quit [Hub2] ike profile abc [Hub2-ike-profile-abc] keychain abc [Hub2-ike-profile-abc] quit # Configure the IPsec profile. [Hub2] ipsec transform-set abc [Hub2-ipsec-transform-set-abc] encapsulation-mode transport [Hub2-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Hub2-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Hub2-ipsec-transform-set-abc] quit [Hub2] ipsec profile abc isakmp [Hub2-ipsec-profile-isakmp-abc] transform-set abc [Hub2-ipsec-profile-isakmp-abc] ike-profile abc [Hub2-ipsec-profile-isakmp-abc] quit 4. Configure OSPFv3. [Hub2] ospf 1 [Hub2-ospf-1] area 0 [Hub2-ospf-1-area ] network [Hub2-ospf-1-area ] quit [Hub2-ospf-1] area 1 [Hub2-ospf-1-area ] network [Hub2-ospf-1-area ] quit [Hub2-ospf-1] quit 5. Configure the ADVPN tunnel: # Configure UDP-mode ADVPN tunnel interface tunnel1. 382
396 [Hub2] interface tunnel1 mode advpn udp [Hub2-Tunnel1] ipv6 address 192:168:1::2 64 [Hub2-Tunnel1] ipv6 address fe80::1:2 link-local [Hub2-Tunnel1] vam ipv6 client Hub2Group1 [Hub2-Tunnel1] ospfv3 1 area 1 [Hub2-Tunnel1] ospfv3 network-type broadcast [Hub2-Tunnel1] source gigabitethernet 1/0/1 [Hub2-Tunnel1] tunnel protection ipsec profile abc [Hub2-Tunnel1] undo shutdown [Hub2-Tunnel1] quit # Configure UDP-mode ADVPN tunnel interface tunnel2. [Hub2] interface tunnel2 mode advpn udp [Hub2-Tunnel2] ipv6 address 192:168::2 64 [Hub2-Tunnel2] ipv6 address fe80::2 link-local [Hub2-Tunnel2] vam ipv6 client Hub2Group0 [Hub2-Tunnel2] ospfv3 1 area 0 [Hub2-Tunnel2] ospfv3 network-type broadcast [Hub2-Tunnel2] source gigabitethernet 1/0/1 [Hub2-Tunnel2] tunnel protection ipsec profile abc [Hub2-Tunnel2] undo shutdown [Hub2-Tunnel2] quit Configuring Hub 3 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client Hub3Group0. <Hub3> system-view [Hub3] vam client name Hub3Group0 # Specify ADVPN domain abc for the VAM Client. [Hub3-vam-client-Hub3Group0] advpn-domain abc # Set pre-shared key for the VAM client. [Hub3-vam-client-Hub3Group0] pre-shared-key simple # Set the username and password to hub3. [Hub3-vam-client-Hub3Group0] user hub3 password simple hub3 # Specify the primary and secondary VAM servers. [Hub3-vam-client-Hub3Group0] server primary ipv6-address 1::11 [Hub3-vam-client-Hub3Group0] server secondary ipv6-address 1::12 # Enable the VAM client. [Hub2-vam-client-Hub2Group0] client enable [Hub2-vam-client-Hub2Group0] quit # Create VAM client Hub3Group1. [Hub3] vam client name Hub3Group1 # Specify ADVPN domain abc for the VAM Client. [Hub3-vam-client-Hub3Group1] advpn-domain abc # Set pre-shared key for the VAM client. [Hub3-vam-client-Hub3Group1] pre-shared-key simple
397 # Set the username and password to hub3. [Hub3-vam-client-Hub3Group1] user hub3 password simple hub3 # Specify the primary and secondary VAM servers. [Hub3-vam-client-Hub3Group1] server primary ipv6-address 1::11 [Hub3-vam-client-Hub3Group1] server secondary ipv6-address 1::12 # Enable the VAM client. [Hub2-vam-client-Hub2Group1] client enable [Hub2-vam-client-Hub2Group1] quit 3. Configure the IPsec profile: # Configure IKE. [Hub3] ike keychain abc [Hub3-ike-keychain-abc] pre-shared-key address key simple [Hub3-ike-keychain-abc] quit [Hub3] ike profile abc [Hub3-ike-profile-abc] keychain abc [Hub3-ike-profile-abc] quit # Configure the IPsec profile. [Hub3] ipsec transform-set abc [Hub3-ipsec-transform-set-abc] encapsulation-mode transport [Hub3-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Hub3-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Hub3-ipsec-transform-set-abc] quit [Hub3] ipsec profile abc isakmp [Hub3-ipsec-profile-isakmp-abc] transform-set abc [Hub3-ipsec-profile-isakmp-abc] ike-profile abc [Hub3-ipsec-profile-isakmp-abc] quit 4. Configure OSPFv3. [Hub3] ospfv3 1 [Hub3-ospfv3-1] router-id [Hub3-ospfv3-1] area 0 [Hub3-ospfv3-1-area ] quit [Hub3-ospfv3-1] area 2 [Hub3-ospfv3-1-area ] quit [Hub3-ospfv3-1] quit 5. Configure the ADVPN tunnel: # Configure UDP-mode ADVPN tunnel interface tunnel1. [Hub3] interface tunnel1 mode advpn udp [Hub3-Tunnel1] ipv6 address 192:168:2::1 64 [Hub3-Tunnel1] ipv6 address fe80::2:1 link-local [Hub3-Tunnel1] vam ipv6 client Hub3Group1 [Hub3-Tunnel1] ospfv3 1 area 2 [Hub3-Tunnel1] ospfv3 network-type broadcast [Hub3-Tunnel1] source gigabitethernet 1/0/1 [Hub3-Tunnel1] tunnel protection ipsec profile abc [Hub3-Tunnel1] undo shutdown [Hub3-Tunnel1] quit 384
398 # Configure UDP-mode ADVPN tunnel interface tunnel2. [Hub3] interface tunnel2 mode advpn udp [Hub3-Tunnel2] ipv6 address 192:168::3 64 [Hub3-Tunnel2] ipv6 address fe80::3 link-local [Hub3-Tunnel2] vam ipv6 client Hub3Group0 [Hub3-Tunnel2] ospfv3 1 area 0 [Hub3-Tunnel2] ospfv3 network-type broadcast [Hub3-Tunnel2] source gigabitethernet 1/0/1 [Hub3-Tunnel2] tunnel protection ipsec profile abc [Hub3-Tunnel2] undo shutdown [Hub3-Tunnel2] quit Configuring Spoke 1 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client spoke1. <Spoke1> system-view [Spoke1] vam client name Spoke1 # Specify ADVPN domain abc for the VAM client. [Spoke1-vam-client-Spoke1] advpn-domain abc # Configure a pre-shared key for the VAM client. [Spoke1-vam-client-Spoke1] pre-shared-key simple # Set the username and password to spoke1. [Spoke1-vam-client-Spoke1] user spoke1 password simple spoke1 # Specify the primary and secondary VAM servers. [Spoke1-vam-client-Spoke1] server primary ipv6-address 1::11 [Spoke1-vam-client-Spoke1] server secondary ipv6-address 1::12 # Enable the VAM client. [Spoke1-vam-client-Spoke1] client enable [Spoke1-vam-client-Spoke1] quit 3. Configure the IPsec profile: # Configure IKE. [Spoke1] ike keychain abc [Spoke1-ike-keychain-abc] pre-shared-key address :: 0 key simple [Spoke1-ike-keychain-abc] quit [Spoke1] ike profile abc [Spoke1-ike-profile-abc] keychain abc [Spoke1-ike-profile-abc] quit # Configure the IPsec profile. [Spoke1] ipsec transform-set abc [Spoke1-ipsec-transform-set-abc] encapsulation-mode transport [Spoke1-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Spoke1-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Spoke1-ipsec-transform-set-abc] quit [Spoke1] ipsec profile abc isakmp [Spoke1-ipsec-profile-isakmp-abc] transform-set abc 385
399 [Spoke1-ipsec-profile-isakmp-abc] ike-profile abc [Spoke1-ipsec-profile-isakmp-abc] quit 4. Configure OSPFv3. [Spoke1] ospfv3 1 [Spoke1-ospfv3-1] router-id [Spoke1-ospfv3-1] area 0 [Spoke1-ospfv3-1-area ] quit [Spoke1-ospfv3-1] area 1 [Spoke1-ospfv3-1-area ] quit [Spoke1-ospfv3-1] quit [Spoke1] interface gigabitethernet 1/0/2 [Spoke1-GigabitEthernet1/0/2] ospfv3 1 area 1 [Spoke1-GigabitEthernet1/0/2] quit 5. Configure UDP-mode ADVPN tunnel interface tunnel1. Configure its DR priority as 0 so Spoke1 will not participate in DR/BDR election. [Spoke1] interface tunnel1 mode advpn udp [Spoke1-Tunnel1] ipv6 address 192:168:1::3 64 [Spoke1-Tunnel1] ipv6 address fe80::1:3 link-local [Spoke1-Tunnel1] vam ipv6 client Spoke1 [Spoke1-Tunnel1] ospfv3 1 area 1 [Spoke1-Tunnel1] ospfv3 network-type broadcast [Spoke1-Tunnel1] ospf dr-priority 0 [Spoke1-Tunnel1] advpn ipv6 network 192:168:10::0 64 [Spoke1-Tunnel1] source gigabitethernet 1/0/1 [Spoke1-Tunnel1] tunnel protection ipsec profile abc [Spoke1-Tunnel1] undo shutdown [Spoke1-Tunnel1] quit Configuring Spoke 2 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client spoke2. <Spoke2> system-view [Spoke2] vam client name Spoke2 # Specify ADVPN domain abc for the VAM client. [Spoke2-vam-client-Spoke2] advpn-domain abc # Configure a pre-shared key for the VAM client. [Spoke2-vam-client-Spoke2] pre-shared-key simple # Set the username and password to spoke2. [Spoke2-vam-client-Spoke2] user spoke2 password simple spoke2 # Specify the primary and secondary VAM servers. [Spoke2-vam-client-Spoke2] server primary ipv6-address 1::11 [Spoke2-vam-client-Spoke2] server secondary ipv6-address 1::12 # Enable the VAM client. [Spoke2-vam-client-Spoke2] client enable [Spoke2-vam-client-Spoke2] quit 386
400 3. Configure the IPsec profile: # Configure IKE. [Spoke2] ike keychain abc [Spoke2-ike-keychain-abc] pre-shared-key address :: 0 key simple [Spoke2-ike-keychain-abc] quit [Spoke2] ike profile abc [Spoke2-ike-profile-abc] keychain abc [Spoke2-ike-profile-abc] quit # Configure the IPsec profile. [Spoke2] ipsec transform-set abc [Spoke2-ipsec-transform-set-abc] encapsulation-mode transport [Spoke2-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Spoke2-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Spoke2-ipsec-transform-set-abc] quit [Spoke2] ipsec profile abc isakmp [Spoke2-ipsec-profile-isakmp-abc] transform-set abc [Spoke2-ipsec-profile-isakmp-abc] ike-profile abc [Spoke2-ipsec-profile-isakmp-abc] quit 4. Configure OSPFv3. [Spoke2] ospfv3 1 [Spoke2-ospfv3-1] router-id [Spoke2-ospfv3-1] area 0 [Spoke2-ospfv3-1-area ] quit [Spoke2-ospfv3-1] area 1 [Spoke2-ospfv3-1-area ] quit [Spoke2-ospfv3-1] quit [Spoke1] interface gigabitethernet 1/0/2 [Spoke1-GigabitEthernet1/0/2] ospfv3 1 area 1 [Spoke1-GigabitEthernet1/0/2] quit [Spoke1] interface gigabitethernet 1/0/3 [Spoke1-GigabitEthernet1/0/3] ospfv3 1 area 1 [Spoke1-GigabitEthernet1/0/3] quit 5. Configure UDP-mode ADVPN tunnel interface tunnel1. Configure its DR priority as 0 so Spoke2 will not participate in DR/BDR election. [Spoke2] interface tunnel1 mode advpn udp [Spoke2-Tunnel1] ipv6 address 192:168:1::4 64 [Spoke2-Tunnel1] ipv6 address fe80::1:4 link-local [Spoke2-Tunnel1] vam ipv6 client Spoke2 [Spoke2-Tunnel1] ospfv3 1 area 1 [Spoke2-Tunnel1] ospfv3 network-type broadcast [Spoke2-Tunnel1] ospf dr-priority 0 [Spoke2-Tunnel1] advpn ipv6 network 192:168:20::0 64 [Spoke2-Tunnel1] advpn ipv6 network 192:168:30::0 64 [Spoke2-Tunnel1] source gigabitethernet 1/0/1 [Spoke2-Tunnel1] tunnel protection ipsec profile abc [Spoke2-Tunnel1] undo shutdown [Spoke2-Tunnel1] quit 387
401 Configuring Spoke 3 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client spoke3. <Spoke3> system-view [Spoke3] vam client name Spoke3 # Specify ADVPN domain abc for the VAM client. [Spoke3-vam-client-Spoke3] advpn-domain abc # Configure a pre-shared key for the VAM client. [Spoke3-vam-client-Spoke3] pre-shared-key simple # Set the username and password to spoke3. [Spoke3-vam-client-Spoke3] user spoke3 password simple spoke3 # Specify the primary and secondary VAM servers. [Spoke3-vam-client-Spoke3] server primary ipv6-address 1::11 [Spoke3-vam-client-Spoke3] server secondary ipv6-address 1::12 # Enable the VAM client. [Spoke3-vam-client-Spoke3] client enable [Spoke3-vam-client-Spoke3] quit 3. Configure the IPsec profile: # Configure IKE. [Spoke3] ike keychain abc [Spoke3-ike-keychain-abc] pre-shared-key address :: 0 key simple [Spoke3-ike-keychain-abc] quit [Spoke3] ike profile abc [Spoke3-ike-profile-abc] keychain abc [Spoke3-ike-profile-abc] quit # Configure the IPsec profile. [Spoke3] ipsec transform-set abc [Spoke3-ipsec-transform-set-abc] encapsulation-mode transport [Spoke3-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Spoke3-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Spoke3-ipsec-transform-set-abc] quit [Spoke3] ipsec profile abc isakmp [Spoke3-ipsec-profile-isakmp-abc] transform-set abc [Spoke3-ipsec-profile-isakmp-abc] ike-profile abc [Spoke3-ipsec-profile-isakmp-abc] quit 4. Configure OSPFv3. [Spoke3] ospfv3 1 [Spoke3-ospfv3-1] router-id [Spoke3-ospfv3-1] area 0 [Spoke3-ospfv3-1-area ] quit [Spoke3-ospfv3-1] area 2 [Spoke3-ospfv3-1-area ] quit [Spoke3-ospfv3-1] quit [Spoke3] interface gigabitethernet 1/0/2 388
402 [Spoke3-GigabitEthernet1/0/2] ospfv3 1 area 2 [Spoke3-GigabitEthernet1/0/2] quit 5. Configure UDP-mode ADVPN tunnel interface tunnel1. Configure its DR priority as 0 so Spoke3 will not participate in DR/BDR election. [Spoke3] interface tunnel1 mode advpn udp [Spoke3-Tunnel1] ipv6 address 192:168:2::2 64 [Spoke3-Tunnel1] ipv6 address fe80::2:2 link-local [Spoke3-Tunnel1] vam ipv6 client Spoke3 [Spoke3-Tunnel1] ospfv3 1 area 2 [Spoke3-Tunnel1] ospfv3 network-type broadcast [Spoke3-Tunnel1] ospf dr-priority 0 [Spoke3-Tunnel1] advpn ipv6 network 192:168:40::0 64 [Spoke3-Tunnel1] source gigabitethernet 1/0/1 [Spoke3-Tunnel1] tunnel protection ipsec profile abc [Spoke3-Tunnel1] undo shutdown [Spoke3-Tunnel1] quit Configuring Spoke 4 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client spoke4. <Spoke4> system-view [Spoke4] vam client name Spoke4 # Specify ADVPN domain abc for the VAM client. [Spoke4-vam-client-Spoke4] advpn-domain abc # Configure a pre-shared key for the VAM client. [Spoke4-vam-client-Spoke4] pre-shared-key simple # Set the username and password to spoke4. [Spoke4-vam-client-Spoke4] user spoke4 password simple spoke4 # Specify the primary and secondary VAM servers. [Spoke4-vam-client-Spoke4] server primary ipv6-address 1::11 [Spoke4-vam-client-Spoke4] server secondary ipv6-address 1::12 # Enable the VAM client. [Spoke4-vam-client-Spoke4] client enable [Spoke4-vam-client-Spoke4] quit 3. Configure the IPsec profile: # Configure IKE. [Spoke4] ike keychain abc [Spoke4-ike-keychain-abc] pre-shared-key address :: 0 key simple [Spoke4-ike-keychain-abc] quit [Spoke4] ike profile abc [Spoke4-ike-profile-abc] keychain abc [Spoke4-ike-profile-abc] quit # Configure the IPsec profile. [Spoke4] ipsec transform-set abc [Spoke4-ipsec-transform-set-abc] encapsulation-mode transport 389
403 [Spoke4-ipsec-transform-set-abc] esp encryption-algorithm des-cbc [Spoke4-ipsec-transform-set-abc] esp authentication-algorithm sha1 [Spoke4-ipsec-transform-set-abc] quit [Spoke4] ipsec profile abc isakmp [Spoke4-ipsec-profile-isakmp-abc] transform-set abc [Spoke4-ipsec-profile-isakmp-abc] ike-profile abc [Spoke4-ipsec-profile-isakmp-abc] quit 4. Configure OSPFv3. [Spoke4] ospfv3 1 [Spoke4-ospfv3-1] router-id [Spoke4-ospfv3-1] area 0 [Spoke4-ospfv3-1-area ] quit [Spoke4-ospfv3-1] area 2 [Spoke4-ospfv3-1-area ] quit [Spoke4-ospfv3-1] quit [Spoke4] interface gigabitethernet 1/0/2 [Spoke4-GigabitEthernet1/0/2] ospfv3 1 area 2 [Spoke4-GigabitEthernet1/0/2] quit [Spoke4] interface gigabitethernet 1/0/3 [Spoke4-GigabitEthernet1/0/3] ospfv3 1 area 2 [Spoke4-GigabitEthernet1/0/3] quit 5. Configure UDP-mode ADVPN tunnel interface tunnel1. Configure its DR priority as 0 so Spoke4 will not participate in DR/BDR election. [Spoke4] interface tunnel1 mode advpn udp [Spoke4-Tunnel1] ipv6 address 192:168:2::3 64 [Spoke4-Tunnel1] ipv6 address fe80::2:3 link-local [Spoke4-Tunnel1] vam ipv6 client Spoke4 [Spoke4-Tunnel1] ospfv3 1 area 2 [Spoke4-Tunnel1] ospfv3 network-type broadcast [Spoke4-Tunnel1] ospf dr-priority 0 [Spoke4-Tunnel1] advpn ipv6 network 192:168:50::0 64 [Spoke4-Tunnel1] advpn ipv6 network 192:168:60::0 64 [Spoke4-Tunnel1] source gigabitethernet 1/0/1 [Spoke4-Tunnel1] tunnel protection ipsec profile abc [Spoke4-Tunnel1] undo shutdown [Spoke4-Tunnel1] quit Verifying the configuration # Display the address mapping information for all VAM clients registered with the primary VAM server. [PrimaryServer] display vam server ipv6 address-map ADVPN domain name: 1 Total private address mappings: 10 Group Private address Public address Type NAT Holding time 0 192:168::1 1::1 Hub No 0H 52M 7S 0 192:168::2 1::2 Hub No 0H 47M 31S 0 192:168::3 1::3 Hub No 0H 28M 25S 1 192:168:1::1 1::1 Hub No 0H 52M 7S 1 192:168:1::2 1::2 Hub No 0H 47M 31S 390
404 1 192:168:1::3 1::4 Spoke No 0H 18M 26S 1 192:168:1::4 1::5 Spoke No 0H 28M 25S 2 192:168:2::1 1::3 Hub No 0H 28M 25S 2 192:168:2::2 1::6 Spoke No 0H 25M 40S 2 192:168:2::3 1::7 Spoke No 0H 25M 31S # Display the address mapping information for all VAM clients registered with the secondary VAM server. [SecondaryServer] display vam server ipv6 address-map ADVPN domain name: 1 Total private address mappings: 10 Group Private address Public address Type NAT Holding time 0 192:168::1 1::1 Hub No 0H 52M 7S 0 192:168::2 1::2 Hub No 0H 47M 31S 0 192:168::3 1::3 Hub No 0H 28M 25S 1 192:168:1::1 1::1 Hub No 0H 52M 7S 1 192:168:1::2 1::2 Hub No 0H 47M 31S 1 192:168:1::3 1::4 Spoke No 0H 18M 26S 1 192:168:1::4 1::5 Spoke No 0H 28M 25S 2 192:168:2::1 1::3 Hub No 0H 28M 25S 2 192:168:2::2 1::6 Spoke No 0H 25M 40S 2 192:168:2::3 1::7 Spoke No 0H 25M 31S The above output shows that Hub 1, Hub 2, Hub3, Spoke 1, Spoke 2, Spoke 3, and Spoke4 all have registered their address mapping information with the VAM servers. # Display the ADVPN tunnel information for Hub 1. [Hub1] display advpn ipv6 session Interface : Tunnel1 Number of sessions: 3 Private address Public address Port Type State Holding time 192:168:1::2 1:: H-H Success 0H 46M 8S 192:168:1::3 1:: H-S Success 0H 27M 27S 192:168:1::4 1:: H-S Success 0H 18M 18S Interface : Tunnel2 Number of sessions: 2 Private address Public address Port Type State Holding time 192:168::2 1:: H-H Success 0H 46M 8S 192:168::3 1:: H-H Success 0H 27M 27S The output shows that Hub 1 has established a permanent tunnel to Hub 2, Hub3, Spoke 1, and Spoke 2. The ADVPN tunnel information for Hub 2 is similar to that of Hub 1. # Display the ADVPN tunnel information for Spoke 1. [Spoke1] display advpn ipv6 session Interface : Tunnel1 Number of sessions: 2 Private address Public address Port Type State Holding time 192:168:1::1 1:: S-H Success 0H 46M 8S 391
405 192:168:1::2 1:: S-H Success 0H 46M 8S The output shows that Spoke 1 has established a permanent hub-spoke tunnel to Hub 1 and Hub 2. # Display the ADVPN tunnel information for Spoke 3. [Spoke3] display advpn ipv6 session Interface : Tunnel1 Number of sessions: 2 Private address Public address Port Type State Holding time 192:168:2::1 1:: S-H Success 0H 46M 8S The output shows that Spoke 3 has established a permanent hub-spoke tunnel to Hub 3. IPv4 full-mesh NAT traversal ADVPN configuration example Network requirements As shown in Figure 142, all the VAM servers and VAM clients reside behind a NAT gateway. The primary and secondary VAM servers manage and maintain VAM client information for all hubs and spokes. The AAA server performs authentication and accounting for VAM clients. The two hubs back up each other, and perform data forwarding and route exchange. Each spoke establishes a permanent ADVPN tunnel to each hub. Any two spokes in the same ADVPN domain can dynamically establish a temporary ADVPN tunnel. Figure 142 Network diagram Hub1 GE1/0/1 GE1/0/1 Hub2 Tunnel1 Tunnel1 GE1/0/2 GE1/0/1 IP network NAT1 GE1/0/1 NAT4 GE1/0/2 GE1/0/1 AAA server GE1/0/1 GE1/0/1 Primary server Tunnel1 GE1/0/2 NAT2 GE1/0/2 NAT3 Tunnel1 GE1/0/1 GE1/0/1 GE1/0/1 Secondary server Spoke1 Spoke2 GE1/0/2 GE1/0/2 Hub-to-Hub static tunnel Site 1 Site 2 Hub-to-Spoke static tunnel Spoke-to-Spoke dynamic tunnel 392
406 Table 18 Interface and IP address assignment Device Interface IP address Device Interface IP address Hub 1 GE1/0/ /24 Spoke 1 GE1/0/ /24 Tunnel /24 GE1/0/ /24 Hub 2 GE1/0/ /24 Tunnel /24 Tunnel /24 Spoke 2 GE1/0/ /24 NAT1 GE1/0/ /24 GE1/0/ /24 GE1/0/ /24 Tunnel /24 NAT2 GE1/0/ /24 NAT4 GE1/0/ /24 GE1/0/ /24 GE1/0/ /24 NAT3 GE1/0/ /24 AAA server /24 GE1/0/ /24 Primary server GE1/0/ /24 Secondary server GE1/0/ /24 Configuring the primary VAM server 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure AAA: # Configure RADIUS scheme abc. <PrimaryServer> system-view [PrimaryServer] radius scheme abc [PrimaryServer-radius-abc] primary authentication [PrimaryServer-radius-abc] primary accounting [PrimaryServer-radius-abc] key authentication simple 123 [PrimaryServer-radius-abc] key accounting simple 123 [PrimaryServer-radius-abc] user-name-format without-domain [PrimaryServer-radius-abc] quit [PrimaryServer] radius session-control enable # Configure AAA methods for the ISP domain abc. [PrimaryServer] domain abc [PrimaryServer-isp-abc] authentication advpn radius-scheme abc [PrimaryServer-isp-abc] accounting advpn radius-scheme abc [PrimaryServer-isp-abc] quit [PrimaryServer] domain default enable abc 3. Configure the VAM server: # Create ADVPN domain abc. [PrimaryServer] vam server advpn-domain abc id 1 # Create hub group 0. [PrimaryServer-vam-server-domain-abc] hub-group 0 # Configure hubs in hub group 0: Hub1 The private address is , the public address is (after NAT), and the source port number of ADVPN packets is 4001 (after NAT). 393
407 Hub2 The private address is , the public address is (after NAT), and the source port number of ADVPN packets is 4002 (after NAT). [PrimaryServer-vam-server-domain-abc-hub-group-0] hub private-address public-address advpn-port 4001 [PrimaryServer-vam-server-domain-abc-hub-group-0] hub private-address public-address advpn-port 4002 # Specify a spoke private network. [PrimaryServer-vam-server-domain-abc-hub-group-0] spoke private-address network [PrimaryServer-vam-server-domain-abc-hub-group-0] quit # Set the pre-shared key to [PrimaryServer-vam-server-domain-abc] pre-shared-key simple # Set the authentication mode to CHAP. [PrimaryServer-vam-server-domain-abc] authentication-method chap # Enable the VAM server for the ADVPN domain. [PrimaryServer-vam-server-domain-abc] server enable [PrimaryServer-vam-server-domain-abc] quit # Configure a default route. [PrimaryServer] ip route-static Configuring the secondary VAM server # Configure the secondary VAM server in the same way that the primary server is configured. (Details not shown.) Configuring Hub 1 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client hub1. <Hub1> system-view [Hub1] vam client name Hub1 # Specify ADVPN domain abc for the VAM client. [Hub1-vam-client-Hub1] advpn-domain abc # Set the pre-shared key to [Hub1-vam-client-Hub1] pre-shared-key simple # Set the username and password to hub1 [Hub1-vam-client-Hub1] user hub1 password simple hub1 # Specify the primary VAM server: the IP address is (after NAT) and the port number is 4001 (after NAT). [Hub1-vam-client-Hub1] server primary ip-address port 4001 # Specify the secondary VAM server: the IP address is (after NAT) and the port number is 4002 (after NAT). [Hub1-vam-client-Hub1] server secondary ip-address port 4002 # Enable the VAM client. [Hub1-vam-client-Hub1] client enable [Hub1-vam-client-Hub1] quit 3. Configure OSPF: 394
408 # Configure OSPF to advertise the private network. [Hub1] ospf 1 [Hub1-ospf-1] area 0 [Hub1-ospf-1-area ] network [Hub1-ospf-1-area ] quit [Hub1-ospf-1] quit # Configure a default route. [Hub1] ip route-static Configure UDP-mode ADVPN tunnel interface tunnel1. [Hub1] interface tunnel 1 mode advpn udp [Hub1-Tunnel1] ip address [Hub1-Tunnel1] vam client Hub1 [Hub1-Tunnel1] ospf network-type broadcast [Hub1-Tunnel1] source gigabitethernet 1/0/1 [Hub1-Tunnel1] undo shutdown [Hub1-Tunnel1] quit Configuring Hub 2 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client Hub2. <Hub2> system-view [Hub2] vam client name Hub2 # Specify ADVPN domain abc for the VAM Client. [Hub2-vam-client-Hub2] advpn-domain abc # Set pre-shared key for the VAM client. [Hub2-vam-client-Hub2] pre-shared-key simple # Set the username and password to hub2. [Hub2-vam-client-Hub2] user hub2 password simple hub2 # Specify the primary and secondary VAM servers. [Hub2-vam-client-Hub2] server primary ip-address port 4001 [Hub2-vam-client-Hub2] server secondary ip-address port 4002 # Enable the VAM client. [Hub2-vam-client-Hub2] client enable [Hub2-vam-client-Hub2] quit 3. Configure OSPF: # Configure OSPF to advertise the private network. [Hub1] ospf 1 [Hub1-ospf-1] area 0 [Hub1-ospf-1-area ] network [Hub1-ospf-1-area ] quit [Hub1-ospf-1] quit # Configure a default route. [Hub1] ip route-static Configure UDP-mode ADVPN tunnel interface tunnel1. [Hub2] interface tunnel1 mode advpn udp 395
409 Configuring Spoke 1 [Hub2-Tunnel1] ip address [Hub2-Tunnel1] vam client Hub2 [Hub2-Tunnel1] ospf network-type broadcast [Hub2-Tunnel1] source gigabitethernet 1/0/1 [Hub2-Tunnel1] undo shutdown [Hub2-Tunnel1] quit 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client spoke1. <Spoke1> system-view [Spoke1] vam client name Spoke1 # Specify ADVPN domain abc for the VAM client. [Spoke1-vam-client-Spoke1] advpn-domain abc # Configure a pre-shared key for the VAM client. [Spoke1-vam-client-Spoke1] pre-shared-key simple # Set the username and password to spoke1. [Spoke1-vam-client-Spoke1] user spoke1 password simple spoke1 # Specify the primary and secondary VAM servers. [Spoke1-vam-client-Spoke1] server primary ip-address port 4001 [Spoke1-vam-client-Spoke1] server secondary ip-address port 4002 # Enable the VAM client. [Spoke1-vam-client-Spoke1] client enable [Spoke1-vam-client-Spoke1] quit 3. Configure OSPF: # Configure OSPF to advertise the private network. [Spoke1] ospf 1 [Spoke1-ospf-1] area 0 [Spoke1-ospf-1-area ] network [Spoke1-ospf-1-area ] quit [Spoke1-ospf-1] quit # Configure a default route. [Spoke1] ip route-static Configure UDP-mode ADVPN tunnel interface tunnel1. Configure its DR priority as 0 so Spoke1 will not participate in DR/BDR election. [Spoke1] interface tunnel1 mode advpn udp [Spoke1-Tunnel1] ip address [Spoke1-Tunnel1] vam client Spoke1 [Spoke1-Tunnel1] ospf network-type broadcast [Spoke1-Tunnel1] ospf dr-priority 0 [Spoke1-Tunnel1] source gigabitethernet 1/0/1 [Spoke1-Tunnel1] undo shutdown [Spoke1-Tunnel1] quit 396
410 Configuring Spoke 2 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure the VAM client: # Create VAM client spoke2. <Spoke2> system-view [Spoke2] vam client name Spoke2 # Specify ADVPN domain abc for the VAM client. [Spoke2-vam-client-Spoke2] advpn-domain abc # Configure a pre-shared key for the VAM client. [Spoke2-vam-client-Spoke2] pre-shared-key simple # Set the username and password to spoke2. [Spoke2-vam-client-Spoke2] user spoke2 password simple spoke2 # Specify the primary and secondary VAM servers. [Spoke2-vam-client-Spoke2] server primary ip-address port 4001 [Spoke2-vam-client-Spoke2] server secondary ip-address port 4002 # Enable the VAM client. [Spoke2-vam-client-Spoke2] client enable [Spoke2-vam-client-Spoke2] quit 3. Configure OSPF: # Configure OSPF to advertise the private network. [Spoke2] ospf 1 [Spoke2-ospf-1] area 0 [Spoke2-ospf-1-area ] network [Spoke2-ospf-1-area ] quit [Spoke2-ospf-1] quit # Configure a default route. [Hub1] ip route-static Configure UDP-mode ADVPN tunnel interface tunnel1. Configure its DR priority as 0 so Spoke2 will not participate in DR/BDR election. [Spoke2] interface tunnel1 mode advpn udp [Spoke2-Tunnel1] ip address [Spoke2-Tunnel1] vam client Spoke2 [Spoke2-Tunnel1] ospf network-type broadcast [Spoke2-Tunnel1] ospf dr-priority 0 [Spoke2-Tunnel1] source gigabitethernet 1/0/1 [Spoke2-Tunnel1] undo shutdown [Spoke2-Tunnel1] quit Configuring NAT 1 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure NAT internal servers: # Configure ACL 2000 to permit packets sourced from /24. <NAT1> system-view [NAT1] acl number 2000 [NAT1-acl-basic-2000] rule permit source
411 Configuring NAT 2 [NAT1-acl-basic-2000] quit # Configure NAT internal servers on GigabitEthernet1/0/1. Allow external ADVPN nodes to access Hub 1 and Hub 2 by using the public address Hub 1 and Hub 2 both use the default source UDP port number The UDP port number after NAT is 4001 on Hub 1, and is 4002 on Hub 2. [NAT1] interface gigabitethernet 1/0/1 [NAT1-GigabitEthernet1/0/1] nat server protocol udp global current-interface 4001 inside [NAT1-GigabitEthernet1/0/1] nat server protocol udp global current-interface 4002 inside [NAT1-GigabitEthernet1/0/1] nat outbound 2000 [NAT1-GigabitEthernet1/0/1] quit # Enable NAT hairpin on GigabitEthernet1/0/2. [NAT1] interface gigabitethernet 1/0/2 [NAT1-GigabitEthernet1/0/2] nat hairpin enable [NAT1-GigabitEthernet1/0/2] quit 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure NAT internal servers: # Configure ACL 2000 to permit packets sourced from /24. <NAT2> system-view [NAT2] acl number 2000 [NAT2-acl-basic-2000] rule permit source [NAT2-acl-basic-2000] quit # Create address group 1. [NAT2] nat address-group 1 # Add address into the group. [NAT2-nat-address-group-1] address [NAT2-nat-address-group-1] quit # Configure NAT on GigabitEthernet1/0/1. [NAT2] interface gigabitethernet 1/0/1 [NAT2-GigabitEthernet1/0/1] nat outbound 2000 address-group 1 [NAT2-GigabitEthernet1/0/1] quit # Configure EIM for PAT to translate the source address and source port of packets that are sourced from the same address and port and match ACL 2000 to the same source public address and port. [NAT2] nat mapping-behavior endpoint-independent acl 2000 Configuring NAT 3 # Configure NAT 3 in the same way that NAT 2 is configured. (Details not shown.) Configuring NAT 4 1. Configure IP addresses for the interfaces. (Details not shown.) 2. Configure NAT internal servers: # Configure NAT internal servers on GigabitEthernet1/0/1. Allow external VAM clients to access VAM and AAA servers by using the public address The primary and secondary VAM 398
412 servers both use the default source UDP port number The UDP port number after NAT is 4001 for the primary server, and is 4002 for the secondary server. <NAT4> system-view [NAT4] interface gigabitethernet 1/0/1 [NAT4-GigabitEthernet1/0/1] nat server protocol udp global current-interface 4001 inside [NAT4-GigabitEthernet1/0/1] nat server protocol udp global current-interface 4002 inside Verifying the configuration # Display the address mapping information for all VAM clients registered with the primary VAM server. [PrimaryServer] display vam server address-map ADVPN domain name: 1 Total private address mappings: 4 Group Private address Public address Type NAT Holding time Hub Yes 0H 52M 7S Hub Yes 0H 47M 31S Spoke Yes 0H 28M 25S Spoke Yes 0H 19M 15S # Display the address mapping information for all VAM clients registered with the secondary VAM server. [SecondaryServer] display vam server address-map ADVPN domain name: 1 Total private address mappings: 4 Group Private address Public address Type NAT Holding time Hub Yes 0H 52M 7S Hub Yes 0H 47M 31S Spoke Yes 0H 28M 25S Spoke Yes 0H 19M 15S The above output shows that Hub 1, Hub 2, Spoke 1, Spoke 2, and Spoke 3 all have registered their address mapping information with the VAM servers. # Display the ADVPN tunnel information for Hub 1. [Hub1] display advpn session Interface : Tunnel1 Number of sessions: 3 Private address Public address Port Type State Holding time H-H Success 0H 46M 8S H-S Success 0H 27M 27S H-S Success 0H 18M 18S The output shows that Hub 1 has established a permanent tunnel to Hub 2, Spoke 1, and Spoke 2. The ADVPN tunnel information for Hub 2 is similar to that of Hub 1. # Display the ADVPN tunnel information for Spoke 1. [Spoke1] display advpn session Interface : Tunnel1 Number of sessions: 2 Private address Public address Port Type State Holding time S-H Success 0H 46M 8S 399
413 S-H Success 0H 46M 8S The output shows that Spoke 1 has established a permanent hub-spoke tunnel to Hub 1 and Hub 2. # Ping the private address of Spoke 2 from Spoke 1. [Spoke2] ping Ping ( ): 56 data bytes, press CTRL_C to break 56 bytes from : icmp_seq=0 ttl=255 time=4.000 ms 56 bytes from : icmp_seq=1 ttl=255 time=0.000 ms 56 bytes from : icmp_seq=2 ttl=255 time=0.000 ms 56 bytes from : icmp_seq=3 ttl=255 time=0.000 ms 56 bytes from : icmp_seq=4 ttl=255 time=1.000 ms --- Ping statistics for packets transmitted, 5 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.000/1.000/4.000/1.549 ms # Display ADVPN tunnel information on Spoke 1. [Spoke1] display advpn session Interface : Tunnel1 Number of sessions: 3 Private address Public address Port Type State Holding time S-H Success 0H 46M 8S S-H Success 0H 46M 8S S-S Success 0H 0M 1S The output shows that: Spoke 1 has established permanent hub-spoke tunnels to Hub 1 and Hub 2. Spoke 1 and Spoke 2 have established a temporary spoke-spoke tunnel. 400
414 Support and other resources Contacting HP For worldwide technical support information, see the HP support website: Before contacting HP, collect the following information: Product model names and numbers Technical support registration number (if applicable) Product serial numbers Error messages Operating system type and revision level Detailed questions Subscription service HP recommends that you register your product at the Subscriber's Choice for Business website: After registering, you will receive notification of product enhancements, new driver versions, firmware updates, and other product resources. Related information Documents Websites To find related documents, browse to the Manuals page of the HP Business Support Center website: For related documentation, navigate to the Networking section, and select a networking category. For a complete list of acronyms and their definitions, see HP FlexNetwork Technology Acronyms. HP.com HP Networking HP manuals HP download drivers and software HP software depot HP Education 401
415 Conventions This section describes the conventions used in this documentation set. Command conventions Convention Boldface Italic Description Bold text represents commands and keywords that you enter literally as shown. Italic text represents arguments that you replace with actual values. [ ] Square brackets enclose syntax choices (keywords or arguments) that are optional. { x y... } [ x y... ] { x y... } * [ x y... ] * &<1-n> Braces enclose a set of required syntax choices separated by vertical bars, from which you select one. Square brackets enclose a set of optional syntax choices separated by vertical bars, from which you select one or none. Asterisk-marked braces enclose a set of required syntax choices separated by vertical bars, from which you select at least one. Asterisk-marked square brackets enclose optional syntax choices separated by vertical bars, from which you select one choice, multiple choices, or none. The argument or keyword and argument combination before the ampersand (&) sign can be entered 1 to n times. # A line that starts with a pound (#) sign is comments. GUI conventions Convention Boldface Description Window names, button names, field names, and menu items are in bold text. For example, the New User window appears; click OK. > Multi-level menus are separated by angle brackets. For example, File > Create > Folder. Symbols Convention WARNING CAUTION IMPORTANT NOTE TIP Description An alert that calls attention to important information that if not understood or followed can result in personal injury. An alert that calls attention to important information that if not understood or followed can result in data loss, data corruption, or damage to hardware or software. An alert that calls attention to essential information. An alert that contains additional or supplementary information. An alert that provides helpful information. 402
416 Network topology icons Represents a generic network device, such as a router, switch, or firewall. Represents a routing-capable device, such as a router or Layer 3 switch. Represents a generic switch, such as a Layer 2 or Layer 3 switch, or a router that supports Layer 2 forwarding and other Layer 2 features. Represents an access controller, a unified wired-wlan module, or the switching engine on a unified wired-wlan switch. Represents an access point. Represents a mesh access point. Represents omnidirectional signals. Represents directional signals. Represents a security product, such as a firewall, UTM, multiservice security gateway, or load-balancing device. Represents a security card, such as a firewall, load-balancing, NetStream, SSL VPN, IPS, or ACG card. Port numbering in examples The port numbers in this document are for illustration only and might be unavailable on your device. 403
417 Index A B C D E F G H I N O P R S T U A Address/prefix lease renewal,225 ADVPN configuration examples,332 ADVPN configuration task list,319 Applying an address pool on an interface,41 Applying the DDNS policy to an interface,105 ARP configuration example,7 Assigning an IP address to an interface,17 Assigning IPv6 addresses to interfaces,203 B BOOTP application,77 BOOTP client configuration example,78 C Common proxy ARP configuration example,13 Configuration examples,19 Configuration guidelines,242 Configuration procedure,261 Configuration procedure,242 Configuration procedure,10 Configuration procedure,174 Configuration procedure,167 Configuration restrictions and guidelines,187 Configuration restrictions and guidelines,245 Configuration task list,230 Configuring a 6to4 tunnel,279 Configuring a DDNS policy,103 Configuring a DHCP client ID for an interface,62 Configuring a DS-Lite tunnel,292 Configuring a GRE over IPv4 tunnel,304 Configuring a GRE over IPv6 tunnel,306 Configuring a static ARP entry,3 Configuring a tunnel interface,273 Configuring AAA,319 Configuring an address pool on the DHCP server,32 Configuring an ADVPN tunnel interface,328 Configuring an automatic IPv4-compatible IPv6 tunnel, Configuring an interface to use BOOTP for IP address acquisition,78 Configuring an IPv4 over IPv4 tunnel,287 Configuring an IPv4 over IPv6 manual tunnel,290 Configuring an IPv6 over IPv4 manual tunnel,275 Configuring an IPv6 over IPv6 tunnel,295 Configuring an ISATAP tunnel,284 Configuring basic DHCP snooping,69 Configuring basic DHCPv6 snooping,256 Configuring DHCP server compatibility,42 Configuring DNS spoofing,86 Configuring dynamic NAT,121 Configuring IP address conflict detection,41 Configuring IP unnumbered,17 Configuring IPsec for ADVPN tunnels,330 Configuring IPv6 address acquisition,245 Configuring IPv6 address assignment,232 Configuring IPv6 ND,206 Configuring IPv6 prefix acquisition,246 Configuring IPv6 prefix assignment,231 Configuring MTU for an interface,179 Configuring NAT hairpin,127 Configuring NAT logging,128 Configuring NAT Server,123 Configuring NAT with ALG,127 Configuring NAT with DNS mapping,127 Configuring NAT444,125 Configuring network parameters assignment,233 Configuring Option 18 and Option 37,256 Configuring Option 82,70 Configuring Option 82,57 Configuring path MTU discovery,213 Configuring rate limit for ICMP error messages,184 Configuring routing,330 Configuring stateless DHCPv6,246 Configuring static NAT,118 Configuring TCP MSS for an interface,180 Configuring TCP path MTU discovery,180
418 Configuring TCP timers,182 Configuring the DHCP relay agent security functions,55 Configuring the DHCP relay agent to release an IP address,57 Configuring the DHCPv6 server on an interface,235 Configuring the DNS proxy,86 Configuring the DNS trusted interface,87 Configuring the IPv4 DNS client,83 Configuring the IPv6 DNS client,84 Configuring the TCP buffer size,182 Configuring the VAM client,325 Configuring the VAM server,319 Configuring UDP helper to convert broadcast to multicast,188 Configuring UDP helper to convert broadcast to unicast,187 Configuring UDP helper to convert multicast to broadcast or unicast,189 Contacting HP,401 Controlling sending ICMPv6 messages,214 Conventions,402 D DDNS client configuration task list,103 DDNS configuration examples,106 DHCP address allocation,22 DHCP client configuration example,64 DHCP message format,24 DHCP options,25 DHCP relay agent configuration examples,59 DHCP relay agent configuration task list,53 DHCP server configuration examples,44 DHCP server configuration task list,31 DHCP snooping configuration examples,74 DHCP snooping configuration task list,69 DHCPv6 address/prefix assignment,224 DHCPv6 client configuration examples,247 DHCPv6 client configuration task list,245 DHCPv6 relay agent configuration example,243 DHCPv6 server configuration examples,237 DHCPv6 snooping configuration example,259 DHCPv6 snooping configuration task list,256 Displaying and maintaining ADVPN,330 Displaying and maintaining ARP,6 Displaying and maintaining BOOTP client,78 Displaying and maintaining DHCP snooping,74 Displaying and maintaining DHCPv6 client,247 Displaying and maintaining DHCPv6 snooping,259 Displaying and maintaining fast forwarding,167 Displaying and maintaining GRE,307 Displaying and maintaining IP addressing,18 Displaying and maintaining IP performance optimization,185 Displaying and maintaining IPv4 DNS,88 Displaying and maintaining IPv6 basics,217 Displaying and maintaining IPv6 fast forwarding,261 Displaying and maintaining NAT,130 Displaying and maintaining the DHCP client,64 Displaying and maintaining the DHCP relay agent,58 Displaying and maintaining the DHCP server,43 Displaying and maintaining the DHCPv6 relay agent,243 Displaying and maintaining the DHCPv6 server,236 Displaying and maintaining tunneling configuration,298 Displaying and maintaining UDP helper,190 Displaying DDNS,106 Displaying FIB table entries,165 Displaying proxy ARP,13 DNS configuration task list,82 E Enabling an interface to receive and forward directed broadcasts destined for the directly connected network,178 Enabling ARP logging,6 Enabling common proxy ARP,12 Enabling DHCP,54 Enabling DHCP,40 Enabling DHCP starvation attack protection,72 Enabling DHCP-REQUEST attack protection,73 Enabling DHCPv6-REQUEST check,258 Enabling duplicated address detection,63 Enabling dynamic ARP entry check,5 Enabling handling of Option 82,41 Enabling IP conflict notification,10 Enabling local proxy ARP,12 Enabling sending ICMP error messages,182 Enabling TCP SYN Cookie,181 Enabling the DHCP client on an interface,62 Enabling the DHCP relay agent on an interface,54 405
419 Enabling the DHCP server on an interface,40 F Fast forwarding configuration example,168 Feature and hardware compatibility,170 Feature and hardware compatibility,69 Feature and hardware compatibility,254 FIB table,165 G GRE configuration examples,308 H HP implementation of Option 18 and Option 37,254 I IPv4 DNS configuration examples,89 IPv6 basics configuration example,219 IPv6 basics configuration task list,202 IPv6 DNS configuration examples,94 IPv6 fast forwarding configuration example,262 IPv6 transition technologies,200 IRDP configuration example,175 N NAT configuration examples,131 NAT configuration task list,118 NAT entries,116 NAT implementations,112 NAT translation control,112 NAT types,111 O Obtaining an IP address dynamically,77 Overview,102 Overview,79 Overview,9 Overview,67 Overview,314 Overview,261 Overview,29 Overview,15 Overview,227 Overview,265 Overview,300 Overview,1 Overview,173 Overview,52 Overview,245 Overview,187 Overview,167 Overview,194 Overview,253 P Protocols and standards,201 Protocols and standards,77 Protocols and standards,27 Protocols and standards,226 R Related information,401 S Saving DHCP snooping entries,71 Saving DHCPv6 snooping entries,257 Setting the aging timer for dynamic ARP entries,5 Setting the DSCP value for DHCP packets sent by the DHCP client,63 Setting the DSCP value for DHCP packets sent by the DHCP relay agent,58 Setting the DSCP value for DHCP packets sent by the DHCP server,43 Setting the DSCP value for DHCPv6 packets sent by the DHCPv6 client,247 Setting the DSCP value for DHCPv6 packets sent by the DHCPv6 server,236 Setting the DSCP value for outgoing DDNS packets,106 Setting the DSCP value for outgoing DNS packets,88 Setting the maximum number of DHCP snooping entries,73 Setting the maximum number of DHCPv6 snooping entries,258 Setting the maximum number of dynamic ARP entries for a device,4 Setting the maximum number of dynamic ARP entries for an interface,4 Specifying a flow classification policy,170 Specifying DHCP servers on a relay agent,54 Specifying the source address for ICMP packets,184 Specifying the source interface for DNS packets,87 Stateless DHCPv6,226 T Terminology,
420 Troubleshooting DHCP relay agent configuration,60 Troubleshooting DHCP server configuration,51 Troubleshooting GRE,313 Troubleshooting IPv4 DNS configuration,100 Troubleshooting IPv6 basics configuration,223 Troubleshooting IPv6 DNS configuration,100 Troubleshooting tunneling configuration,299 Tunneling configuration task list,273 U UDP helper configuration examples,190 Using NAT with other features,
H3C MSR Series Routers
H3C MSR Series Routers Layer 3 - IP Services Configuration Guide(V7) Hangzhou H3C Technologies Co., Ltd. http://www.h3c.com Software version: MSR-CMW710-R0007 Document version: 6W100-20140320 Copyright
HP 5820X & 5800 Switch Series Layer 3 - IP Services. Configuration Guide. Abstract
HP 5820X & 5800 Switch Series Layer 3 - IP Services Configuration Guide Abstract This document describes the software features for the HP A Series products and guides you through the software configuration
HP 5120 SI Switch Series
HP 5120 SI Switch Series Layer 3 - IP Services Command Reference Part number: 5998-1810 Software version: Release 1505 Document version: 6W102-20121111 Legal and notice information Copyright 2012 Hewlett-Packard
Table of Contents 1 IP Addressing Configuration 1-1
Table of Contents 1 IP Addressing Configuration 1-1 IP Addressing Overview 1-1 IP Address Classes 1-1 Special IP Addresses 1-2 Subnetting and Masking 1-2 Configuring IP Addresses 1-3 Assigning an IP Address
NAT Configuration. Contents. 1 NAT Configuration. 1.1 NAT Overview. 6 3 2014 NAT Configuration
NAT Configuration Contents 1 NAT Configuration 1.1 NAT Overview 1.2 NAT Features Supported by the AR1200 1.3 Configuring NAT 1.3.1 Establishing the Configuration Task 1.3.2 Configuring an Address Pool
Course Overview: Learn the essential skills needed to set up, configure, support, and troubleshoot your TCP/IP-based network.
Course Name: TCP/IP Networking Course Overview: Learn the essential skills needed to set up, configure, support, and troubleshoot your TCP/IP-based network. TCP/IP is the globally accepted group of protocols
HP A-F1000-A-EI_A-F1000-S-EI VPN Firewalls
HP A-F1000-A-EI_A-F1000-S-EI VPN Firewalls NAT Command Reference Part number: 5998-2659 Document version: 6PW100-20110909 Legal and notice information Copyright 2011 Hewlett-Packard Development Company,
Guide to Network Defense and Countermeasures Third Edition. Chapter 2 TCP/IP
Guide to Network Defense and Countermeasures Third Edition Chapter 2 TCP/IP Objectives Explain the fundamentals of TCP/IP networking Describe IPv4 packet structure and explain packet fragmentation Describe
IPv6 Fundamentals: A Straightforward Approach
IPv6 Fundamentals: A Straightforward Approach to Understanding IPv6 Rick Graziani Cisco Press 800 East 96th Street Indianapolis, IN 46240 IPv6 Fundamentals Contents Introduction xvi Part I: Background
IP Routing Features. Contents
7 IP Routing Features Contents Overview of IP Routing.......................................... 7-3 IP Interfaces................................................ 7-3 IP Tables and Caches........................................
Procedure: You can find the problem sheet on Drive D: of the lab PCs. 1. IP address for this host computer 2. Subnet mask 3. Default gateway address
Objectives University of Jordan Faculty of Engineering & Technology Computer Engineering Department Computer Networks Laboratory 907528 Lab.4 Basic Network Operation and Troubleshooting 1. To become familiar
Networking Test 4 Study Guide
Networking Test 4 Study Guide True/False Indicate whether the statement is true or false. 1. IPX/SPX is considered the protocol suite of the Internet, and it is the most widely used protocol suite in LANs.
Technical Support Information Belkin internal use only
The fundamentals of TCP/IP networking TCP/IP (Transmission Control Protocol / Internet Protocols) is a set of networking protocols that is used for communication on the Internet and on many other networks.
HP Load Balancing Module
HP Load Balancing Module Load Balancing Configuration Guide Part number: 5998-2685 Document version: 6PW101-20120217 Legal and notice information Copyright 2012 Hewlett-Packard Development Company, L.P.
Guide to TCP/IP, Third Edition. Chapter 3: Data Link and Network Layer TCP/IP Protocols
Guide to TCP/IP, Third Edition Chapter 3: Data Link and Network Layer TCP/IP Protocols Objectives Understand the role that data link protocols, such as SLIP and PPP, play for TCP/IP Distinguish among various
2. IP Networks, IP Hosts and IP Ports
1. Introduction to IP... 1 2. IP Networks, IP Hosts and IP Ports... 1 3. IP Packet Structure... 2 4. IP Address Structure... 2 Network Portion... 2 Host Portion... 3 Global vs. Private IP Addresses...3
IPv6 Trace Analysis using Wireshark Nalini Elkins, CEO Inside Products, Inc. [email protected]
1 IPv6 Trace Analysis using Wireshark Nalini Elkins, CEO Inside Products, Inc. [email protected] Agenda What has not changed between IPv4 and IPv6 traces What has changed between IPv4 and
Network Protocol Configuration
Table of Contents Table of Contents Chapter 1 Configuring IP Addressing... 1 1.1 IP Introduction... 1 1.1.1 IP... 1 1.1.2 IP Routing Protocol... 1 1.2 Configuring IP Address Task List... 2 1.3 Configuring
Interconnecting Cisco Networking Devices Part 2
Interconnecting Cisco Networking Devices Part 2 Course Number: ICND2 Length: 5 Day(s) Certification Exam This course will help you prepare for the following exam: 640 816: ICND2 Course Overview This course
Layer 3 Routing User s Manual
User s Manual Second Edition, July 2011 www.moxa.com/product 2011 Moxa Inc. All rights reserved. User s Manual The software described in this manual is furnished under a license agreement and may be used
Introduction to IP v6
IP v 1-3: defined and replaced Introduction to IP v6 IP v4 - current version; 20 years old IP v5 - streams protocol IP v6 - replacement for IP v4 During developments it was called IPng - Next Generation
Chapter 3 Configuring Basic IPv6 Connectivity
Chapter 3 Configuring Basic IPv6 Connectivity This chapter explains how to get a ProCurve Routing Switch that supports IPv6 up and running. To configure basic IPv6 connectivity, you must do the following:
ProCurve Networking IPv6 The Next Generation of Networking
ProCurve Networking The Next Generation of Networking Introduction... 2 Benefits from... 2 The Protocol... 3 Technology Features and Benefits... 4 Larger number of addresses... 4 End-to-end connectivity...
Application Protocols for TCP/IP Administration
Application Protocols for TCP/IP Administration BootP, TFTP, DHCP Agenda BootP TFTP DHCP BootP, TFTP, DHCP, v4.4 2 Page 60-1 BootP (RFC 951, 1542, 2132) BootP was developed to replace RARP capabilities
HP A5820X & A5800 Switch Series Network Management and Monitoring. Configuration Guide. Abstract
HP A5820X & A5800 Switch Series Network Management and Monitoring Configuration Guide Abstract This document describes the software features for the HP A Series products and guides you through the software
100-101: Interconnecting Cisco Networking Devices Part 1 v2.0 (ICND1)
100-101: Interconnecting Cisco Networking Devices Part 1 v2.0 (ICND1) Course Overview This course provides students with the knowledge and skills to implement and support a small switched and routed network.
1 Data information is sent onto the network cable using which of the following? A Communication protocol B Data packet
Review questions 1 Data information is sent onto the network cable using which of the following? A Communication protocol B Data packet C Media access method D Packages 2 To which TCP/IP architecture layer
Troubleshooting Tools
Troubleshooting Tools An overview of the main tools for verifying network operation from a host Fulvio Risso Mario Baldi Politecnico di Torino (Technical University of Turin) see page 2 Notes n The commands/programs
- IPv4 Addressing and Subnetting -
1 Hardware Addressing - IPv4 Addressing and Subnetting - A hardware address is used to uniquely identify a host within a local network. Hardware addressing is a function of the Data-Link layer of the OSI
ICS 351: Today's plan
ICS 351: Today's plan Quiz, on overall Internet function, linux and IOS commands, network monitoring, protocols IPv4 addresses: network part and host part address masks IP interface configuration IPv6
Command Manual - Network Protocol Quidway S3000 Series Ethernet Switches. Table of Contents
Table of Contents Table of Contents Chapter 1 ARP Configuration Commands... 1-1 1.1 ARP Configuration Commands... 1-1 1.1.1 arp static... 1-1 1.1.2 arp timer aging... 1-2 1.1.3 debugging arp packet...
IP - The Internet Protocol
Orientation IP - The Internet Protocol IP (Internet Protocol) is a Network Layer Protocol. IP s current version is Version 4 (IPv4). It is specified in RFC 891. TCP UDP Transport Layer ICMP IP IGMP Network
Note: This case study utilizes Packet Tracer. Please see the Chapter 5 Packet Tracer file located in Supplemental Materials.
Note: This case study utilizes Packet Tracer. Please see the Chapter 5 Packet Tracer file located in Supplemental Materials. CHAPTER 5 OBJECTIVES Configure a router with an initial configuration. Use the
IP Addressing A Simplified Tutorial
Application Note IP Addressing A Simplified Tutorial July 2002 COMPAS ID 92962 Avaya Labs 1 All information in this document is subject to change without notice. Although the information is believed to
Chapter 6 Configuring IP
Chapter 6 Configuring IP This chapter describes the Internet Protocol (IP) parameters on HP ProCurve routing switches and switches and how to configure them. After you add IP addresses and configure other
Neighbour Discovery in IPv6
Neighbour Discovery in IPv6 Andrew Hines Topic No: 17 Email: [email protected] Organiser: Christian Schindelhauer University of Paderborn Immatriculation No: 6225220 August 4, 2004 1 Abstract
8.2 The Internet Protocol
TCP/IP Protocol Suite HTTP SMTP DNS RTP Distributed applications Reliable stream service TCP UDP User datagram service Best-effort connectionless packet transfer Network Interface 1 IP Network Interface
640-816: Interconnecting Cisco Networking Devices Part 2 v1.1
640-816: Interconnecting Cisco Networking Devices Part 2 v1.1 Course Introduction Course Introduction Chapter 01 - Small Network Implementation Introducing the Review Lab Cisco IOS User Interface Functions
Security Technology White Paper
Security Technology White Paper Issue 01 Date 2012-10-30 HUAWEI TECHNOLOGIES CO., LTD. 2012. All rights reserved. No part of this document may be reproduced or transmitted in any form or by any means without
CCT vs. CCENT Skill Set Comparison
Operation of IP Data Networks Recognize the purpose and functions of various network devices such as Routers, Switches, Bridges and Hubs Select the components required to meet a given network specification
SSL VPN Technology White Paper
SSL VPN Technology White Paper Keywords: SSL VPN, HTTPS, Web access, TCP access, IP access Abstract: SSL VPN is an emerging VPN technology based on HTTPS. This document describes its implementation and
NetStream (Integrated) Technology White Paper HUAWEI TECHNOLOGIES CO., LTD. Issue 01. Date 2012-9-6
(Integrated) Technology White Paper Issue 01 Date 2012-9-6 HUAWEI TECHNOLOGIES CO., LTD. 2012. All rights reserved. No part of this document may be reproduced or transmitted in any form or by any means
Configuring DHCP. DHCP Server Overview
Configuring DHCP This chapter describes how to configure Dynamic Host Configuration Protocol (DHCP). For a complete description of the DHCP commands listed in this chapter, refer to the DHCP s chapter
Configuring a Lan-to-Lan VPN with Overlapping Subnets with Juniper NetScreen/ISG/SSG Products
Application Note Configuring a Lan-to-Lan VPN with Overlapping Subnets with Juniper NetScreen/ISG/SSG Products Version 1.0 January 2008 Juniper Networks, Inc. 1194 North Mathilda Avenue Sunnyvale, CA 94089
Configuring Switch Ports and VLAN Interfaces for the Cisco ASA 5505 Adaptive Security Appliance
CHAPTER 5 Configuring Switch Ports and VLAN Interfaces for the Cisco ASA 5505 Adaptive Security Appliance This chapter describes how to configure the switch ports and VLAN interfaces of the ASA 5505 adaptive
RARP: Reverse Address Resolution Protocol
SFWR 4C03: Computer Networks and Computer Security January 19-22 2004 Lecturer: Kartik Krishnan Lectures 7-9 RARP: Reverse Address Resolution Protocol When a system with a local disk is bootstrapped it
Transport and Network Layer
Transport and Network Layer 1 Introduction Responsible for moving messages from end-to-end in a network Closely tied together TCP/IP: most commonly used protocol o Used in Internet o Compatible with a
Step-by-Step Guide for Setting Up IPv6 in a Test Lab
Step-by-Step Guide for Setting Up IPv6 in a Test Lab Microsoft Corporation Published: July, 2006 Author: Microsoft Corporation Abstract This guide describes how to configure Internet Protocol version 6
Guideline for setting up a functional VPN
Guideline for setting up a functional VPN Why do I want a VPN? VPN by definition creates a private, trusted network across an untrusted medium. It allows you to connect offices and people from around the
"Charting the Course...
Description "Charting the Course... Course Summary Interconnecting Cisco Networking Devices: Accelerated (CCNAX), is a course consisting of ICND1 and ICND2 content in its entirety, but with the content
Topic 7 DHCP and NAT. Networking BAsics.
Topic 7 DHCP and NAT Networking BAsics. 1 Dynamic Host Configuration Protocol (DHCP) IP address assignment Default Gateway assignment Network services discovery I just booted. What network is this? What
Internet Protocols. Addressing & Services. Updated: 9-29-2012
Internet Protocols Addressing & Services Updated: 9-29-2012 Virtual vs. Physical Networks MAC is the part of the underlying network MAC is used on the LAN What is the addressing mechanism in WAN? WAN is
Cisco Certified Network Associate Exam. Operation of IP Data Networks. LAN Switching Technologies. IP addressing (IPv4 / IPv6)
Cisco Certified Network Associate Exam Exam Number 200-120 CCNA Associated Certifications CCNA Routing and Switching Operation of IP Data Networks Operation of IP Data Networks Recognize the purpose and
Internet Protocol: IP packet headers. vendredi 18 octobre 13
Internet Protocol: IP packet headers 1 IPv4 header V L TOS Total Length Identification F Frag TTL Proto Checksum Options Source address Destination address Data (payload) Padding V: Version (IPv4 ; IPv6)
Catalyst Layer 3 Switch for Wake On LAN Support Across VLANs Configuration Example
Catalyst Layer 3 Switch for Wake On LAN Support Across VLANs Configuration Example Document ID: 91672 Contents Introduction Prerequisites Requirements Components Used Conventions Background Information
IPv6 Diagnostic and Troubleshooting
8 IPv6 Diagnostic and Troubleshooting Contents Introduction.................................................. 8-2 ICMP Rate-Limiting........................................... 8-2 Ping for IPv6 (Ping6)..........................................
Computer Networks. Lecture 3: IP Protocol. Marcin Bieńkowski. Institute of Computer Science University of Wrocław
Computer Networks Lecture 3: IP Protocol Marcin Bieńkowski Institute of Computer Science University of Wrocław Computer networks (II UWr) Lecture 3 1 / 24 In previous lectures We learned about layer 1
Understanding and Configuring NAT Tech Note PAN-OS 4.1
Understanding and Configuring NAT Tech Note PAN-OS 4.1 Revision C 2012, Palo Alto Networks, Inc. www.paloaltonetworks.com Contents Overview... 3 Scope... 3 Design Consideration... 3 Software requirement...
NetFlow Subinterface Support
NetFlow Subinterface Support Feature History Release Modification 12.2(14)S This feature was introduced. 12.2(15)T This feature was integrated into Cisco IOS Release 12.2 T. This document describes the
Hands On Activities: TCP/IP Network Monitoring and Management
Hands On Activities: TCP/IP Network Monitoring and Management 1. TCP/IP Network Management Tasks TCP/IP network management tasks include Examine your physical and IP network address Traffic monitoring
Scaling the Network: Subnetting and Other Protocols. Networking CS 3470, Section 1
Scaling the Network: Subnetting and Other Protocols Networking CS 3470, Section 1 Today CIDR Subnetting Private IP addresses ICMP, IMAP, and DHCP Protocols 2 Packet Encapsulation ** Creative Commons: http://en.wikipedia.org/wiki/file:udp_encapsulation.svg
Internet Control Protocols Reading: Chapter 3
Internet Control Protocols Reading: Chapter 3 ARP - RFC 826, STD 37 DHCP - RFC 2131 ICMP - RFC 0792, STD 05 1 Goals of Today s Lecture Bootstrapping an end host Learning its own configuration parameters
VRRP Technology White Paper
Issue 01 Date 2012-08-31 HUAWEI TECHNOLOGIES CO., LTD. 2012. All rights reserved. No part of this document may be reproduced or transmitted in any form or by any means without prior written consent of
Mobile IP. Bheemarjuna Reddy Tamma IIT Hyderabad. Source: Slides of Charlie Perkins and Geert Heijenk on Mobile IP
Mobile IP Bheemarjuna Reddy Tamma IIT Hyderabad Source: Slides of Charlie Perkins and Geert Heijenk on Mobile IP IP Refresher Mobile IP Basics 3 parts of Mobile IP: Outline Advertising Care-of Addresses
GLBP - Gateway Load Balancing Protocol
GLBP - Gateway Load Balancing Protocol Gateway Load Balancing Protocol (GLBP) protects data traffic from a failed router or circuit, like Hot Standby Router Protocol (HSRP) and Virtual Router Redundancy
Migration from Cisco GLBP to industry standard VRRPE
Migration from Cisco GLBP to industry standard VRRPE Technical white paper Table of contents Overview... 2 Gateway load balancing protocols... 2 Introduction to Cisco GLBP... 2 Introduction to VRRPE...
Configuring Static and Dynamic NAT Translation
This chapter contains the following sections: Network Address Translation Overview, page 1 Information About Static NAT, page 2 Dynamic NAT Overview, page 3 Timeout Mechanisms, page 4 NAT Inside and Outside
Configuring IP Load Sharing in AOS Quick Configuration Guide
Configuring IP Load Sharing in AOS Quick Configuration Guide ADTRAN Operating System (AOS) includes IP Load Sharing for balancing outbound IP traffic across multiple interfaces. This feature can be used
IP Addressing and Subnetting. 2002, Cisco Systems, Inc. All rights reserved.
IP Addressing and Subnetting 2002, Cisco Systems, Inc. All rights reserved. 1 Objectives Upon completion, you will be able to: Discuss the Types of Network Addressing Explain the Form of an IP Address
CCNA Discovery 4.0.3.0 Networking for Homes and Small Businesses Student Packet Tracer Lab Manual
4.0.3.0 Networking for Homes and Small Businesses Student Packet Tracer Lab Manual This document is exclusive property of Cisco Systems, Inc. Permission is granted to print and copy this document for non-commercial
Clustering. Configuration Guide IPSO 6.2
Clustering Configuration Guide IPSO 6.2 August 13, 2009 Contents Chapter 1 Chapter 2 Chapter 3 Overview of IP Clustering Example Cluster... 9 Cluster Management... 11 Cluster Terminology... 12 Clustering
Computer Networks. Introduc)on to Naming, Addressing, and Rou)ng. Week 09. College of Information Science and Engineering Ritsumeikan University
Computer Networks Introduc)on to Naming, Addressing, and Rou)ng Week 09 College of Information Science and Engineering Ritsumeikan University MAC Addresses l MAC address is intended to be a unique identifier
CCNA R&S: Introduction to Networks. Chapter 5: Ethernet
CCNA R&S: Introduction to Networks Chapter 5: Ethernet 5.0.1.1 Introduction The OSI physical layer provides the means to transport the bits that make up a data link layer frame across the network media.
Configuration IP Routing and Multicast Avaya Ethernet Routing Switch 4500 Series
Configuration IP Routing and Multicast Avaya Ethernet Routing Switch 4500 Series 5.4 NN47205-506, 02.02 November 2010 2010 Avaya Inc. All Rights Reserved. Notice While reasonable efforts have been made
IPv6 Functionality. Jeff Doyle IPv6 Solutions Manager [email protected]
IPv6 Functionality Jeff Doyle IPv6 Solutions Manager [email protected] Copyright 2003 Juniper Networks, Inc. Agenda ICMPv6 Neighbor discovery Autoconfiguration Agenda ICMPv6 Neighbor discovery Autoconfiguration
Chapter 13 Internet Protocol (IP)
Chapter 13 Internet Protocol (IP) Introduction... 13-5 IP Packets... 13-5 Addressing... 13-7 Subnets... 13-8 Assigning an IP Address... 13-9 Multihoming... 13-11 Local Interfaces... 13-11 Address Resolution
Interconnecting Cisco Network Devices 1 Course, Class Outline
www.etidaho.com (208) 327-0768 Interconnecting Cisco Network Devices 1 Course, Class Outline 5 Days Interconnecting Cisco Networking Devices, Part 1 (ICND1) v2.0 is a five-day, instructorled training course
HP A-IMC Firewall Manager
HP A-IMC Firewall Manager Configuration Guide Part number: 5998-2267 Document version: 6PW101-20110805 Legal and notice information Copyright 2011 Hewlett-Packard Development Company, L.P. No part of this
Ethernet. Ethernet. Network Devices
Ethernet Babak Kia Adjunct Professor Boston University College of Engineering ENG SC757 - Advanced Microprocessor Design Ethernet Ethernet is a term used to refer to a diverse set of frame based networking
Packet Capture. Document Scope. SonicOS Enhanced Packet Capture
Packet Capture Document Scope This solutions document describes how to configure and use the packet capture feature in SonicOS Enhanced. This document contains the following sections: Feature Overview
Computer Networks I Laboratory Exercise 1
Computer Networks I Laboratory Exercise 1 The lab is divided into two parts where the first part is a basic PC network TCP/IP configuration and connection to the Internet. The second part is building a
Firewalls und IPv6 worauf Sie achten müssen!
Firewalls und IPv6 worauf Sie achten müssen! Pascal Raemy CTO Asecus AG [email protected] Asecus AG Asecus AG Security (Firewall, Web-Gateway, Mail-Gateway) Application Delivery (F5 Neworks with BIGIP)
Network Layer: and Multicasting. 21.1 Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 21 Network Layer: Address Mapping, Error Reporting, and Multicasting 21.1 Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 21-1 ADDRESS MAPPING The delivery
Internetworking. Problem: There is more than one network (heterogeneity & scale)
Internetworking Problem: There is more than one network (heterogeneity & scale) Hongwei Zhang http://www.cs.wayne.edu/~hzhang Internetworking: Internet Protocol (IP) Routing and scalability Group Communication
Implementing DHCPv6 on an IPv6 network
Implementing DHCPv6 on an IPv6 network Benjamin Long [email protected] 8-11-2009 Implementing DHCPv6 on an IPv6 network 2 Table of Contents DHCPv6 Overview...3 Terms used by DHCPv6...3 DHCPv6 Message
DHCP, ICMP, IPv6. Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley DHCP. DHCP UDP IP Eth Phy
, ICMP, IPv6 UDP IP Eth Phy UDP IP Eth Phy Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley Some materials copyright 1996-2012 J.F Kurose and K.W. Ross, All Rights
- Basic Router Security -
1 Enable Passwords - Basic Router Security - The enable password protects a router s Privileged mode. This password can be set or changed from Global Configuration mode: Router(config)# enable password
Personal Firewall Default Rules and Components
Personal Firewall Default Rules and Components The Barracuda Personal Firewall comes with a default access ruleset. The following tables aim to give you a compact overview of the default rules and their
IPv6 Associated Protocols
IPv6 Associated Protocols 1 New Protocols (1) New features are specified in IPv6 Protocol -RFC 2460 DS Neighbor Discovery (NDP) -RFC 4861 DS Auto-configuration : Stateless Address Auto-configuration -RFC
Chapter 3 LAN Configuration
Chapter 3 LAN Configuration This chapter describes how to configure the advanced LAN features of your ProSafe Dual WAN Gigabit Firewall with SSL & IPsec VPN. This chapter contains the following sections
Nortel VPN Router Software Release V6_05.300
Nortel VPN Router Software Release V6_05.300 1. Release Summary Release Date: November 10, 2008 Purpose: Software Maintenance release to address customer found software issues. 2. Important Notes Before
UIP1868P User Interface Guide
UIP1868P User Interface Guide (Firmware version 0.13.4 and later) V1.1 Monday, July 8, 2005 Table of Contents Opening the UIP1868P's Configuration Utility... 3 Connecting to Your Broadband Modem... 4 Setting
Configure ISDN Backup and VPN Connection
Case Study 2 Configure ISDN Backup and VPN Connection Cisco Networking Academy Program CCNP 2: Remote Access v3.1 Objectives In this case study, the following concepts are covered: AAA authentication Multipoint
04 Internet Protocol (IP)
SE 4C03 Winter 2007 04 Internet Protocol (IP) William M. Farmer Department of Computing and Software McMaster University 29 January 2007 Internet Protocol (IP) IP provides a connectionless packet delivery
Firewall. FortiOS Handbook v3 for FortiOS 4.0 MR3
Firewall FortiOS Handbook v3 for FortiOS 4.0 MR3 FortiOS Handbook Firewall v3 24 January 2012 01-432-148222-20120124 Copyright 2012 Fortinet, Inc. All rights reserved. Contents and terms are subject to
This tutorial will help you in understanding IPv4 and its associated terminologies along with appropriate references and examples.
About the Tutorial Internet Protocol version 4 (IPv4) is the fourth version in the development of the Internet Protocol (IP) and the first version of the protocol to be widely deployed. IPv4 is described
Internet Protocol Address
SFWR 4C03: Computer Networks & Computer Security Jan 17-21, 2005 Lecturer: Kartik Krishnan Lecture 7-9 Internet Protocol Address Addressing is a critical component of the internet abstraction. To give
