Pages

12/09/2011

Juniper CLI - make your work faster

In this next lines you are going to read about some commands that can make your work with Junos easier
(Simple RegExp and Junos examples) 
This list is mainly for thought memorizing.

1. show interfaces in two lines list with MTU
show interfaces | match "mtu|interface:" |trim 19
 2. show interfaces without second line with logical interface with family
before:
[edit]
user@switch# run show interfaces terse                 
Interface               Admin Link Proto    Local                 Remote
ge-0/0/0                up    up  
ge-0/0/0.0              up    up   eth-switch
ge-0/0/1                up    up  
ge-0/0/1.0              up    up   eth-switch
ge-0/0/2                up    down
ge-0/0/2.0              up    down eth-switch
... output truncated

after:
[edit]
user@switch# run show interfaces terse |except "\."   
Interface               Admin Link Proto    Local                 Remote
ge-0/0/0                up    up 
ge-0/0/1                up    up 
ge-0/0/2                up    down
... output truncated


3. show ipv4 address on your switch or router, show only interfaces:
{master:2}
user@switch> show interfaces terse |match "inet "
ge-0/0/12.3212          up    up   inet     10.32.1.41/30  
ge-0/0/13.3200          up    up   inet     10.32.1.245/30 
ge-0/0/13.3202          up    up   inet     10.32.1.1/30   
ge-1/0/1.107            up    up   inet     xx.yyy.zz.1/30 
ge-1/0/13.3201          up    up   inet     10.32.1.249/30 
ge-1/0/13.3203          up    up   inet     10.32.1.5/30   
...

{master:2}
user@switch> show interfaces terse |match "inet " |trim 44
10.32.1.41/30  
10.32.1.245/30 
10.32.1.1/30   
xx.yyy.zz.1/30 
10.32.1.249/30 
10.32.1.5/30   
...

You could then save it to text file (add | save filename ad the end of command
show interfaces terse |match "inet " |trim 44 | save ipv4.txt

) and transfer your linux.Then do some things with it. For example calculate subnet address from ip address with ipcalc i.e.
ipcalc 10.32.1.41/30 | grep Network
...

So. I did a batch file
from file like this:
10.32.1.41/30  
10.32.1.245/30 


to file like this:

ipcalc 10.32.1.41/30 | grep Network >> networks.out
ipcalc 10.32.1.245/30 | grep Network >> networks.out

with this two commands:
sed -e 's/^/ipcalc /' ipv4.txt > networks.sed1
sed -e 's/$/| grep Network >> networks.out/' networks.sed1 > networks.sed2

chmod a+x networks.sed1
bash networks.sed1
hopefuly gives you
10.32.1.40/30
10.32.1.244/30


4. just another tidily  output for sflow interfaces (EX4200 Junos 10.0S10)
show interfaces terse |match "eth-switch|aenet" | match "ge|xe" | no-more
ge-0/0/0.0              up    up   eth-switch
ge-0/0/1.0              up    up   eth-switch
ge-0/0/2.0              up    up   eth-switch
ge-0/0/3.0              up    up   eth-switch
ge-0/0/4.0              up    up   eth-switch
ge-0/0/5.0              up    up   eth-switch
ge-0/0/6.0              up    up   eth-switch
ge-0/0/8.0              up    up   aenet    --> ae6.0
ge-0/0/10.0             up    up   eth-switch
... And you need to throw it edit it with spreadsheet or via bash or something else.
Remove text after space, then add string to beginning of line.
sed 's/ .*//;s/, .*//' sflow01.txt | sed s/^/"set protocols sflow interfaces "/


11/30/2011

How to install xerox workcentre 3210 on ubuntu 11.10

You have two possibilities
A) run shell script from extracted WC 3210 Linux Driver or longer manual method. Manual method doesn't install -for me- unnecessary files, icons, applications.

1. Download WC 3210 Linux Driver from this webpage.
2. Extract downloaded file to your desktop.
3. find these two extracted files wc3210.ppd (/home/jozef/Desktop/Linux/noarch/at_opt/share/ppd/wc3210.ppd) and rastertosamsungspl (/home/jozef/Desktop/Linux/i386/at_root/usr/lib/cups/filter/rastertosamsungspl)
4. try to install new printer from menu
4a. run (X)ubuntu menu -> System -> Printing)
4b. add printer - Network Printer - select your xerox 3210
4c. from window Choose Driver select "Provide PPD file" and select wc3210.ppd
5. your ubuntu screams this: 

