-
Notifications
You must be signed in to change notification settings - Fork 7
DHCP
This section includes the following:
DHCP (Dynamic Host Configuration Protocol) is a protocol used to dynamically assign an IP address to a device on a network.
DHCP client can be used with switchport, bridge, bond and vlan sub-interfaces.
To start DHCP client on switchport
dhclient swp1
To start DHCP clinet on bridge
ip link add name br0 type bridge
ip link set swp1 master br0
ip lint set swp1 up
dhclient br0
To start DHCP clinet on bond
ip link add bond1 type bond mode 802.3ad
ip link set swp1 master bond1
ip lint set swp1 up
dhclient bond1
To start DHCP clinet on vlan sub-interface
ip link add name br0 type bridge vlan_filtering 1
ip link set dev br0 up
ip link set dev swp1 master br0
bridge vlan add vid 10 dev swp1
bridge vlan add vid 10 dev br0 self
ip link add link br0 name br0.10 type vlan id 10
dhclient br0.10
For more information about dhclient option please refer to man page
A DHCP server listens to UDP port 67 and dynamically assigns IP addresses and other network parameters to DHCP clients.
DHCP server can be used with switchport, bridge, bond and vlan sub-interfaces.
Example configuration of DHCP server for a network 10.0.0.0/24
Contents of "/etc/dhcp/dhcpd.conf"
option domain-name "example";
option domain-name-servers 10.0.0.1;
subnet 10.0.0.0 netmask 255.255.255.0 {
range 10.0.0.100 10.0.0.200;
option subnet-mask 255.255.255.0;
option broadcast-address 10.0.0.255;
option routers 10.0.0.01;
}
default-lease-time 600;
max-lease-time 7200;
authoritative;
For more information about DHCP Server option please refer to wiki page
DHCP relay (agent) is a service that forwards DHCP packets between clients and servers that are not on the same physical subnet. It is defined by RFC3046
The DHCP Relay Agent (dhcrelay) enables the relay of DHCP and BOOTP requests from a subnet with no DHCP server on it to one or more DHCP servers on other subnets.
When a DHCP client requests information, the DHCP Relay Agent forwards the request to the list of DHCP servers specified when the DHCP Relay Agent is started. When a DHCP server returns a reply, the reply is broadcast or unicast on the network that sent the original request.
To configure DHCP relay on interface this interface must have an IP address assigned
ip address add dev <interface_1> <IP_ADDR>
dhcrelay -4 -d -i <interface_1> <dhcp server ip>
Where <interface_1>
can be switchport, bridge, bond and vlan sub-interface.
Network Configurations
- Switch Port
- Layer 2
- Layer 3
- Dynamic SCT
- Quality of Service (QoS)
- Access Control Lists (ACL)
- Network Address Translation (NAT)
- Debugging Tools and and Methods
- Resources and Releases
- Marvell® Switchdev Slim (Single-CPU) mode guide