Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Wed Aug 23, 2017 8:50 am


Author Message
mandrei99
Post  Post subject: Juniper - Junos 11.4R8 based Olive  |  Posted: Mon Jun 17, 2013 7:48 am

Joined: Tue Aug 04, 2009 9:16 am
Posts: 245

Offline
 

Juniper - Junos 11.4R8 based Olive

This is a step by step guide to create a Junos 11.4R8.4 based Olive box for testing purposes.

1st Step: Install FreeBSD 7.0 32bit
Create a VM (Custom, Other, FreeBSD 32bit). Select the hardware resources, I used 1 GB of RAM, LSI SAS adapter, 6GB IDE drive and it worked for me.

Junos 11.4 is based on FreeBSD7, so add FreeBSD7 i386 iso as CD (connect at power on) and boot the machine.

When installing FreeBSD7, create a single slice from the whole disk (Pressing "A"), select the slice and make it bootable (very important) by pressing "S".

Press ESC, select "Standard Boot" and next create the labesl.

This is a very important step because FreeBSD 7.0 creates labels a b d e (e for /var) and Junos requires label "f" for /var, so manually create the labels in following order and size (worked for me):
Code:
ad0s1a / 1024M
ad0s1b SWAP 512M
ad0s1d /test 2M
ad0s1e /config 20M
ad0s1f /var <REST OF SLICE>  --> very important to have labelformat


Press "Q", confirm what needs to be confirmed and then select "Minimal" installation and CD/DVD as source.

Now, FreeBSD 7.0 should be installed. What needs to be done is to:
- set the IP address and default route (to copy the junos image)
- set root password
- enable ssh root login
- enable sshd and start it
(how to do the above is not in this article)

Copy the jinstall-11.4R8.4-domestic-signed.tgz file to /var/tmp (using winscp for example) and then there are 3 decompressions and 3 compressions.

Step 2: Prepare Olive 11.4R8.4 olive.

Decompress the signed Junos image
Code:
# pwd
/var/tmp
# ls
jinstall-11.4R8.4-domestic-signed.tgz   vi.recover
# mkdir jinst
# cd jinst
# tar zxvf ../jinstall-11.4R8.4-domestic-signed.tgz
x +CONTENTS
x +COMMENT
x +DESC
x +INSTALL
x jinstall-11.4R8.4-domestic.tgz
x jinstall-11.4R8.4-domestic.tgz.md5
x jinstall-11.4R8.4-domestic.tgz.sha1
x jinstall-11.4R8.4-domestic.tgz.sig
x issu-indb.tgz
x certs.pem

Remove checksum files
Code:
# rm -rf jinstall-11.4R8.4-domestic.tgz.*


Edit the "+INSTALL" (outer one) file as below:
Code:

# ls `pwd`/ji*
/var/tmp/jinst/jinstall-11.4R8.4-domestic.tgz
# vi ./+INSTALL
2130     re_name='Olive'
-3175     pkg_add $PKG_FORCE $inner || fail=1
+3175     pkg_add $PKG_FORCE /var/tmp/jinst/jinstall-11.4R8.4-domestic.tgz || fail=1


Going further, we decompress the /var/tmp/jinst/jinstall-11.4R8.4-domestic.tgz file and edit inner "+INSTALL" and "+REQUIRE" files.
Code:
# mkdir domestic
# cd domestic/
# tar zxvf ../jinstall-11.4R8.4-domestic.tgz
x +CONTENTS
x +COMMENT
x +DESC
x +INSTALL
x +DEINSTALL
x +REQUIRE
x bootstrap-install-11.4R8.4.tar
x jbundle-11.4R8.4-domestic.tgz
x pkgtools.tgz


The Junos script runs "disklabel" command on /dev/ad0s1a. But on FreeBSD7.0 this gives an error, leaving the "rootdev_size" variable being empty and the check for root device space will fail and also these scripts check the RE sysctl which doesn't exist.
Code:
# vi ./+INSTALL
   2130     re_name='Olive'                                                                            <-- REPLACE re_name
   3330     rootdev_size=`disklabel ${rootdev%a} | sed -n '/sectors.unit:/s,.*:,,p'`
   3331     rootdev_size="9999999"                                                                <-- ADD THIS LINE
   3332     if [ ${rootdev_size:-0} -lt $rootdev_minsz ]; then
   3333         warn
   3334         warn "This installation will not succeed."
   3335         warn "The boot device is less than ${rootdev_min}M."
   3336         warn "A hardware upgrade is required."
   3337         warn
   3338         exit 1

