Mounting an image file in Linux

If you need to mount an image file as a disk partition you can follow the following steps. I have followed these to mount a junos space disk image indeed. Here are the steps: #losetup /dev/loop0 space-11.4R1.5.img Then try to mount: #mount -t ext2 -o ro,loop space-11.4R1.5.img /mnt/space-disk mount: Stale NFS file handle It fails
Read More »

SRX DHCP Configuration

DHCP configuration is very straight forward in junos. However if you are like me, you can even forget that gateway address must be within the advertised pool. Here is a simple config set system services dhcp default-lease-time infinite set system services dhcp domain-name rtoodtoo.net set system services dhcp name-server 8.8.8.8 set system services dhcp name-server
Read More »

Stand still

I have noticed that I haven’t written anything so far for a long time. Indeed I was struggling to get my internet connection and it took soooo long. I would like to write something about EX switches in a couple of weeks/days but I still couldn’t get round to it. I will set up a
Read More »

LDAP configuration in SRX Dynamic VPN

I am writing in this post how we can configure our openldap server in a linux system and let dynamic VPN users in SRX authenticate through it. As installing ldap isn’t covered in this post, please check your Linux distribution’s documentation. My test system involves the following components and path names may change depending on
Read More »

Recovering primary JUNOS image

When I booted my SRX device I saw the following output on the console;  WARNING: THIS DEVICE HAS BOOTED FROM THE BACKUP JUNOS IMAGE   It is possible that the primary copy of JUNOS failed to boot up  properly, and so this device has booted from the backup copy.  Please re-install JUNOS to recover the
Read More »

SRX password reset/recovery

Here are some basic steps to reset the password on an SRX firewall. Note: If you are looking for a default password, there is no default password in SRX. A new SRX out of the box has the root user with no password. 1) Reboot the box and press SPACE when you see the following
Read More »

Junos factory default configuration

I know that it is an easy command but for a few minutes I tried to remember the command to bring a junos box to factory default configuration. Isn’t it funny? I am taking a note here if I need to remember this just prior to my retirement:) [edit] root# load factory-default warning: activating factory
Read More »

Fetching JUNOS config as xml

If you want to fetch a junos device config remotely first configure netconf on the device via; junos#set system services netconf ssh junos#commit Then connect to the junos device (IP 192.168.1.1) via an ssh client from a linux host and redirect the output to a file which is the xml config of the device indeed:
Read More »

How to sort a python dictionary by value

If you want to search a dictionary by value in python, here is a handy one line using also lambda: mydict = {'ver1':'2002','ver2':'2000','ver3':'2020'} dict_v_srt=sorted(mydict.items(),key=lambda sort_ver: sort_ver[1]) print dict_v_srt If you run this script output will be ; [('ver2', '2000'), ('ver1', '2002'), ('ver3', '2020')]