H3C S9500 Operation Manual-Release2132[V2.03]-02 IP Services Volume

HomeSupportSwitchesH3C S9500 Series SwitchesConfigure & DeployConfiguration GuidesH3C S9500 Operation Manual-Release2132[V2.03]-02 IP Services Volume
04-IP Addressing Configuration
Title Size Download
04-IP Addressing Configuration 125.44 KB

Chapter 1  IP Addressing Configuration

When assigning IP addresses to interfaces on your device, go to these sections for information you are interested in:

l           IP Addressing Overview

l           Configuring IP Addresses

l           Configuring IP Unnumbered

l           Displaying IP Addressing Configuration

1.1  IP Addressing Overview

This section covers these topics:

l           IP Address Classes

l           Special Case IP Addresses

l           Subnetting and Masking

l           IP Unnumbered

1.1.1  IP Address Classes

IP addressing uses a 32-bit address to identify each host on a network. An example is 01010000100000001000000010000000 in binary. To make IP addresses in 32-bit form easier to read, they are written in dotted decimal notation, each being four octets in length, for example, 10.1.1.1 for the address just mentioned.

Each IP address breaks down into two parts:

l           Net-id: First several bits of the IP address defining a network, also known as class bits.

l           Host-id: Identifies a host on a network.

For administration sake, IP addresses are divided into five classes. Which class an IP address belongs to depends on the first one to four bits of the net-id, as shown in the following figure (in which the blue parts represent the address class).

Figure 1-1 IP address classes

Table 1-1 describes the address ranges of these five classes. Currently, the first three classes of IP addresses are used in quantity.

Table 1-1 IP address classes and ranges

Class

Address range

Description

A

0.0.0.0 to 127.255.255.255

The IP address 0.0.0.0 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 out.

B

128.0.0.0 to 191.255.255.255

––

C

192.0.0.0 to 223.255.255.255

––

D

224.0.0.0 to 239.255.255.255

Multicast address

E

240.0.0.0 to 247.255.255.255

Reserved address

 

1.1.2  Special Case IP Addresses

The following IP addresses are for special use, and they cannot be used as host IP addresses:

l           IP address with an all-zero net ID: Identifies a host on the local network. For example, IP address 0.0.0.16 indicates the host with a host ID of 16 on the local network.

l           IP address with an all-zero host ID: Identifies a network.

l           IP address with an all-one host ID: Identifies a directed broadcast address. For example, a packet with the destination address of 192.168.1.255 will be broadcasted to all the hosts on the network 192.168.1.0.

1.1.3  Subnetting and Masking

Subnetting was developed to address the risk of IP address exhaustion resulting from fast expansion of the Internet. The idea is to break a network down into smaller networks called subnets by using some bits of the host-id to create a subnet-id. To identify the boundary between the host-id and the combination of net-id and subnet-id, masking is used. (When subnetting is not adopted, a mask identifies the boundary between the host-id and the host-id.)

Each subnet mask comprises 32 bits related to the corresponding bits in an IP address. In a subnet mask, the part containing consecutive ones identifies the combination of net-id and subnet-id whereas the part containing consecutive zeros identifies the host-id.

Subnetting is valid with a single network. All these subnetworks appear as one. As subnetting adds an additional level, subnet-id, to the two-level hierarchy with IP addressing, IP routing now involves three steps: delivery to the site, delivery to the subnet, and delivery to the host.

Figure 1-2 shows how a Class B network is subnetted.

Figure 1-2 Subnet a Class B network

In the absence of subnetting, some special addresses such as the addresses with the net-id of all zeros and the addresses with the host-id of all ones, are not assignable to hosts. The same is true of subnetting. When designing your network, you should note that subnetting is somewhat a tradeoff between subnets and accommodated hosts. For example, a Class B network can accommodate 65,534 (216 – 2. Of the two deducted Class B addresses, one with an all-one host-id is the broadcast address and the other with an all-zero host-id is the network address) hosts before being subnetted. After you break it down into 512 (29) subnets by using the first 9 bits of the host-id for the subnet, you have only 7 bits for the host-id and thus have only 126 (27 – 2) hosts in each subnet. The maximum number of hosts is thus 64,512 (512 × 126), 1022 less after the network is subnetted.

Class A, B, and C networks, before being subnetted, use these default masks (also called natural masks): 255.0.0.0, 255.255.0.0, and 255.255.255.0 respectively.

