Friday 1 June 2018

Configuring DHCP Server on Arista EOS


We know that Arista's EOS operating system runs on top of Linux. So, in order to configure DHCP Server on Arista's EOS, the way is to install the DHCP package on linux. The steps are shown below:

Configuring DHCP Server and Relay:


Switch1 (server) (et30)-----(et30) DHCPRelay (int vlan 1, switchport access-vlan 1)------Client

On Switch 1 (DHCP Server)
  • #int et 30  \\we use et30 because both the switches are connected via et30 on both sides
#no switchport
#ip address 10.0.0.1/30
  • #ip route 192.168.1.0/24 10.0.0.2  \\giving a static route to the destination n/w (192.X.X.X) and also we specify the next hop which is the Relay (10.0.0.2)

#show version ||to check the fedora version. Eg) fc14 or fc18. If FC18, downgrade to FC14 using #Dir \\check for the image of older version and then #bootfrom <image>
Download the correct RPM from the following URL: http://dl.fedoraproject.org/pub/archive/fedora/linux/updates/, choose i386 architecture and send the file to switch using #copy scp:admin@macbook-pro/Users/Desktop/dhcp.rpm extension:
#extension dhcp.i686.rpm \\To install the dhcp extension
#bash
$sudo vi /etc/dhcp/dhcpd.conf
# DHCP Server Configuration file.
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample
#   see dhcpd.conf(5) man page

ddns-update-style interim;

subnet 192.168.1.0 netmask 255.255.255.0 {
        option routers                  192.168.1.254;
        option subnet-mask              255.255.255.0;
        option domain-search              "example.com";
        option domain-name-servers       192.168.1.1;
        option time-offset              -18000;     # Eastern Standard Time
        range 192.168.1.10 192.168.3.99;
}

subnet 10.0.0.0 netmask 255.255.255.252 {
range 10.0.0.1 10.0.0.2;
}

 (OR)

subnet 192.168.1.0 netmask 255.255.255.0
{

option routers 192.168.1.254; //the IP address of SVI is the default gateway
option subnet-mask 255.255.255.0;
range 192.168.1.20 192.168.1.30;

}
subnet 10.0.0.0 netmask 255.255.255.252 {
range 10.0.0.1 10.0.0.2;
}

$service dhcpd start \\to start the dhcp service
$service dhcpd status \\to check whether the dhcp service is running
$sudo dhcpd et 30
$sudo dhcpd vlan1 \\to assign DHCP IP address to devices on vlan1

On Switch 2 (relay),
  • Configuring the interface connected to client side:
#conf
#int vlan1
#ip address 192.168.1.254/24 //Making a router and network for the hosts since hosts are connected to relay router
#ip helper 10.0.0.1 \\Configuring this router to act as relay, so use the IP address of the switch 1 interface. It should be assigned for the vlan network
  • Configuring the interface connected to server:
(conf)#int et 30  \\connecting it to switch 1
#no switchport
#ip address 10.0.0.2/30 

FOR TROUBLESHOOTING:
#show ip dhcp relay counters

No comments:

Post a Comment