# vi ./+REQUIRE
   2130     re_name='Olive'                                                                           <-- REPLACE re_name
   3329     rootdev_minsz=`expr \( $rootdev_min \* 90 / 100 \) \* 2048`
   3330     rootdev_size=`disklabel ${rootdev%a} | sed -n '/sectors.unit:/s,.*:,,p'`
   3331     rootdev_size="9999999"                                                               <-- ADD THIS LINE
   3332     if [ ${rootdev_size:-0} -lt $rootdev_minsz ]; then
   3333         warn
   3334         warn "This installation will not succeed."
   3335         warn "The boot device is less than ${rootdev_min}M."
   3336         warn "A hardware upgrade is required."
   3337         warn
   3338         exit 1


Now that we have 2nd compression done, there is one more tweak: replace "checkpic" Junos binary with "true" FreeBSD binary.
Code:
# mkdir pkgtools
# cd pkgtools
# tar zxvf ../pkgtools.tgz
x pkg/manifest
x pkg/manifest.certs
x pkg/manifest.sha1
x pkg/manifest.sig
x bin/checkpic
# cp /usr/bin/true bin/checkpic


Step 3: Cleaning up and re-creating the packages:
Code:
# tar cvzf ../pkgtools.tgz *
a bin
a bin/checkpic
a pkg
a pkg/manifest
a pkg/manifest.certs
a pkg/manifest.sha1
a pkg/manifest.sig
# cd ..
# rm -rf pkgtools
# tar cvzf ../jinstall-11.4R8.4-domestic.tgz *
a +COMMENT
a +CONTENTS
a +DEINSTALL
a +DESC
a +INSTALL
a +REQUIRE
a bootstrap-install-11.4R8.4.tar
a jbundle-11.4R8.4-domestic.tgz
a pkgtools.tgz
# cd ..
# rm -rf domestic/
# tar cvzf ../jinstall-11.4R8.4-domestic-signed.tgz *
a +COMMENT
a +CONTENTS
a +DESC
a +INSTALL
a certs.pem
a issu-indb.tgz
a jinstall-11.4R8.4-domestic.tgz

Step 4: Installing Junos Olive 11.4R8
Code:
# cd ..
# pkg_add -v jinstall-11.4R8.4-domestic-signed.tgz
Requested space: 1685415672 bytes, free space: 3441154048 bytes in /var/tmp/instmp.wOH0Ks
Running pre-install for jinstall-11.4R8.4-domestic-signed..
extract: Package name is jinstall-11.4R8.4-domestic-signed
extract: CWD to .
Running post-install for jinstall-11.4R8.4-domestic-signed..
Adding jinstall...
sysctl: unknown oid 'hw.product.model'
sysctl: unknown oid 'hw.re.model'
sysctl: unknown oid 'hw.re.model'
sysctl: unknown oid 'hw.re.model'

WARNING:     This package will load JUNOS 11.4R8.4 software.
WARNING:     It will save JUNOS configuration files, and SSH keys
WARNING:     (if configured), but erase all other files and information
WARNING:     stored on this machine.  It will attempt to preserve dumps
WARNING:     and log files, but this can not be guaranteed.  This is the
WARNING:     pre-installation stage and all the software is loaded when
WARNING:     you reboot the system.

Saving the config files ...
Installing the bootstrap installer ...

WARNING:     A REBOOT IS REQUIRED TO LOAD THIS SOFTWARE CORRECTLY. Use the
WARNING:     'request system reboot' command when software installation is
WARNING:     complete. To abort the installation, do not reboot your system,
WARNING:     instead use the 'request system software delete jinstall'
WARNING:     command as soon as this operation completes.

Attempting to record package into /var/db/pkg/jinstall-11.4R8.4-domestic-signed..
Package jinstall-11.4R8.4-domestic-signed registered in /var/db/pkg/jinstall-11.4R8.4-domestic-signed


Now there is the final step. Making sure we can login into new Junos Olive box on the video console, otherwise, it's useless in most cases:
Code:
# chmod +w /boot/loader.conf
# vi /boot/loader.conf
console="vidconsole"                     <-- ADD THIS LINE AT THE END


Now reboot the box. Some installation messages will appear on the console and a new reboot will take place. After the 2nd reboot, Junos is installed.
The prompt on your console until Junos boots up is:
Code:
Loading /boot/loader
_
BTX loader 1.00 BTX version is 1.02

and when it booted, the login prompt appears.

