Juniper DHCP Server Configuration

September 01, 2015
We already configure our QEMU in GNS3 and run our vSRX Router. Now its time to configure DHCP server in our vSRX router. Lets began.
Logical Diagram for this tutorial



To configure DHCP server

Assign Lowest and highest IP range
root# set system services dhcp pool 192.168.1.0/24 address-range low 192.168.1.50 high 192.168.1.200

Assign DNS server (in my case I had used Router interface IP)
root# set system services dhcp pool 192.168.1.0/24 name-server 192.168.1.1

Assign IP address of the router
root# set system services dhcp pool 192.168.1.0/24 router 192.168.1.1

Assign the lease time
root# set system services dhcp pool 192.168.1.0/24 default-lease-time 3600



Assign DHCP as an allowed inbound service for the interface which we are going to enable DHCP.

root# set security zones security-zone untrust interfaces ge-0/0/1 host-inbound-traffic system-services dhcp

Assign IP address to the client faced interface.
root# set interfaces ge-0/0/1 unit 0 family inet address 192.168.1.1/24



Check our client get the IP Address from the server.


How to statically assign IP with fixed MAC address

root#set system service dhcp static-binding 00:50:79:66:68:00 fixed-address 192.168.1.100

PC1>show ip

Request DHCP IP

PC1>dhcp -d




Enjoy

vSRX GNS3 QEMU

September 01, 2015
In this tutorial I'm going to run vSRX JunOS in QEMU and configure it as DHCP Server. Lets began with installing vSRX into QEMU.

I have try vSRX to run into Vbox but never succeeded. So I better to choose QEMU otherwise waste of time.

In my case I had used junos-vsrx-12.1X46-D10.2-domestic to mount into QEMU. Search for it.
Now we have to convert our .vdi file into .image, for that use following command

cd d:\junos\
c:\Program Files\GNS3\qemu\>qemu-img.exe convert -O qcow2 d:\junos\junos-vsrx-12.1X46-D10.2-domestic-disk1.vdi d:\junos\junos-vsrx-12.1X46-D10.2-domestic.img

We just made our image ready to run into QEMU. Go the GNS3

Note: Strongly recommended to use QEMU in linux and enable KVM otherwise it eats up all your CPU and RAM.

-nographic -smp 2 -enable-kvm

>edit>preference>choose "QEMU VMs"
Click on "New" Choose "Default " Gave Name "vSRX" (in my case).






I'll use following topology to configure DHCP server for the tutorial. 



Now we ready to move on the next step. Configuration DHCP








Juniper Message from syslogd

September 01, 2015
While doing some lab test, this weird syslogd message appear every seconds on the console terminal, so it was very difficult to complete the lab.


This messages are due the following syslog configuration . 


So for now we are going to de-activate it to generating the message

#deactivate system syslog user * 
#commit

The-requested-url-nagioscgi-binstatusmap-cgi-was-not-found-on-this-server

July 09, 2015
Everything goes well while installing the Nagios 4.0.8 into Ubuntu 10.04 LTS. However Nagios Map section doesn't plotted the maps of the device. Displayed error like this way


G for god and G for google, found the solution like  

Install the package
apt-get install libgd2-xpm install libgd2-xpm-dev

cd /home/jpudasaini/nagios-4.0.8/

Configure the package for installation
./configure -with-gd-lib=/usr/local/lib/

make cgis