and you will go to next step
6. Run terminal (Ctrl+Alt+T)
7. copy file  rastertosamsungspl from step 3 to /usr/lib/cups/filter/ as root:
sudo cp /home/jozef/Desktop/Linux/i386/at_root/usr/lib/cups/filter/rastertosamsungspl /usr/lib/cups/filter/

That's all

10/19/2011

Why I like Junos CLI

Why I like Junos CLI

hierarchical configuration to make it easier to read configurationshttp://www.juniper.net/techpubs/software/junos/junos93/swconfig-cli/understanding-the-JUNOS-CLI-command-modes.html#id-10184964


load .. to load yours configuration (load merge <url-file,www,...>, load merge terminal relative,
http://juniper.tw/techpubs/en_US/junos11.1/topics/example/junos-software-config-file-loading.html#id-10728250
... or just use bunch of set just like any other OS
to see it like that ^ from configuration mode use show | display set

commiting configuration to apply it at right time and avoid late night drive to work (candidate configuration, rollback, commit confirmed, ...)
http://kb.juniper.net/InfoCenter/index?page=content&id=KB1572

annotations to comment your configuration
http://www.juniper.net/techpubs/en_US/junos11.1/topics/reference/command-summary/annotate.html

configuration groups, interface-ranges to inherit your configuration
http://www.juniper.net/techpubs/en_US/junos9.5/information-products/topic-collections/swconfig-cli/id-11182486.html
http://kb.juniper.net/InfoCenter/index?page=content&id=KB16354&actp=RSS

pipe to make configuration easier to read and do other stuff
http://www.juniper.net/techpubs/software/junos/junos94/swconfig-cli/pipe-filter-functions-in-JUNOS-CLI.html

junoscript, junos automation to make network management easier
http://www.juniper.net/in/en/community/junos/script-automation/ and http://www.juniper.net/us/en/community/junos/training-certification/day-one/automation-series/
I am using only basic scripts.

netconf to configure and manage it remotely, possibly through your own web management

http://www.juniper.net/support/products/netconf/

10/14/2011

juniper ex8200 and bgp full table, :-( [j-nsp] TCAM full on EX8200?

I created three scenarios for customer. One of that was ex8208 with acting also like bgp full view router. But after reading this I am going to consider it
http://www.gossamer-threads.com/lists/nsp/juniper/31959?nohighlight=1#31959
Ex8208 has may have some problem with full routing table. :-(

10/11/2011

New ubuntu 11.10 - tomorrow 13. oct 2011

"Oneiric Ocelot" is the code name for Ubuntu 11.10, scheduled for release on 13 October 2011. See the Oneiric release schedule

[j-nsp] JUNOS and 128.0.0.0 martian (JFYI), IANA

INANA allocated new addresses. These are martians for Juniper.
for example
https://apps.db.ripe.net/whois/lookup/ripe/inetnum/128.0.0.0-128.0.7.255.html
Take a look at RFC5735 which obsoletes RFC3330.


So if you have it as martians, you possibly cannot route to that remote subnets. Also transit ISPs should change this if they dont route them.

Workaround - Deleting Martian Addresses:
http://www.juniper.net/techpubs/en_US/junos10.2/topics/usage-guidelines/routing-configuring-martian-addresses.html#id-10349412

source: http://puck.nether.net/lists/juniper-nsp/0319.html


UPDATE!!!:

> https://apps.db.ripe.net/whois/lookup/ripe/inetnum/128.0.0.0-128.0.7.255.html


skip


> p.s. set routing-options martians 128.0.0.0/16 orlonger allow
> fixes it.



Couple updates about it.

martians are per table in Junos, so if you run internet in vrf (yes,
there are such people!) you need to use that command per routing instance.

RIPE NCC was awared about this issue and now reallocate blocks to those
who got addrs from 128.0.0.0/16

https://apps.db.ripe.net/whois/lookup/ripe/inetnum/128.0.0.0-128.0.7.255.html
IANA changed it. there was mail.ru now there is nothing