This section provides an example for configuring IP address unnumbered on an interface.
As shown in Figure 1, an enterprise builds its intranet through an integrated services digital network (ISDN). DeviceA and DeviceB connect to a local LAN through GE 0/1/0 and connect to each other over the ISDN through dialing interfaces GE 0/1/8. To save IP address resources, the dialing interfaces are configured to borrow IP addresses from GE 0/1/0.
The configuration roadmap is as follows:
Configure IP addresses to be borrowed.
Configure interfaces to borrow IP addresses from other interfaces.
To complete the configuration, you need the following data:
IP addresses of the numbered interfaces
Numbers of the numbered interfaces
# Configure an IP address for GE 0/1/0.
<HUAWEI> system-view [~HUAWEI] sysname DeviceA [*HUAWEI] commit [~DeviceA] interface gigabitethernet 0/1/0 [~DeviceA-GigabitEthernet0/1/0] ip address 172.16.10.1 255.255.255.0 [*DeviceA-GigabitEthernet0/1/0] undo shutdown [*DeviceA-GigabitEthernet0/1/0] quit
# Configure GE 0/1/8 to borrow the IP address from GE 0/1/0.
[*DeviceA] interface GigabitEthernet 0/1/8 [*DeviceA-GigabitEthernet0/1/8] ip address unnumbered interface gigabitethernet 0/1/0 [*DeviceA-GigabitEthernet0/1/8] undo shutdown [*DeviceA-GigabitEthernet0/1/8] quit
# Configure an IP address for GE 0/1/0.
<HUAWEI> system-view [~HUAWEI] sysname DeviceB [*HUAWEI] commit [~DeviceB] interface gigabitethernet 0/1/0 [~DeviceB-GigabitEthernet0/1/0] ip address 172.16.20.1 255.255.255.0 [*DeviceB-GigabitEthernet0/1/0] undo shutdown [*DeviceB-GigabitEthernet0/1/0] quit
# Configure GE 0/1/8 to borrow the IP address from GE 0/1/0.
[*DeviceB] interface GigabitEthernet 0/1/8 [*DeviceB-GigabitEthernet0/1/8] ip address unnumbered interface gigabitethernet 0/1/0 [*DeviceB-GigabitEthernet0/1/8] undo shutdown [*DeviceB-GigabitEthernet0/1/8] quit
# Configure a route to the Ethernet network segment of Device B.
[*DeviceB] ip route-static 172.16.10.0 255.255.255.0 GigabitEthernet 0/1/8 [*DeviceB] commit
# Ping the IP address of DeviceB's interface that directly connects to DeviceA from DeviceA. The ping operation is successful.
[~DeviceA] ping 172.16.20.1 PING 172.16.20.2: 56 data bytes, press CTRL_C to break Reply from 172.16.20.2: bytes=56 Sequence=1 ttl=255 time=25 ms Reply from 172.16.20.2: bytes=56 Sequence=2 ttl=255 time=25 ms Reply from 172.16.20.2: bytes=56 Sequence=3 ttl=255 time=26 ms Reply from 172.16.20.2: bytes=56 Sequence=4 ttl=255 time=26 ms Reply from 172.16.20.2: bytes=56 Sequence=5 ttl=255 time=26 ms --- 172.16.20.2 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 25/25/26 ms
DeviceA configuration file
# sysname DeviceA # interface GigabitEthernet0/1/0 undo shutdown ip address 172.16.10.1 255.255.255.0 # interface GigabitEthernet0/1/8 undo shutdown ip address unnumbered interface GigabitEthernet0/1/0 # ip route-static 172.16.20.0 255.255.255.0 GigabitEthernet0/1/8 # return
DeviceB configuration file
# sysname DeviceB # interface GigabitEthernet0/1/0 undo shutdown ip address 172.16.20.1 255.255.255.0 # interface GigabitEthernet0/1/8 undo shutdown ip address unnumbered interface GigabitEthernet0/1/0 # ip route-static 172.16.10.0 255.255.255.0 GigabitEthernet0/1/8 # return