Monthly Archives: julho 2016

Trabalhando com cisco routers com “menos medo”

tux_cisco

Bom quem trabalha todo dia com routers cisco/juniper/mikrotik sabe que as vezes cheats happen… só se machuca quem joga esse é  uma dica básica mas vejo pouco usando o que pode ocasionar um problema sério em um backbone por exemplo…

Com isso em mente sempre tento antes de ativar qualquer coisa no trabalho, fazer scripts e em casos mais sérios com router cisco temos o comando salvador “reload in”  em juniper tem o commit check e mais ferramentas lindas que te salvam…

Normalmente, quase sempre você usa o reload apenas para dar boot mas ele tem outas funções uma delas em especial e é o reload in, ( tem o reload at que serve pra agendar o boot ajuda bastante faço outro post depois sobre)

Com o reload in você pode setar quantos minutos vai ocorrer um reload após você dar o comanda exemplo: reload in 2, faz com que em dois minutos seja agendado um reload, a ok show fiz uma cacá vai rebootar em 2min, mas caso eu tenha feito tudo certinho como proceder? simples, exemplo: reload cancel

Como faço para ver quanto tempo ainda tenho antes do reload? exemplo: show reload

 

Abaixo umas telas dele funcionando, bons testes !!! Note também que ele mostra certinho o start do shutdown e cancelamento do mesmo muito prático 🙂

reload-in

Download Juniper router IOS/Image for Gns3 JunOS Olive 12.1R1.9

juniper-networks1

Para simular os nossos atuais e futuros posts, baixe o virtual-box, tal como o gns3.

Gns3 site: https://www.gns3.com/ faça o cadastro e download, instalação padrão

Instale também o virtual box: https://www.virtualbox.org/ usaremos a imagem do link abaixo dentro do virtual box, como o gns3 é integrator com o virtual box podemos usar nossas máquinas virtuais dentro do gns3.

O link abaixo é estritamente para usos de estudo não utilizar comercialmente, para isso entre em contato com o comercial da Juniper -> http://www.juniper.net/us/en/how-to-buy/

 

Download VirtualBox Image (IOS) of Juniper Router for GNS3:

From here you can download “JunOS Olive 12.1” VM image, you can run it with GNS3 for simulating juniper router. (Please note that this image is only provide to you for informational purpose and for GNS3 use.)

What is JunOS Olive?

JunOS Olive is a software that you can use on PC. Initially Olive was used by Juniper internally for lab work, but now it become a source to learn the JUNOS CLI on a low-cost platform. Please note Junos olive is only for study and practice purposes , which is unsupported and unsupportable platform & it is not suitable for any type of commercial use.

Download JunOS forGNS3:
You can actually run this JunOS on VirtualBox and then can simulate this into GNS3. You can Download this JunOS for Gns3 from following link and can perform and configure different lab on Gns3.

Download JunOS olive Gns3

Click on above link and then choose “download anyway” for download this file.

Juniper error missing mandatory statement ‘root-authentication’ | requie change of case, digit or punctuation

juniper-networks1

Quando você vai fazer seus primeiros testes virtualizando o juniper, no meu caso usei a versão 12.1R1.9 que tem na internet de monte para download, basta jogar dentro do virtual box adicionar interfaces, clonar trocar o mac das interfaces e ser feliz.

Um erro comum tentar dar o commit ( wr do cisco) após fazer suas configurações e receber o erro abaixo: missing mandatory statement ‘root-authentication’ esse erro ocorre por que é mandatório adicionar uma senha de autenticação root com o comando set system root-authentication plain-text-password “senha” após isso você pode dar commit tranquilamente.

Dica: quando você está em modo configure faz muita falta o comando “do” da cisco o comando relativo a “do” em Juniper é “run”

 

Configuration on juniper in gns3:

Error Message detail:
Junos version= JunOS Olive 12.1R1.9
error messge= missing mandatory statement ‘root-authentication’
error image=