1.1.4  IP Unnumbered

Logically, to enable IP on an interface, you must assign this interface a unique IP address. Yet, you can borrow an IP address already configured on one of other interfaces on your device instead. This is called IP unnumbered and the interface borrowing the IP address is called IP unnumbered interface.

You may need to use IP unnumbered to save IP addresses either when available IP addresses are inadequate or when an interface is brought up but for occasional use.

1.2  Configuring IP Addresses

Currently, the S9500 series switches support only manual IP address configuration.

1.2.1  Assigning an IP Address to an Interface

You may assign an interface multiple IP addresses, one primary and multiple secondaries, to connect multiple logical subnets on the same physical subnet.

Follow these steps to assign an IP address to an interface:

To do…

Use the command…

Remarks

Enter system view

system-view

––

Enter interface view

interface interface-type interface-number

The IP address can be configured on a VLAN interface, POS interface, and tunnel interface, but cannot be configured in Ethernet interface view.

Assign an IP address to the interface

ip address ip-address { mask | mask-length } [ sub ]

Required

No IP address is assigned by default.

 

  Caution:

l      The primary IP address you assigned to the interface can overwrite the previous one if there is any.

l      You cannot assign a secondary IP address when the interface is configured to borrow one through IP unnumbered.

 

1.2.2  IP Addressing Configuration Example

I. Network requirements

As shown in Figure 1-3, the VLAN-interface 1 on Switch is connected to a LAN comprising two segments: 172.16.1.0/24 and 172.16.2.0/24.

To enable the hosts on the two network segments to access external networks through Switch and to communicate with each other, do the following

l           Assign two IP addresses to VLAN-interface 1 on the switch.

l           Set the switch as the gateway on all PCs.

II. Network diagram

Figure 1-3 Network diagram for IP addressing configuration

III. Configuration procedure

# Assign a primary IP address and a secondary IP address to VLAN-interface 1.

<Sysname> system-view

[Sysname] interface vlan-interface 1

[Sysname-Vlan-interface1] ip address 172.16.1.1 255.255.255.0

[Sysname-Vlan-interface1] ip address 172.16.2.1 255.255.255.0 sub

# Set the gateway address to 172.16.1.1 on the PCs attached to the subnet 172.16.1.0/24, and to 172.16.2.1 on the PCs attached to the subnet 172.16.2.0/24. The configuration method may vary with operating systems, so you need to refer to the operating system configuration manual of the PC.

# Use the ping command to verify the connectivity between Switch and the hosts on the subnet 172.16.1.0/24.

<Sysname> ping 172.16.1.2

  PING 172.16.1.2: 56  data bytes, press CTRL_C to break

    Reply from 172.16.1.2: bytes=56 Sequence=1 ttl=255 time=25 ms

    Reply from 172.16.1.2: bytes=56 Sequence=2 ttl=255 time=27 ms

    Reply from 172.16.1.2: bytes=56 Sequence=3 ttl=255 time=26 ms

    Reply from 172.16.1.2: bytes=56 Sequence=4 ttl=255 time=26 ms

    Reply from 172.16.1.2: bytes=56 Sequence=5 ttl=255 time=26 ms

 

  --- 172.16.1.2 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 25/26/27 ms

The above information shows that Switch can communicate with the hosts on the subnet 172.16.1.0/24.

# Use the ping command to verify the connectivity between Switch and the hosts on the subnet 172.16.2.0/24.

<Sysname> ping 172.16.2.2

  PING 172.16.2.2: 56  data bytes, press CTRL_C to break

    Reply from 172.16.2.2: bytes=56 Sequence=1 ttl=255 time=25 ms

    Reply from 172.16.2.2: bytes=56 Sequence=2 ttl=255 time=26 ms

    Reply from 172.16.2.2: bytes=56 Sequence=3 ttl=255 time=26 ms

    Reply from 172.16.2.2: bytes=56 Sequence=4 ttl=255 time=26 ms

    Reply from 172.16.2.2: bytes=56 Sequence=5 ttl=255 time=26 ms

 

  --- 172.16.2.2 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 25/25/26 ms

The above information shows that Switch can communicate with the hosts on the subnet 172.16.2.0/24.

# Use the ping command to verify the connectivity between hosts on the subnet 172.16.1.0/24 and hosts on subnet 172.16.2.0/24. Ping Host B from Host A to verify that the ping operation is successful.

