Monday, July 31, 2017

How to Configure VLAN, DHCP server, Assigning IP on a VLAN interface & routing provision at Cisco Switch


---------------Basic Initial Configuration----------------------------
(config)#line vty 0 4
(config-line)#password cisco
(config-line)#login
(config)#enable secret password
(config)#service password-encryption
(config)#banner login "Authorized Personnel Only!"
(config)#hostname Sylhet_S2

---------------VLAN Configuration----------------------------
(config)#vlan 10
(config)#name SYL_IT
(config)#vlan 20
(config)#name SYL_NOC
(config)#vlan 30
(config)#name SYL_BK
(config)#vlan 99
(config)#name Management
(config)#interface range fa0/10-14
(config-if-range)#switchport mode access
(config-if-range)#switchport access vlan 10
(config)#interface range fa0/15-20
(config-if)#switchport mode access
(config-if)#switchport access vlan 20
(config)#interface range fa0/21-24
(config-if-range)#switchport mode access
(config-if-range)#switchport access vlan 30
(config)#interface fa0/03
(config-if)#switchport mode access
(config-if)#switchport access vlan 99
(config)#interfaceinterface fa0/01
(config-if)#switchport trunk encapsulation dot1
(config-if)#switchport mode trunk
(config)#interfaceinterface fa0/02
(config-if)#switchport trunk encapsulation dot1
(config-if)#switchport mode trunk
(config)#interfaceinterface fa0/03
(config-if)#switchport trunk encapsulation dot1
(config-if)#switchport mode trunk
(config-if)#switchport trunk allowed vlan add 10,30,99


--------------------Assign IP to each VLAN ---------------------------
(config)#interface vlan 99
(config-if)#ip address 192.168.0.99 255.255.255.0
(config-if)#no sh
(config)#interface vlan 10
(config-if)#ip address 192.168.10.1 255.255.255.0
(config-if)#no sh
(config)#interface vlan 20
(config-if)#ip address 192.168.20.1 255.255.255.00
(config-if)#no sh
(config)#interface vlan 30
(config-if)#ip address 192.168.30.1 255.255.255.0
(config-if)#no sh


--------------------DHCP CONFIGURATION---------------------------
(config)# ip dhcp pool MGT_IP_Client
(dhcp-config)# network 192.168.99.0 255.255.255.0
(dhcp-config)#dns-server 8.8.8.8
(dhcp-config)#default-router 192.168.99.1

(config)# ip dhcp pool VLAN_10_IP_Client      //Create a DHCP IP address pool for the IP addresses you want to use.
(dhcp-config)# network 192.168.10.0 255.255.255.0 //Specify the network and subnet for the addresses you want to use from the pool.
(dhcp-config)#dns-server 8.8.8.8
(dhcp-config)#default-router 192.168.10.1   //Specify the default router (i.e., default gateway).
(dhcp-config)#lease 7   //Specify the lease duration for the addresses you're using from the pool.

(config)# ip dhcp pool VLAN_20_IP_Client
(dhcp-config)# network 192.168.20.0 255.255.255.0
(dhcp-config)#dns-server 8.8.8.8
(dhcp-config)#default-router 192.168.20.1

(config)# ip dhcp pool VLAN_30_IP_Client
(dhcp-config)# network 192.168.30.0 255.255.255.0
(dhcp-config)#dns-server 8.8.8.8
(dhcp-config)#default-router 192.168.30.1

####This takes you back to the global configuration prompt. Next, exclude any addresses in the pool range that you don't want to hand out.
For example, let's say that you've decided that all IP addresses up to .100 will be for static IP devices such as servers and printers. 
All IP addresses above .100 will be available in the pool for DHCP clients.
Here's an example of how to exclude IP addresses .100 and below:
(config)#ip dhcp excluded-address 1.1.1.0 1.1.1.100 ######

(config)#ip dhcp excluded-address 192.168.99.1 192.168.99.20
(config)#ip dhcp excluded-address 192.168.10.1 192.168.10.20
(config)#ip dhcp excluded-address 192.168.20.1 192.168.20.20
(config)#ip dhcp excluded-address 192.168.30.1 192.168.30.20

Sunday, July 30, 2017

How to Configure VLAN, DHCP server with L3 interface IP on a VLAN & routing provision at Juniper Switch

####### Step BY Step Configuration of VLAN, DHCP server with Vlan IP & routing ###############

Creating Vlans 
-------------------------------------------
root# set vlans BRK_WiFi_MGMT vlan-id 150
root# set vlans BRK_WiFi_AP_LV5 vlan-id 151
root# set vlans BRK_WiFi_SP vlan-id 180

Assigning Ports/interfaces as a Access port for Vlans
------------------------------------------------
root#set interfaces ge-0/0/0 unit 0 family ethernet-switching port-mode access vlan members 180
root#set interfaces ge-0/0/1 unit 0 family ethernet-switching port-mode access vlan members 180

root#set interfaces ge-0/0/2 unit 0 family ethernet-switching port-mode access vlan members 150
root#set interfaces ge-0/0/3 unit 0 family ethernet-switching port-mode access vlan members 150

root#set interfaces ge-0/0/4 unit 0 family ethernet-switching port-mode access vlan members 151
root#set interfaces ge-0/0/5 unit 0 family ethernet-switching port-mode access vlan members 151

Assigning Ports/interfaces as a Trunk port

------------------------------------------------------
root#set interfaces ge-0/0/6 unit 0 family ethernet-switching port-mode trunk vlan members all
root#set interfaces xe-0/1/0 unit 0 family ethernet-switching port-mode trunk vlan members all

Creating DHCP Pool with IP range
----------------------------------------------
root#set system services dhcp pool 192.168.150.0/24 address-range low 192.168.150.10 high 192.168.150.100
root#set system services dhcp pool 192.168.151.0/24 address-range low 192.168.151.10 high 192.168.151.100

Assign IP to logical l3-interface of each VLAN 
------------------------------------------------------------
root#set interfaces vlan unit 150 family inet address 192.168.150.2/24
root#set vlans BRK_WiFi_MGMT l3-interface vlan.150

root#set interfaces vlan unit 151 family inet address 192.168.151.2/24
root#set vlans BRK_WiFi_AP_LV5 l3-interface vlan.151

root#set interfaces vlan unit 180 family inet address 10.180.180.2/24
root#set vlans BRK_WiFi_SP l3-interface vlan.180

Creating default route & provisioning inter VLAN routing
-------------------------------------------------------------------------------------
root#set system services dhcp pool 192.168.150.0/24 router 192.168.150.2
root#set system services dhcp pool 192.168.151.0/24 router 192.168.151.2

N.B. These two gateway IP addresses which are assigned on VLAN's L3 logical interfaces act as DHCP server IP addresses.


Add DNS server address
----------------------------------
root#set system services dhcp pool 192.168.150.0/24 name-server 192.168.150.xxx

Verify DHCP Status
----------------------------
root>show system services dhcp statistics
root>show system services dhcp binding


root> show configuration