Thursday, January 12, 2017

configure dnsmasq as a dhcp relay agent

*** setup information
- diagram
client --> (vboxnet2: relay ---> dhcp server (mikrotik)

dhcp server ip:

1- configure dhcp server (dhcp server part)
/ip pool add name=pool2 ranges=
/ ip dhcp-server network add address= gateway=192.

/ip dhcp-server  add name=dhcp1 interface=ether2 relay=192.168.
58.1 address-pool=pool2 lease-time=3d

/ ip route add dst-address= gateway=

2- configure dhcp relay agent, by edit file /etc/dnsmasq.conf as below

- to run it just execture sudo dnsmasq

if you want to see the verbose message, use the following command
$ sudo  dnsmasq -d -C /etc/dnsmasq.conf 

capturing the traffic during the dhcp request and offer between client and server
23:48:31.835886 IP (tos 0x0, ttl 16, id 0, offset 0, flags [none], proto UDP (17), length 328) > [udp sum ok] BOOTP/DHCP, Reply, length 300, xid 0x47f70d2c, Flags [none] (0x0000)
          Client-Ethernet-Address 08:00:27:f8:da:51 (oui Unknown)
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: ACK
            Server-ID Option 54, length 4:
            Lease-Time Option 51, length 4: 259200
            Subnet-Mask Option 1, length 4:
            Default-Gateway Option 3, length 4:
            Domain-Name-Server Option 6, length 8:,
            END Option 255, length 0
            PAD Option 0, length 0, occurs 22
23:48:34.075824 ARP, Ethernet (len 6), IPv4 (l

No comments:

Post a Comment