---
# System prepended metadata

title: DHCP

---

# DHCP

## Setup DHCP Server

1. Go into config mode
```ios
ena
conf t
```

2. Exclude IP addresses
```ios
ip dhcp excluded-address <first_ip> <last_ip>
```

3. Create DHCP pool
```ios
ip dhcp pool <pool_name>
```

4. Define subnet to be used to assign IP addresses
```ios
network <network_address> <subnet_mask>
```

5. Define default gateway
```ios
default-router <ip_address>
```

6. Define DNS server
```ios
dns-server <ip_address>
```

7. Enable DHCP server
```ios
service dhcp <interface>
```

8. Exit config mode
```ios
exit
```

### Example
```ios
ena
conf t
ip dhcp excluded-address 172.16.8.1
ip dhcp excluded-address 172.16.9.254
ip dhcp pool Floor1DHCP
network 172.16.8.0 255.255.254.0
default-router 172.16.8.1
dns-server 8.8.8.8
service dhcp
exit
```

## View DHCP leases
```ios
show ip dhcp binding
```

## Setup helper IP address
(op niet dhcp server maar in ander subnet)
1. Go into config mode
```ios
ena
conf t
```
2. Select interface
```ios
int <interface>
```

4. Set helper address -> ipaddress = ip van dhcp server
```ios
ip helper-address <ip_address>
```

### Example
```ios
ena
conf t
int Fa0/0
ip helper-address 172.16.9.254
```

## starting the relay

```
ena
conf t
ip dhcp relay information option
ip dhcp relay information check
ip dhcp relay information policy replace
ip dhcp relay information trsut-all
end
sho ip dhcp relay information trusted-sources
```

## creating the subscriber
```
ena
conf t
int fa0/0
ip dhcp relay information option-insert
ip dhcp relay information check-reply
ip dhcp relay informatino policy-action {drop, keep, replace}
exit
```

## conf suboption subscriber

```
ena
conf t
ip dhcp relay information option
int fa0/0
ip dhcp relay information option subscriber-id new_relay_id

```

## conf dhcp relay clas support

```


```

## Disable proxy arp
Dit is nodig om de mikrotik over verschillende subnetten te laten uitdelen. 

`no ip proxy-arp` turn off proxy-arp voor een specifieke interface

