HP 6125G HP 6125G & 6125G/XG Blade Switches Layer 3 - IP Services Conf - Page 29

Assigning an IP address to an interface, Configuration guidelines, Configuration procedure

Page 29 highlights

Assigning an IP address to an interface You can assign an interface one primary address and multiple secondary addresses. Generally, you only need to assign the primary address to an interface. In some cases, you need to assign secondary IP addresses to the interface. For example, if the interface connects to two subnets, to enable the device to communicate with all hosts on the LAN, you need to assign a primary IP address and a secondary IP address to the interface. Configuration guidelines Follow these guidelines when you assign an IP address to an interface: • Each interface has only one primary IP address. A newly configured primary IP address overwrites the previous one. • Each interface has only one IP address. A newly configured IP address overwrites the previous one. • You cannot assign secondary IP addresses to an interface that obtains an IP address through BOOTP or DHCP. • The primary and secondary IP addresses you assign to the interface can be located on the same network segment, but different interfaces on your device must reside on different network segments. • You can manually assign an IP address to an interface, or configure the interface to obtain an IP address through BOOTP or DHCP. If you change the way an interface obtains an IP address, the new IP address overwrites the previous one. Configuration procedure To assign an IP address to an interface: Step 1. Enter system view. 2. Enter interface view. 3. Assign an IP address to the interface. Command Remarks system-view N/A interface interface-type interface-number N/A ip address ip-address { mask-length By default, no IP address is assigned to | mask } [ sub ] any interface. Configuration example Network requirements As shown in Figure 13, a port in VLAN 1 on a 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 subnets to communicate with the external network through the switch, and to enable the hosts on the two subnets to communicate with each other: • Assign a primary IP address and a secondary IP address to VLAN-interface 1 on the switch. • Set the primary IP address of VLAN-interface 1 as the gateway address of the hosts on subnet 172.16.1.0/24, and the secondary IP address of VLAN-interface 1 as the gateway address of the hosts on subnet 172.16.2.0/24. 21

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165

21
Assigning an IP address to an interface
You can assign an interface one primary address and multiple secondary addresses.
Generally, you only need to assign the primary address to an interface. In some cases, you need to
assign secondary IP addresses to the interface. For example, if the interface connects to two subnets, to
enable the device to communicate with all hosts on the LAN, you need to assign a primary IP address
and a secondary IP address to the interface.
Configuration guidelines
Follow these guidelines when you assign an IP address to an interface:
Each interface has only one primary IP address. A newly configured primary IP address overwrites
the previous one.
Each interface has only one IP address. A newly configured IP address overwrites the previous one.
You cannot assign secondary IP addresses to an interface that obtains an IP address through
BOOTP or DHCP.
The primary and secondary IP addresses you assign to the interface can be located on the same
network segment, but different interfaces on your device must reside on different network segments.
You can manually assign an IP address to an interface, or configure the interface to obtain an IP
address through BOOTP or DHCP. If you change the way an interface obtains an IP address, the
new IP address overwrites the previous one.
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.
interface
interface-type
interface-number
N/A
3.
Assign an IP address to
the interface.
ip
address
ip-address
{
mask-length
|
mask
} [
sub
]
By default, no IP address is assigned to
any interface.
Configuration example
Network requirements
As shown in
Figure 13
, a port in VLAN 1 on a 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 subnets to communicate with the external network through the switch, and
to enable the hosts on the two subnets to communicate with each other:
Assign a primary IP address and a secondary IP address to VLAN-interface 1 on the switch.
Set the primary IP address of VLAN-interface 1 as the gateway address of the hosts on subnet
172.16.1.0/24, and the secondary IP address of VLAN-interface 1 as the gateway address of the
hosts on subnet 172.16.2.0/24.