So everyone inside home network can reach the Internet thanks to NAT translation described inSOHO #004 and reach now their favorite Internet service by name thanks for SOHO #005.
Requirement
Basic Linux/Unix knowledge
Service provider networking knowledge
Overview
In the previous article during the verification we assume to have one host connected to a subnetwork cascaded behind SOHO router@sdn6. However, we did not described how the host could get connectivity.
Article objective
In this article we will pursue the SOHO network appliance installation and enable DHCP for IPv4 server. SOHO router can then answer to DHCPv4 request ingressing sdn6 interface.
Let's assume we have a switch connected to SOHO router@sdn6 for the future
sdn6 has ipv4 interface 192.168.136.1 manually configured
switch has IPv4 192.168.136.2
subnetwork behind sdn6 is 192.168.136.0/24
DHCPv4 will serve 192.168.136.3 → 192.168.136.254
Diagrams
[ SOHO #006 ] - "Do you need an IP ?"
First step, configure sdn6 and bind it to VRF inet. few considerations:
sdn6 has ipv4 192.168.136.1 manually configured
sdn6 will act as gateway for all connected host in subnetwork 192.168.136.0/24
In SOHO #004 , 192.168.136.0/24 NAT is already taken into account
SOHO router DHCP server in VRF inet
conf t
interface sdn6
mtu 1500
vrf forwarding inet
ipv4 address 192.168.136.1 255.255.255.0
no shutdown
no log-link-change
exit
!
Second step, configure a DHCPv4 server@ SOHO router
SOHO router DHCP server in VRF inet
conf t
server dhcp4 dh4-16
pool 192.168.136.3 192.168.136.254
gateway 192.168.136.1
netmask 255.255.255.0
dns-server 192.168.254.1
domain-name local
interface sdn6
vrf inet
exit
!
In this case DHCPv4 will allocate IPv4 address:
from a pool going from 192.168.136.3 → 192.168.136.254
All host will set their gateway to 192.168.136.1 (which is SOHO@sdn6)
All connected host to sdn6 subnet will get an IP from pool within 192.168.136.0/24 subnet
All hosts will also consider SOHO@192.168.254.1 as DNS server as we implemented in SOHO #005
And we bind this DHCPv4 to interface sdn6 (without binding DHCP request coming from all interface belonging to VRF inet will be processed)
lastly DHCPv4 server will act into VRF inet only
Verification
Connect a host to the switch connected to sdn6 then issue DHCP debug command
DHCP debug command
debug server dhcp?
dhcp4 - ipv4 dynamic host config protocol
dhcp6 - ipv6 dynamic host config protocol
mjolnir#debug server dhcp4 ?
<cr>
mjolnir#debug server dhcp4
mjolnir#terminal monitor
Pay attention to the DNS server that answered ! Sweet !
DNS resolution from CLI (DNS query originated by router)
╭─[11/2/20|4:30:11]loui@MacBook-Pro-de-Frederic.local ~
╰─➤ ping 8.8.8.8 -c 5
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=119 time=4.171 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=119 time=4.334 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=119 time=4.208 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=119 time=3.856 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=119 time=4.090 ms