The reason or causes of this error:
juniper router running JunOs have the default user name “root” with not password. Whenever you want to commit or save some changes/configuration using commit command & no password is set for root user then it will show you the above error that is “missing mandatory statement ‘root-authentication’

How to save current configuration on Juniper:

In order to commit change or for saving current configuration on juniper router you have to set the root password. You can set the root password on juniper router with following commands:

cli
configure

set system root-authentication plain-text-password (press enter)
now type the root password and press enter. Remember you are required to set a strong password with alpha numeric characters otherwise it will show you error messages
error: minimum password length is 6
error: requie change of case, digit or punctuation 
and you will need another try with a password having letters and numbers..

once you have  successfully set root password, now you will able to save the current configurations & your commit command will also works fine.

Comandos de -> Para: Cisco -> Juniper Command Guide

juniper-networks1

Fala pessoal ando sumido mas é a correria, para quem está começando a brincar com juniper e ainda tem os vicios com cisco com muito orgulho =D

Segue um reference guide de cisco para juniper abs!!!

 

Cisco Command Juniper Command Co-Ordinating Definition
show run sh configuration Show running configuration
sh ver sh ver Show version
show ip interface brief show interface terse displays the status of interfaces configured for IP
show interface [intfc] show interfaces [intfc] detail displays the interface configuration, status and statistics.
show controller intfc show interfaces intfc extensive displays information about a physical port device
show interface | incl (proto|Desc) show interfaces description displays the interface configuration, status and statistics
show ip route show route displays summary information about entries in the routing table
show ip bgp summary show bgp summary displays the status of all Border Gateway Protocol (BGP) connections
show ip bgp net mask show route protocol bgp prefix will show you how that route is being advertised, look for the first line
show ip bgp net mask longer-prefixes show route range prefix will show you how that route is being advertised, look for the first line
show ip bgp regexp AS-regexp show route aspath-regexp “AS-regexp” displays routes matching the autonomous system (AS) path regular expression
show ip bgp neighbors neigh received-routes show route receive-protocol bgp neigh

show route source-gateway neigh protocol bgp

Shows whether a neighbor supports the route refresh capability
show ip bgp neighbor neigh advertised-routes show route advertising-protocol bgp neigh Shows whether a neighbor supports the route refresh capability
show clns neighbors show isis adjacency displays both ES and IS neighbors
show clns interface show isis interface shows specific information about each interface
show ip route isis show isis routes displays the current state of the the routing table
show isis topology show isis spf displays a list of all connected routers in all areas
show ip ospf interface show ospf neighbor shows neighbor ID, Priority, IP, & State if the neighbor router, dead time.
show ip ospf interface show ospf interface shows neighbor id, pri, state, dead time, address and interface
show ip route ospf show ospf route display the current state of the routing table
show ip ospf database show ospf database display list of information related to the OSPF database for a specific communication server
show version show version, show system uptime display the system hardware config., software version, and name and source of configuration files and boot images
show diags show chasis hardware displays power-on diagnostics status
show processes cpu show system process displays utilization statistics
show tech-support request support info displays the current software image, configuration, controllers, counters, stacks, interfaces, memory and buffers
show logging show log messages display the state of logging to the syslog
show route-map name show policy name displayall route-maps configured or only the one specified
show ip prefix-list name show policy name display information about a prefix list or prefix list entries
show ip community-list list configure,
show policy-options community name
display routes that are permitted by BGP community list
show environment all show chassis  environment displays temperature and voltage information on the console
ping dest ping dest rapid (for cisco like output)
ping dest (for unix like output)
to check to see if a destination is alive
ping (setting source int) ping dest bypass-routing to check to see if a destination is alive
terminal monitor monitor start messages Change console terminal settings
terminal no monitor monitor stop Change console terminal settings
terminal length 0 set cli screen-length 0 sets the length for displaying command output

Juniper Básico – Juniper commands | Most basic CLI Commands list for JunOS Router

juniper-networks1

