307
Step Command Remarks
6. (Optional.) Set the DF bit for
tunneled packets.
tunnel dfbit enable
By default, the DF bit is not set for
tunneled packets.
Configuration example
Network requirements
As shown in Figure 127, the two subnets IPv4 group 1 and IPv4 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 127 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/0/1.
<RouterA> system-view
[RouterA] interface gigabitethernet 2/0/1
[RouterA-GigabitEthernet2/0/1] ip address 10.1.1.1 255.255.255.0
[RouterA-GigabitEthernet2/0/1] quit
# Specify an IPv4 address for Serial 2/1/0, which is the physical interface of the tunnel.
[RouterA] interface serial 2/1/0
[RouterA-Serial2/1/0] ip address 2.1.1.1 255.255.255.0
[RouterA-Serial2/1/0] quit
# Create the 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 10.1.2.1 255.255.255.0
# Specify the IP address of Serial 2/1/0 as the source address for the tunnel interface.
[RouterA-Tunnel1] source 2.1.1.1
# Specify the IP address of Serial 2/1/1 on Router B as the destination address for the tunnel
interface.
[RouterA-Tunnel1] destination 3.1.1.1
[RouterA-Tunnel1] quit
# Configure a static route destined for IPv4 group 2 through the tunnel interface.
[RouterA] ip route-static 10.1.3.0 255.255.255.0 tunnel 1
• Configure Router B:
# Specify an IPv4 address for GigabitEthernet 2/0/1.