Showing posts with label dhcp. Show all posts
Showing posts with label dhcp. Show all posts

Wednesday, 1 March 2023

DHCPv6 configurations with Stateful and Stateless (SLAAC)

DHCPv6 as a concept is very similar to version 4. There are some key differences that we need to know. DHCPv6 supports two very different methods; Stateful and stateless configurations.

Stateful

Stateful configuration works pretty much the same as DHCPv4. The DHCP server assigns the IP address to the client. When DHCPv6 addresses are being sent from a server to a client it uses UDP destination port 546


Stateless (SLAAC)

Stateless on the other hand uses autoconfiguration. Routers running IPv6 can give the prefix of the network and a gateway address to clients looking for an IPv6 address. IPv6 uses the Neighbour Discovery, and one of the things this protocol offers is Route Solicitation and Router Advertisement messages that help an IPv6 device configure an IPv6 address automatically. The router is configured to send out Router advertisements periodically.
Router Advertisement messages inform hosts what to do - There are three flags in the RA messages that play important role in defining how dynamic addressing works on this segment:
  • A-flag - if it is set to 1, this informs hosts that they can auto-generate GUA address using SLAAC. If it is set to 0 means that auto-configuration is not allowed for this segment.
  • O-flag - if it is set to 1, this informs hosts that they can obtain a DNS server list and a domain name from a Stateless DHCPv6 server, but not addressing information. Typically it works in conjunction with SLAAC for auto-addressing and both the A-flag and the O-flag are set to 1.
  • M-flag - if it is set to 1, this informs hosts that they can obtain a global address as well as DNS and a domain name from a Stateful DHCPv6 server. Typically this means that auto-addressing using SLAAC is not allowed on this segment and both the  A-flag and the O-flag are set to 0.

A host sends out a router solicitation message which is a multicast address for all routers which is FF02::2. The Router Advertisement contains the Prefix Information (prefix (network address), prefix length (subnet mask), and default gateway). The host uses this information to generate an IPv6 address (global unicast address or GUA) for itself. The host then employs Duplicate Address Detection to ensure that its address is unique.

2. On the router use the below configurations from the screenshot;

Configurations

Lets look at how we configure SLAAC;

1. Build a simple network similar to the below

-ipv6 unicast-routing (enables the router for IPv6 routing)

-interface gigabitethernet0/0/0 (this is the particular interface being used for the connection to the switch)

-ipv6 address (is an IPv6 address which in this instance in the address of the router)


3.On each PC change the IPv6 configuration to automatic.




You will now find that the PC generates a Global Unicast Ipv6 Address on its own, with the Default Gateway address and the Link-Local Address from the Router Advertisement.

Ipv6, SLAAC and EUI

The EUI (extended Unique Identifier) uses the MAC address to generate a unique 64 bit interface ID. An Ipv6 address is 128bits and a MAC address is 48 bits so an operation needs to be performed. 

  • The hexadecimal value of FFF0(16-bits) is added in the middle of the 48-bit mac address.
  • The 7th bit from the start is toggled from 0 to 1.

For example: 

For the MAC address FC:99:47:75:CE:E0  the steps are performed as shown in the below:


Cisco routers are configured to use the EUI-64 ID generation by default.


Here is a video showing the configuration in action;










Monday, 30 January 2023

Static vs dynamic IP addresses - configurations

Knowledge 

A static IP address is a permanent, fixed address assigned to a device on a network, rather than being assigned dynamically by a DHCP server. This allows for easier network administration and can help with specific applications such as remote access or website hosting.


DHCP stands for Dynamic Host Configuration Protocol. It is a network protocol used to dynamically assign IP addresses to devices on a network. DHCP allows for automatic and centralized management of IP addresses, reducing the manual effort required to configure devices on a network. It helps ensure that each device has a unique IP address and eliminates the risk of IP address conflicts. 

Skill


DHCP from a router

Set a simulation environment similar to the below



Assign  the IP address

On the router enter the commands below. Here ip address 192.168.0.1 with default subnet mask 255.255.255.0 has been assigned to interface gigabitethernet 0/0/0




Configure DCHP pool

Here the DHCP pool has been named "FOC" the network address has been assigned to the pool "192.168.0.0" and the default router: "192.168.0.1" . The default router address will give the default gateway address to the devices requesting a DHCP ip address. The final commands exclude an IP range. This range is outside the DHCP pool so our first host should connect with 192.168.0.11




Testing

On one (or all the PCS) change the IP configuration to DHCP. If successful your first device should be given 192.168.0.11 and so on.



Video run through





DHCP from a server

Build a topology similar to the below.


Configure the router


Set the ip address of the router. Here we have assigned IP address 192.168.0.1 to interface gigabit ethernet 0/0/0 with the default subnet mask of 255.255.255.0






Server DHCP configuration

Turn the DHCP service on. Give the pool a name, here it is "FOC". Set the default gateway which is the router address (192.168.0.1) and the DNS server we will just use this server address for now. Click Save or Add.



Assign an IP address to the Server


In the interface section give the server an IP address of 192.168.0.2







Testing

On one of the PCs change the IP configuration to DHCP in order to receive an IP address, Default Gateway and DNS server address





Higher thinking

  • Where would you see these uses of DHCP? Server use and router use? What type of network?
  • What devices would  you expect to see in the excluded range?
  • What is the benefit of using DHCP?
  • What are the downsides to using DHCP?
  • Research lease times and DHCP










Fast switching vs Process switching

Process Switching: Process switching is the traditional method of packet forwarding used in early routers. When a packet arrives at a router...