1.3  Configuring IP Unnumbered

This section includes:

l           Configuration Prerequisites

l           Configuration Procedure

l           IP Unnumbered Configuration Example

1.3.1  Configuration Prerequisites

Assign a primary IP address to the interface from which you want to borrow the IP address.

1.3.2  Configuration Procedure

Follow these steps to configure IP unnumbered on an interface:

To do…

Use the command…

Remarks

Enter system view

system-view

––

Enter POS interface view

interface pos interface-number

––

Specify the current interface to borrow the IP address of the specified interface

ip address unnumbered interface interface-type interface-number

Required

The interface does not borrow IP addresses from other interfaces by default.

 

  Caution:

l      One interface cannot borrow an IP address from an unnumbered interface.

l      Multiple interfaces can use the same unnumbered IP address.

l      One interface borrows only the primary IP address among multiple IP addresses from another interface.

l      The IP address of the borrowing interface always keeps consistent and varies with that of the borrowed interface. That is, if an IP address is configured for the borrowed interface, the IP address of the borrowing interface is the same as that of the borrowed interface; if no IP address is configured for the borrowed interface, no IP address is assigned for the borrowing interface.

l      VLAN interfaces, tunnel interfaces, and loopback interfaces cannot borrow IP addresses of other interfaces, but other interfaces can borrow IP addresses of these interfaces.

l      A VLAN interface should be created before its IP address can be borrowed.

 

1.3.3  IP Unnumbered Configuration Example

I. Network requirements

Two switches, Switch A and Switch B, on an intranet are connected to each other through POS interfaces across DDN. The interfaces connecting them to DDN are both POS 2/1/1. They each connect to a LAN through interface VLAN-interface 1.

To save IP addresses, configure the POS interfaces to borrow IP addresses from the VLAN interfaces. The IP address of VLAN-interface 1 on Switch A is 172.16.10.1/24, and the IP address of VLAN-interface 1 on Switch B is 172.16.20.1/24.

II. Network diagram

Figure 1-4 Network diagram for IP unnumbered configuration

III. Configuration procedure

1)         Configure Switch A

# Assign an IP address to VLAN-interface 1.

<SysnameA> system-view

[SysnameA] interface vlan-interface 1

[SysnameA-Vlan-interface1] ip address 172.16.10.1 255.255.255.0

[SysnameA-Vlan-interface1] quit

# Configure the POS interface to borrow an IP address from VLAN-interface 1.

[SysnameA] interface pos 2/1/1

[SysnameA-Pos2/1/1] ip address unnumbered interface vlan-interface 1

[SysnameA-Pos2/1/1] link-protocol ppp

[SysnameA-Pos2/1/1] quit

# Create a route to the segment attached to Switch B, specifying interface POS2/1/1 as the outgoing interface.

[SysnameA] ip route-static 172.16.20.0 255.255.255.0 pos 2/1/1

2)         Configure Switch B

# Assign an IP address to VLAN-interface 1.

<SysnameB> system-view

[SysnameB] interface vlan-interface 1

[SysnameB-Vlan-interface1] ip address 172.16.20.1 255.255.255.0

[SysnameB-Vlan-interface1] quit

# Configure the POS interface to borrow an IP address from VLAN-interface 1.

[SysnameB] interface pos 2/1/1

[SysnameB-Pos2/1/1] ip address unnumbered interface vlan-interface 1

[SysnameB-Pos2/1/1] link-protocol ppp

[SysnameB-Pos2/1/1] quit

# Create a route to the segment attached to Switch A, specifying interface POS2/1/1 as the outgoing interface.

[SysnameB] ip route-static 172.16.10.0 255.255.255.0 pos 2/1/1

3)         Ping a host attached to Switch B from Switch A to verify the configuration.

[Sysname] ping 172.16.20.2

  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

1.4  Displaying IP Addressing Configuration

To do…

Use the command…

Remarks

Display information about a specified or all Layer 3 interfaces

display ip interface [ interface-type interface-number ]

Available in any view

Display brief information about a specified or all Layer 3 interfaces

display ip interface brief [ interface-type interface-number ]

Available in any view

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become A Partner
  • Partner Policy & Program
  • Global Learning
  • Partner Sales Resources
  • Partner Business Management
  • Service Business
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网