Olá pessoal, como alguns dos routers que trabalho no dia dia passaram a ser juniper também além de cisco tive que correr atrás e é bem diferente os command line, a idéia geral é a mesma interfaces/protocolos/ativar serviços na caixa XYZ… não importa o vendor é sempre assim com Juniper não foi diferente, abaixo o primeiro tutorial que segui com ele aprende o básico do básico em Juniper.

 

Usei o virtual box com uma imagem.ova do juniper e joguei dentro do gns3, se fosse cisco eu até faria as traduções mas Juniper toda documentação é 100% inglês então nem comece se você não está aberto ao inglês, claro que estamos falando de inglês básico não precisa ser fluente…

Me comprometo em breve em por mais infos sobre, eu mesmo ainda estou em study mode 😉 adiciono também alguma dicas do franco abaixo abs…

Most Useful and important JunOS router Commands for Begginer:

This article contain some of most frequent used commands of Juniper devices those are very helpful, especially for beginner those are new to juniper networks.

Before going into Commands details you should know that there are different commands mode on juniper same like Cisco. So you must know about every command where to type it. You can simply differentiate into these modes into

  • command-line interface (CLI)
  • Configuration mode

How to login into Juniper router:

Simply type user name and password, default username and password for JunOS Olive 12.1 is root with no password.

Login: root

password:

How to enter into Command-line interface mode:

After logging into JunOS by your user name and password, you can enter into Command-line interface by typing CLI ((Dica do Franc0)após dar start no seu juniper dentro do GNS3 entre com o usuário root e sem senha, digite CLI para ir para as configurações do router)

root@% cli

root>

How to access configuration mode on Juniper:

You can enter into configuration mode by typing configure in configuration mode.

root> configure ((Dica do Franc0)igual o conf t do cisco)

[edit]

root#

How to check current configurations on Juniper:

In cli mode:

root> show configurations ( (Dica do Franc0) igual o show run do cisco)

Show configurations with include specific group of commands:

This command will show all the command from configuration starting with “Set

root> show configurations | display set

How to check all interfaces on Juniper:

You can show all the interface on Juniper with following command:

root# show interfaces

How to see status of specific interface on Juniper:

root# show interfaces <interface name>

Command example:

root# show interfaces em0

How to set the IPv4 address of juniper router:

(Dica do Franc0)Dentro do configure, diferente do cisco você não entra na interface como no cisco exemplo interface fast0/0, e dentro ip address 10.0.0.1 255.255.255.0, no juniper você usa o SET e após o ip coloca a mascara /24, unit é a unidade exemplo 0, family é a familia de ip pode ser ipv4 ipv4 para ipv4 use inet.

In Configuration mode you can use the following command:

set interfaces  <interface-name> unit <unit number> family inet <IP address>/mask

Suppose you want to set IP address 22.2.2.2 to interface ge-0/0/2 you can do it like this:

set interfaces ge-0/0/2 unit 0 family inet 22.2.2.2/24

How to set host name on Juniper Router:

root# set system host-name <type-name>

How to set root’s password on JunOS:

In configuration mode type the following command for setting password for juniper router.

set system root-authentication plain-text-password

How to save your current configuration on Juniper:

You can use the Commit command for saving configuration on Juniper, if you having any issue in save configuration you see error in saving configuration onjuniper for troubleshooting.

root# commit

How to see the all routes on JunOS:

root> show route

How to setup gateway or static route for Juniper:

Following command will set a static route for network 222.0.0.0/32.

root# set routing-options static route 222.0.0.0/32 next-hop 172.16.1.1

Configure different routing protocols with Juniper:

You can use the set protocols command in configuration mode for configuring different routing protocols on JunOS, some of commands examples are as listed below. But you can see more details regarding each routing protocols with given links or explore more with google.

root # set protocols rip group rip-routes neighbor em0           RIP on JunOS

root # set protocols ospf area 0.0.0.0 interface em0               OSPF on JunOS

root # set protocols isis interface em0