Assigning IP Address
You can assign IP address through a DHCP server or manually.
Use a DHCP server for centralized control and automatic assignment of IP information after the server is configured.
Configuring DHCP
Understanding DHCP
DHCP provides configuration information to Internet hosts and internetworking devices. This protocol consists of two components: one for delivering configuration parameters from a DHCP server to a device and a mechanism for allocating network addresses to devices. DHCP is built on a client-server model, in which designated DHCP servers allocate network addresses and deliver configuration parameters to dynamically configured devices.
DHCP client support is enabled on the Fast Ethernet 0/1 or VLAN interface on the LoRaWAN Gateway for automatic IPv4 address assignment.
The DHCP server, which supplies the IP addresses to the LoRaWAN Gateway interfaces, does not need to be on the same subnet as the LoRaWAN Gateway. However, when the DHCP server and the LoRaWAN Gateway are on different subnets, DHCP relay must be active in the network. Generally, DHCP relay is configured on a LoRaWAN Gateway in the path between the LoRaWAN Gateway and the DHCP server. The DNS address and default gateway can also be assigned via DHCP.
Enabling DHCP on Interfaces
To assign IP address by negotiation via DHCP, use the ip address dhcp privileged EXEC command.
Beginning in privileged EXEC mode, follow these steps to enable DHCP on interfaces:
Procedure
Command or Action | Purpose | |||
---|---|---|---|---|
Step 1 |
configure terminal |
Enter global configuration mode. |
||
Step 2 |
interface interface_type interface_number |
Enter interface configuration mode. |
||
Step 3 |
ip address dhcp |
Enable DHCP client on the interface to allow automatic assignment of IP addresses to the specified interface. |
||
Step 4 |
description [interface_description ] |
Enter description for the interface. |
||
Step 5 |
exit |
Return to global configuration mode. |
||
Step 6 |
ip default-gateway ip-address |
Configure default gateway.
|
||
Step 7 |
Use the following commands to verify the configuration:
|
Verify the configuration. |
||
Step 8 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
Manually Assigning IP Information
Beginning in privileged EXEC mode, follow these steps to manually assign IP information to multiple interfaces:
Procedure
Command or Action | Purpose | |
---|---|---|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
interface interface_type interface_number |
Enter interface configuration mode. |
Step 3 |
ip address ip-address subnet-mask |
Enter the IP address and subnet mask. |
Step 4 |
description [interface_description ] |
Enter description for the interface. |
Step 5 |
exit |
Return to global configuration mode. |
Step 6 |
ip default-gateway ip-address |
Configure default gateway. |
Step 7 |
Use the following commands to verify the configuration:
|
Verify the configuration. |
Step 8 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
What to do next
To remove the IP address, use the no ip address interface configuration command. If you are removing the address through SSH, your connection to the LoRaWAN Gateway will be lost.