Home / Operating System / How to Configure Vyatta as DHCP Server for LAN

How to Configure Vyatta as DHCP Server for LAN

How to Configure Vyatta as DHCP Server for LAN

vyatta

Scenario:

Vyatta dhcp server with 2 network cards (eth0 & eth1), eth0 is connected to Internet, while eth1 is connected to the LAN and serve as dhcp server for 10.10.10.0/24 subnet.

Configuring the LAN–facing Ethernet interface:

Connect to the Vyatta Firewall, then enter the configuration mode and list the configuration of eth1 interface(which will serve the ip address(es) to the LAN hosts):

configure
show interfaces ethernet eth1

1

To configure the ip address on eth1 interface, issue these commands in configuration mode:

set interfaces ethernet eth1 address 10.10.10.1/24
commit
save

And also verify the setting after issuing the above commands:

show interfaces ethernet eth1

2

Configuring DHCP Server:

To configure the Vyatta Firewall as DHCP Server, we have to provide the following information:

  1. shared-network-name : The name of the network(In my case, it is DHCP_Pool_ETH1).
  2. subnet: The network, in my case it is 10.10.10.0/24
  3. start-stop range: Define an address pool from which dynamically assign addresses to the hosts on the LAN.
  4. default-router: IP address of the default gateway on LAN. So in my case, it is 10.10.10.1.
  5. dns-server: IP address of the dns server which is also 10.10.10.1 in my case.
  6. domain-name(optional): The domain name that need to handout to the clients, in my case, it is tendo.local

After deciding all these parameters, let’s configure the DHCP Server on Vyatta:

set service dhcp-server shared-network-name DHCP_Pool_ETH1 subnet 10.10.10.0/24
edit service dhcp-server shared-network-name DHCP_Pool_ETH1 subnet 10.10.10.0/24
set start 10.10.10.24 stop 10.10.10.250
set default-router 10.10.10.1
set dns-server 10.10.10.1
set domain-name tendo.local
commit
save

3

Verify the DHCP Server setting by using the following command:

show service dhcp-server

4

Checking the IP Address on Windows Client:

5

Checking the DHCP Leases & Statistics on Vyatta Firewall:

Enter the following commands in the operational mode for checking the DHCP leases and statistics.

show dhcp server statistics
show dhcp server leases

6

Creating a Static Mapping:

There are some situations where we want to map a specific IP address to a specific host rather than dynamically assign an IP address from a pool, which is know as “static mapping”.

  • Let’s say that we want to map an IP 10.10.10.100 to the host with a MAC address of 00:0c:29:9a:70:ca

7

Issue the following commands to create a static mapping called “WinXP-2” within the DHCP_Pool_ETH1 pool:

configure
edit service dhcp-server shared-network-name DHCP_Pool_ETH1 subnet 10.10.10.0/24
set static‐mapping WinXP-2 ip‐address 10.10.10.100
set static‐mapping WinXP-2 mac‐address 00:0c:29:9a:70:ca
commit
save

8

Verify the static mapping using the following command:

show service dhcp-server shared-network-name DHCP_Pool_ETH1

9

Refresh the Network Card Setting on Windows Client:

10

Checking the DHCP Leases & Statistics on Vyatta Firewall:

Vyatta Firewall, decreases the available address from the pool but didn’t show the static mapping in the leases command output.

show dhcp server leases
show dhcp server statistics

11

Hope this will help you

Print Friendly

About dongpolice

Check Also

cài đặt ffmeg

Cài đặt FFmpeg + FFmpeg-PHP +Lame + Ruby + Mplayer + Mencoder + flv2tool

Cài đặt FFmpeg + FFmpeg-PHP +Lame + Ruby + Mplayer + Mencoder + flv2tool Để …