And that's it:
Code:
root@10.1.10.6's password:
--- JUNOS 11.4R8.4 built 2013-05-23 05:31:29 UTC
root@% cli
root> show version
Model: olive
JUNOS Base OS boot [11.4R8.4]
JUNOS Base OS Software Suite [11.4R8.4]
JUNOS Kernel Software Suite [11.4R8.4]
JUNOS Crypto Software Suite [11.4R8.4]
JUNOS Packet Forwarding Engine Support (M/T Common) [11.4R8.4]
JUNOS Packet Forwarding Engine Support (M20/M40) [11.4R8.4]
JUNOS Online Documentation [11.4R8.4]
JUNOS Voice Services Container package [11.4R8.4]
JUNOS Border Gateway Function package [11.4R8.4]
JUNOS Services AACL Container package [11.4R8.4]
JUNOS Services LL-PDF Container package [11.4R8.4]
JUNOS Services PTSP Container package [11.4R8.4]
JUNOS Services Stateful Firewall [11.4R8.4]
JUNOS Services NAT [11.4R8.4]
JUNOS Services Application Level Gateways [11.4R8.4]
JUNOS Services Captive Portal and Content Delivery Container package [11.4R8.4]
JUNOS Services RPM [11.4R8.4]
JUNOS Services HTTP Content Management package [11.4R8.4]
JUNOS AppId Services [11.4R8.4]
JUNOS IDP Services [11.4R8.4]
JUNOS Services Crypto [11.4R8.4]
JUNOS Services SSL [11.4R8.4]
JUNOS Services IPSec [11.4R8.4]
JUNOS Runtime Software Suite [11.4R8.4]
JUNOS Routing Software Suite [11.4R8.4]


Last edited by mandrei99 on Tue Jun 18, 2013 5:39 am, edited 1 time in total.





Top
mandrei99
Post  Post subject: Re: Juniper - Junos 11.4R8 based Olive  |  Posted: Tue Jun 18, 2013 5:36 am

Joined: Tue Aug 04, 2009 9:16 am
Posts: 245

Offline
Features working:
BGP FlowSpec routes distribution:
Code:
P1@CORE_Q1> show route table inetflow.0

inetflow.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.1.1.1,*,proto=1/term:1           
                   *[BGP/170] 1d 10:03:30, localpref 100, from 172.16.2.103
                      AS path: 65411 I
                      Fictitious
*,10.0.1.1/term:2           
                   *[BGP/170] 1d 09:53:37, localpref 100, from 172.16.2.103
                      AS path: 65411 I
                      Fictitious


Features NOT working:
BGP FlowSpec actions - no action is taken on firewall filters (ACLs) created by flowspec rules:
Code:
P1@CORE_Q1> show firewall

Filter: __flowspec_default_inet__                             
Counters:
Name                                                Bytes              Packets
*,10.0.1.1                                              0                    0
10.1.1.1,*,proto=1                                      0                    0

Firewall filters - you can configure them, but they block all traffic. This is because Juniper products (MX/SRX) apply filters as close as possible to the interface (on the interface cards - IOC depending on platforms) so Olive doesn't have these.


Top
Display posts from previous:  Sort by  
E-mail friendPrint view

Topics related to - "Juniper - Junos 11.4R8 based Olive"
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. Juniper SRX / Junos rescue configuration is not set

mandrei99

0

3368

Mon Feb 16, 2015 11:42 am

mandrei99 View the latest post

There are no new unread posts for this topic. Junos: How to disconnect idle ssh connections in configuration mode - Juniper SRX

mandrei99

0

18684

Tue May 14, 2013 5:40 am

mandrei99 View the latest post

There are no new unread posts for this topic. MTR / My traceroute in Junos

mandrei99

1

3276

Mon Oct 10, 2016 5:54 am

barrel View the latest post

There are no new unread posts for this topic. Junos: How to show uncommitted changes and cancel them

mandrei99

1

17620

Wed Sep 25, 2013 7:31 am

mandrei99 View the latest post

There are no new unread posts for this topic. Junos: How to list routing table IDs

admin

0

1050

Sat Jan 17, 2015 3:53 pm

admin View the latest post

There are no new unread posts for this topic. Junos - How to limit arguments to ping CLI command

mandrei99

1

873

Thu Jun 27, 2013 4:04 am

admin View the latest post

There are no new unread posts for this topic. Junos: ping: invalid routing instance `RI0'

mandrei99

0

1790

Fri Jan 03, 2014 10:11 am

mandrei99 View the latest post

There are no new unread posts for this topic. How to search junos configuration option within cli help apropos

mandrei99

0

837

Mon Jan 12, 2015 12:34 pm

mandrei99 View the latest post

There are no new unread posts for this topic. Junos system configuration archival is not working over scp

mandrei99

0

2948

Thu Jan 01, 2015 4:06 am

mandrei99 View the latest post

There are no new unread posts for this topic. Junos: How to increase the number of configuration rollbacks

admin

0

1441

Wed Nov 05, 2014 11:00 am

admin View the latest post

 

Who is online
Users browsing this forum: No registered users and 0 guests
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
News News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO