Quantcast
Channel: MustBeGeek » Juniper
Viewing all articles
Browse latest Browse all 23

Configure DHCP Server for Multiple VLANs in JunOS

$
0
0

The post Configure DHCP Server for Multiple VLANs in JunOS appeared first on MustBeGeek.

DHCP (Dynamic Host Configuration Protocol) is a protocol that dynamically provides IP addresses to hosts. The host use DHCP protocol to obtain IP address from DHCP server. The protocol creates database of IP addresses leased to clients. DHCP server can be configure in Juniper EX series switches to provide IP addresses to its hosts. You can configure DHCP server for one or multiple VLANs. Here we will configure DHCP server for multiple VLANs in JunOS. DHCP configuration for Juniper switch and Juniper routers is basically the same. This is because they all have same operating system i.e. JunOS operating system. JunOS operating system is different from CIsco IOS.

Configure DHCP Server for Multiple VLANs in JunOS

Configure DHCP Server for Multiple VLANs in JunOS

The diagram above represents our network scenario. We will create two different VLANs and assign ports to each of them. Let’s get started by logging into EX3200 switch.

Let’s create two VLAns first, vlan 10 as Marketing and vlan 20 as Finance.

root@MustBeGeek# set vlans marketing vlan-id 10
root@MustBeGeek# set vlans finance vlan-id 20
root@MustBeGeek# commit

Issue the commit command after creating VLANs. Otherwise you won’t be able to see the VLANs by issuing “show vlans” command. To view the created VLANs issue the following command,

root@MustBeGeek# run show vlans

The command will show you the list of VLANs and its interfaces.

Now to make the interfaces ge-0/0/08 and ge-0/0/9 member of it’s corresponding VLANs hit the following commands: -

[edit interfaces ge-0/0/8]
root@MustBeGeek# set unit 0 family ethernet-switching vlan members marketing
[edit interfaces ge-0/0/9]
root@MustBeGeek# set unit 0 family ethernet-switching vlan members finance
[edit interfaces ge-0/0/9]
root@MustBeGeek# commit

Create Layer 3 interface for both VLANs

root@MustBeGeek# set interface vlan unit 10 family inet address 192.168.1.1/24
root@MustBeGeek#set interface vlan unit 20 family inet address 192.168.2.1/24

Configure DHCP Server

Lets configure for VLAN 10 first,

root@MustBeGeek# set system services dhcp pool 192.168.1.0/24
root@MustBeGeek# set system services dhcp pool 192.168.1.0/24 address-range low 192.168.1.11 high 192.168.1.20
root@MustBeGeek# set system serivces dhcp pool 192.168.1.0/24 router 192.168.1.1
root@MustBeGeek# set vlan marketing l3-interface vlan.10

Now configure for VLAN 20,

root@MustBeGeek# set system services dhcp pool 192.168.2.0/24
root@MustBeGeek# set system services dhcp pool 192.168.2.0/24 address-range low 192.168.2.11 high 192.168.2.20
root@MustBeGeek# set system serivces dhcp pool 192.168.2.0/24 router 192.168.2.1
root@MustBeGeek# set vlan finance l3-interface vlan.20

To view the various statistics of DHCP server issue any of following commands.

root@MustBeGeek> show system services dhcp
root@MustBeGeek> show system services dhcp pool
root@MustBeGeek> show system services dhcp binding

References

  1. Configure DHCP Server – Juniper.net
  2. Understanding DHCP Services for EX Series Switches – Juniper.net

 

The post Configure DHCP Server for Multiple VLANs in JunOS appeared first on MustBeGeek.


Viewing all articles
Browse latest Browse all 23

Trending Articles