Pages

Thursday, 4 February 2016

The power of JunOS and its commands.

Now, I'm not sure about you, but I have been a ScreenOS firewall CLI engineer for a few years, and always loved that you can do most commands in one liner. Then I started working with JunOS, and was irritated that you had to either type very long or multiple command expressions, or go into different hierarchies to make changes.

But after maybe 3-4 months, while moving back and forth between ScreenOS and JunOS, it became more clear, that the programmers of JunOS, actually put some thought in it.

In ScreenOS you lack the good overview of the configuration unless you want to look at the set/unset commands in the actual config. in JunOS you get a fairly good overview thanks to its hierarchy view.

Together with groups and routing instances, the JunOS is quite powerful.

Though, I can still admit, that working with JunOS devices as a Firewall sucks. This is due to the WebGUI of JunOS is bad compared to ScreenOS. But if you work mostly with routing and policy statements, JunOS is the King.

I'm not going to go into details of how to configure different examples, but if you have any specific issue, don;t hesitate to comment or email me.

What I want to share with you, the most powerful commands that speaks for JunOS is the following,

[edit] show | compare  --- shows you the difference between candidate configuration and running configuration.
[edit] commit check --- verifies your candidate confing with running config to ensure there is nothing missing to get an IPSEC up, security zone interface missing etc.
[edit] commit confirmed <min>(default 10 min) --- this is the best command ever, this will commit the changes, and if you for some reason loose connection to the device, or something gets completely screwed up, the config will revert to the previous config. You can compare this with "Set timer", but you wont have to set, and then cancel in case you succeed with your config.

In ScreenOS and Cisco, when you punch a command, it takes affect directly, JunOS does not. You will work in a Candidate configuration, that you can choose to commit later, or at a certain time.

And if you are even more sure, with tested config change, you can upload a piece of configuration with SCP(SSH file transfer), and then merge the config with existing with the help of scripts. Say for example you have a new SNMP settings, but dont want to manually go into each one, and you dont have JunOS Space(Juniper mgmt software for JunOS devices). Then you can create the SNMP config in your lab router, save that portion as a file, then script to SCP it over with "commit confirmed 1 min", with expected results of "Commit succeeded", then commit again, and your done. you can push out new config to 100 devices with 1 script.

Have fun!

Searching mode and iPhone 5/5s won't activate after a reset

--------------
Problem
--------------

So out of the blue, my iPhone 5s with version release 9.2.1, went into "Searching Mode", unable to attach to my provider network (AT&T), which I'm not sure is provider specific(Missing carrier settings or similar).

Wifi was working fine all the time, and not other issues besides the fact that i couldn't call, receive calls, nor send/receive SMS( iMessage still worked).

I called AT&T support, account was fine, not blocked, they tried to send new updates and asked me to do a soft reset etc. Eventually last resort they asked was to do a complete reset of the phone. So I backed it up and went ahead and did full reset, (Erase All Content and Settings). Please ensure you do backup of your phone via iTunes or iCloud before doing any resets.

When the phone came back online and it was time to activate it, I was stuck. I could not get pass the activation screen after choosing Wifi. I tried activating via iTunes but got similar message that the "phone cannot be activated at this time".

One of my colleagues works with mobile support at my company, so she provided me with a new sim card for AT&T and we called in to get it activated, still no luck.

So eventually I googled a bit and was recalled about putting the phone in recovery mode and that worked!

--------------
Solution
--------------

So this is what I did, and its important to do it in these steps. Hopefully you have a backup in iTunes or iCloud before you had the problem, or before you try below.


  1. Turn off phone.
  2. plug in lighting cable into Phone, without plugging in USB port into computer.
  3. Open iTunes on your computer (download from www.itunes.com, about 60mb).
  4. Hold down "home" button(the button on the front. The button on the top is known as power button)
  5. While holding down the home button, insert the USB cable into the computer
  6. Wait for iTunes to discover the phone and suggest recovery mode, then you can release Home button.
  7. Follow on-screen instructions and install a new fresh image/software.
  8. After that you can choose to restore from your local backup via iTunes or via iCloud.
  9. Now, I still had problem with phone not connected to the Cell network, instead of Searching mode, i had "No Service", i made a call to AT&T support again, read the ICCID nr under /Settings/General/About, and they were able to enable the new Sim Card.

------------------
Conclusion:
------------------The problem seems to have been a combination of bad sim card, and buggy software, so if you have similar problem, try get the sim card replaced first. A good way to verify it, is if you cannot see the ICCID field under Settings/General/About, then the sim card probably bad, corrosion or just worn out.