Then copy it into the sbin directory 
cp /home/jpudasaini/nagios-4.0.8/cgi/*.cgi /usr/local/nagios/sbin/

Change the permission for that files.
chown nagios:nagios /usr/local/nagios/sbin/*.cgi

vSphere Client Displays Empty Inventory

May 27, 2015
Suddenly my home datacenter  vsphere lab show empty inventory in vSphere client. There was no any host at all. I have three ( Cisco IOU, CentOS 7, Ubuntu server) host configure for lab  purpose. So I must recover those host to complete my lab because I almost completed all labs.  Thus here is process how to retrieve those lost host from vSphere client in vSphere 6 database.


Step 1:
Login to the vSphere client choose your database from Configuration Tab > right click database and choose "Browse Dababase".

Step 2: Now next window open the database page. From here open your host folder then choose ".vmx" right click and choose "Add to inventory" then follow the onscreen instruction.


Next window 



Select the database


Next click to finish


Now your server is in the inventory list, you can run the server. In my case its my CentOS 7 server, it will run smoothly. 






Table Already Exists SQL Server

May 27, 2015
Somehow I have created or you can say I have imported database into SQL and try to continue installation, but error "table already exists sql server" occur then installation has been interrupted. Meanwhile, another error "SQL=Duplicate entry 'add_user' for key 'PRIMARY':" also appear. In this case I had deleted those tables and modified dbsetup file.

CREATE TABLE logs (
        id bigint unsigned NOT NULL AUTO_INCREMENT,

to

CREATE TABLE logs (
        id bigint(20) unsigned NOT NULL AUTO_INCREMENT,

On sql I have used this command to delete tables

MariaDB [(none)]> use syslog
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [syslog]> drop table {YourTableName};

Huawei Switch Show Commands

May 25, 2015
Here are basic show commands used in Huawei switch. For configuration of Huawei switch click here.

1. Show VLANs
<sw1>display vlan

8. Show port base VLAN
<sw1>display port vlan  
Port                    Link Type    PVID  Trunk VLAN List
-------------------------------------------------------------------------------
Eth-Trunk0              hybrid       1     -                                
GigabitEthernet0/0/1    trunk        1     1
GigabitEthernet0/0/2    hybrid       1     -                                
GigabitEthernet0/0/3    access       301   -                                
GigabitEthernet0/0/4    access       302   -                                
GigabitEthernet0/0/5    hybrid       1     -                                
GigabitEthernet0/0/6    hybrid       1     -                                
GigabitEthernet0/0/7    hybrid       1     -                                
GigabitEthernet0/0/8    hybrid       1     -


2. View Configuration
[sw1]display current-configuration configuration
!Software Version V200R003C00SPC300
#
sysname sw1
#
vlan batch 301 to 302
#
stp region-configuration
 region-name JR
 instance 1 vlan 20 to 30
 active region-configuration
#
vlan 30
 description fiber
vlan 20
 description Wireless
[sw1-mst-region]active region-configuration

[sw1]display stp instance 0 interface GigabitEthernet 0/0/1 brief
 MSTID   Port                        Role  STP State     Protection
    0    GigabitEthernet0/0/1        DESI  FORWARDING      NONE



interface Eth-Trunk 1
port link-type trunk
port trunk allow-pass vlan 20 30
mode lacp

int gi0/0/5
eth-trunk1
undo negotiation auto

int gi0/0/6
eht-trunk1
undo negotiation auto


3. Show interface configuration
[sw1]display interface Eth-Trunk 1
Eth-Trunk1 current state : UP
Line protocol current state : UP




4. LACP port status

[sw1]display eth-trunk 1
Eth-Trunk1's state information is:
Local:
LAG ID: 1                   WorkingMode: LACP                              
Preempt Delay: Disabled     Hash arithmetic: According to SIP-XOR-DIP      
System Priority: 32768      System ID: 30d1-7eea-c824                      
Least Active-linknumber: 1  Max Active-linknumber: 8                      
Operate status: up          Number Of Up Port In Trunk: 2                  
--------------------------------------------------------------------------------
ActorPortName          Status   PortType PortPri PortNo PortKey PortState Weight
GigabitEthernet0/0/5   Selected 1GE      32768   1      305     10111100  1  
GigabitEthernet0/0/6   Selected 1GE      32768   2      305     10111100  1  

Partner:
--------------------------------------------------------------------------------
ActorPortName          SysPri   SystemID        PortPri PortNo PortKey PortState
GigabitEthernet0/0/5   32768    001b-0c17-b780  32768   515    1       10111100
GigabitEthernet0/0/6   32768    001b-0c17-b780  32768   514    1       10111100
VID  Status  Property      MAC-LRN Statistics Description  
--------------------------------------------------------------------------------
1    enable  default       enable  disable    VLAN 0001                      
301  enable  default       enable  disable    fiber                          
302  enable  default       enable  disable    Wireless


5. Show interface vlan

[sw1]display int Vlanif 25
Vlanif25 current state : UP
Line protocol current state : UP
Last line protocol up time : 2014-07-21 18:57:40 UTC-05:13
Description:
Route Port,The Maximum Transmit Unit is 1500
Internet Address is 10.10.10.11/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 30d1-7eea-c824
Current system time: 2014-07-21 19:01:47-05:13
    Input bandwidth utilization  : --
    Output bandwidth utilization : --

6.  [sw1]ping 10.10.10.10  
  PING 10.10.10.10: 56  data bytes, press CTRL_C to break
    Reply from 10.10.10.10: bytes=56 Sequence=1 ttl=255 time=4 ms
    Reply from 10.10.10.10: bytes=56 Sequence=2 ttl=255 time=5 ms
    Reply from 10.10.10.10: bytes=56 Sequence=3 ttl=255 time=5 ms
    Reply from 10.10.10.10: bytes=56 Sequence=4 ttl=255 time=7 ms
    Reply from 10.10.10.10: bytes=56 Sequence=5 ttl=255 time=5 ms

  --- 10.10.10.10 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 4/5/7 ms