Bringing up an interface without an IP address

To create a network interface without an IP address at all use the manual method and use pre-up and post-down commands to bring the interface up and down.
This can be necessary, when you like to bridge a VMWare VM to this interface or when it’s connected to a mirror port on the switch for sniffing purposes.

Add an entry like this in your /etc/network/interfaces file:

iface eth0 inet manual
      pre-up ifconfig $IFACE up
      post-down ifconfig $IFACE down

apt - Fix GPG error

When doing an apt-get update to refresh index files from their sources, the indexes of available packages are fetched from the location(s) specified in /etc/apt/sources.list
Sometimes you will see an error like that:

debian:~# apt-get update
Get:1 http://www.backports.org etch-backports Release.gpg [189B]
Hit http://www.backports.org etch-backports Release    
~             
~
(output shortened)
~
~
Hit http://security.debian.org etch/updates/contrib Packages
Hit http://security.debian.org etch/updates/main Sources
Hit http://security.debian.org etch/updates/contrib Sources
Fetched 180kB in 2s (75.2kB/s)
Reading package lists... Done
W: GPG error: http://www.backports.org etch-backports Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EA8E8B2116BA136C
W: You may want to run apt-get update to correct these problems
debian:~#

The error message is pretty understandable.
To resolve this problem, you only have to fetch the public key(s) from the mirror and execute apt-key add <keyfile>

debian:~# apt-key add archive.key
OK

After adding the key, your update should work…

Building a customized menu

Recently i stumbled across a nice feature in Cisco IOS for building customized menus.
The “menu”-command is really old and was introduced in IOS 10.0
You can i.e. use it for building a menu for CLI-unexperienced staff to simplify troubleshooting.

First of all, you have to configure a little bit AAA  as well as create a user with appropriate permissions and autocommand:

aaa new-model
aaa authentication login default local
aaa authentication enable default enable
aaa authorization exec default local
username operator privilege 15 password 0 Oper
username operator autocommand menu Operator

Simple menu

Now we configure a simple menu called “Operator”:

menu Operator title X
             Device Informations
            ---------------------

             Hostname:  R1
             Type:      Router
             Model:     3725
             Memory:    256MB
             IOS:       12.4(15)T6

                Operator Menu
            ---------------------       
X
menu Operator text 0.) exit
menu Operator command 0.) exit
menu Operator text 1.) show logging
menu Operator command 1.) show logging
menu Operator text 2.) show ip interface brief
menu Operator command 2.) show ip interface brief
menu Operator text 3.) show interface description
menu Operator command 3.) show interface description
menu Operator text 4.) show interfaces
menu Operator command 4.) sh interfaces
menu Operator text 5.) show interfaces errors
menu Operator command 5.) sh interfaces | i protocol|Desc|CRC|late|lost|clearing
menu Operator text 6.) show ip route
menu Operator command 6.) show ip route
menu Operator text 7.) show ip protocols
menu Operator command 7.) show ip protocols
menu Operator text 8.) show ip eigrp topology
menu Operator command 8.) show ip eigrp topology
menu Operator text 9.) show ip eigrp interfaces
menu Operator command 9.) show ip eigrp interfaces
menu Operator text 10.) show ip eigrp traffic
menu Operator command 10.) show ip eigrp traffic
menu Operator text 11.) show ip eigrp neighbors
menu Operator command 11.) show ip eigrp neighbors
menu Operator text 12.) show cdp neighbors
menu Operator command 12.) show cdp neighbors
menu Operator text 13.) show tech-support (password required)
menu Operator command 13.) show tech-support
menu Operator options 13.) login
menu Operator prompt XYour choice: X
menu Operator line-mode

The syntax is fairly self-explanatory. Try it out…

When you now telnet into your router with user “operator”, you will see the configured menu:

User Access Verification

Username: operator
Password: 

             Device Informations
            ---------------------

             Hostname:  R1
             Type:      Router
             Model:     3725
             Memory:    256MB
             IOS:       12.4(15)T6

                Operator Menu
            ---------------------        

    0.)        exit
    1.)        show logging
    2.)        show ip interface brief
    3.)        show interface description
    4.)        show interfaces
    5.)        show interfaces errors
    6.)        show ip route
    7.)        show ip protocols
    8.)        show ip eigrp topology
    9.)        show ip eigrp interfaces
    10.)       show ip eigrp traffic
    11.)       show ip eigrp neighbors
    12.)       show cdp neighbors
    13.)       show tech-support (password required)

Your choice:

More complex menu

If you like a more complex menu with submenu structure, try this out:

menu Operator title X

             Device Informations
            ---------------------

             Hostname:  R1
             Type:      Router
             Model:     3725
             Memory:    256MB
             IOS:       12.4(15)T6

                Operator Menu
            ---------------------
X
menu Operator text 0.) Exit
menu Operator command 0.) exit
menu Operator text 1.) Interfaces
menu Operator command 1.) menu Interfaces
menu Operator text 2.) Routing
menu Operator command 2.) menu Routing
menu Operator text 3.) Support Infos
menu Operator command 3.) menu Support
menu Operator clear-screen
menu Operator single-space
menu Operator prompt XYour choice: X
menu Operator line-mode
menu Operator status-line

menu Interfaces title X

              Interface Sub-Menu
            ----------------------
X
menu Interfaces text 0.) Go back
menu Interfaces command 0.) menu-exit
menu Interfaces text 1.) Interface Summary
menu Interfaces command 1.) show ip interface brief
menu Interfaces text 2.) Interface Descriptions
menu Interfaces command 2.) show interface description
menu Interfaces text 3.) Interface Errors
menu Interfaces command 3.) show interfaces | i protocol|Desc|CRC|late|lost|clearing
menu Interfaces text 4.) Interface Traffic Rates
menu Interfaces command 4.) show interfaces | i protocol|Desc|rate
menu Interfaces text 5.) Interface Status (full)
menu Interfaces command 5.) show interface
menu Interfaces single-space
menu Interfaces prompt XYour choice: X
menu Interfaces line-mode

menu Routing title X

               Routing Sub-Menu
            ----------------------
X
menu Routing text 0.) Go back
menu Routing command 0.) menu-exit
menu Routing text 1.) Global
menu Routing command 1.) menu Global
menu Routing text 2.) EIGRP
menu Routing command 2.) menu EIGRP
menu Routing text 3.) OSPF
menu Routing command 3.) menu ospf
menu Routing single-space
menu Routing prompt XYour choice: X
menu Routing line-mode

menu EIGRP title X

           Global Routing Sub-Menu
          -------------------------
X
menu Global text 0.) Go back
menu Global command 0.) menu-exit
menu Global text 1.) Global Routing Table
menu Global command 1.) show ip route
menu Global text 2.) Static Routes
menu Global command 2.) show ip route static
menu Global text 3.) Directly connected Routes
menu Global command 3.) show ip route connected
menu Global text 4.) Summary
menu Global command 4.) show ip route summary
menu Global single-space
menu Global prompt XYour choice: X
menu Global line-mode
menu Global title X

                EIGRP Sub-Menu
            ----------------------
X
menu EIGRP text 0.) Go back
menu EIGRP command 0.) menu-exit
menu EIGRP text 1.) EIGRP Routing Table
menu EIGRP command 1.) show ip route eigrp
menu EIGRP text 2.) EIGRP Topology Table
menu EIGRP command 2.) show ip eigrp topology
menu EIGRP text 3.) EIGRP Interfaces
menu EIGRP command 3.) show ip eigrp interfaces
menu EIGRP text 4.) EIGRP Neighbors
menu EIGRP command 4.) show ip eigrp neighbors
menu EIGRP text 5.) EIGRP Traffic
menu EIGRP command 5.) show ip eigrp traffic
menu EIGRP single-space
menu EIGRP prompt XYour choice: X
menu EIGRP line-mode

menu OSPF title X

                OSPF Sub-Menu
            ----------------------
X
menu OSPF text 0.) Go back
menu OSPF command 0.) menu-exit
menu OSPF text 1.) OSPF Routing Table
menu OSPF command 1.) show ip route ospf
menu OSPF text 2.) OSPF Database
menu OSPF command 2.) show ip ospf database
menu OSPF text 3.) OSPF Interfaces
menu OSPF command 3.) show ip ospf interfaces
menu OSPF text 4.) OSPF Neighbors
menu OSPF command 4.) show ip ospf neighbors
menu OSPF text 5.) OSPF Traffic
menu OSPF command 5.) show ip ospf traffic      
menu OSPF text 5.) OSPF Statistics         
menu OSPF command 5.) show ip ospf statistics
menu OSPF single-space
menu OSPF prompt XYour choice: X
menu OSPF line-mode

menu Support title X

               Support Sub-Menu
            ----------------------
X
menu Support text 0.) Go back
menu Support command 0.) menu-exit
menu Support text 1.) Running Configuration
menu Support command 1.) show run
menu Support text 2.) CDP Neighbors
menu Support command 2.) show cdp neighbor
menu Support text 3.) CPU Usage
menu Support command 3.) show processes cpu sorted | exclude 0.00%__0.00%__0.00%
menu Support text 4.) Memory Usage
menu Support command 4.) show processes memory sorted
menu Support text 5.) Get Infos for Cisco Support
menu Support command 5.) show tech-support
menu Support single-space
menu Support prompt XYour choice: X
menu Support line-mode

cas

Solaris Network Configuration

Solaris Network configuration is a little bit different to Debian.
Because i always forget it, there’s a quick explanation of the necessary steps (taken from here and used with Solaris 5,6,7,8 +9).

/etc-Files

All configuration data, such as IP addresses, gateways, and so on, can be defined and changed at runtime level.
But first of all you have to activate the interface (load the driver), e.g with ifconfig qfe0 plumb

However, only those definitions stored in /etc files will survive the next reboot.
The host name can be found in these files:

  • /etc/nodename
  • /etc/hostname.<interface-name>
  • /etc/inet/hosts
  • /etc/net/{ticlts,ticots,ticotsord}/hosts

/etc/nodename defines the name of the system. Looking from a network perspective, a system with multiple network interfaces and multiple IP addresses can have multiple names, each one defined in /etc/inet/hosts. One of these names may be equal to the nodename, but this is not necessarily the case.
Certain files create the connection between IP-addresses and interface names. These are named /etc/hostname.<interface-name><number>.

The most common interface names are:

  • le Ethernet on older SPARC® systems
  • hme FastEthernet on most UltraSPARC® systems
  • eri FastEthernet on most UltraSPARC-III systems
  • qfe FastEthernet on QuadFastEthernet-extension cards
  • bge Four 10/100/1000Base-T Ethernet (Sun Fire)

Example:
An Ultra 60 workstation with QFE (QuadFastEthernet) has five network interfaces: hme0 (on board), qfe0, qfe1, qfe2 and qfe3 (on the QFE-card). Nodename is sparky, and the /etc/inet/hosts
looks like this:

127.0.0.1      localhost
192.168.222.17 sparky sparky.example.com
194.x.x.x      sparky-ext

The identity of the system in the internal LAN using the address 192.168.222.17 should be sparky.
Accordingly, the file hostname.hme0 must contain the name sparky.
sparky-ext is an address assigned by an Internet Service Provider (ISP): 194.x.x.x. That circuit is connected to the first QFE port, qfe0. So the file hostname.qfe0 contains the string sparky-ext.
qfe1-3 are currently not used. Do not create hostname.* files for unused interfaces to avoid Solaris OS error messages complaining about interfaces with no network cables attached.

!!! A system with more than one network interface will automatically route between the subnets (i.e. 192.168.222… and 194.x.x…) !!!
During boot, the message “machine is a router” is printed. If this behavior is not desired, create an empty file /etc/notrouter and reboot.
The netmasks for the IP-addresses are defined in the file /etc/netmasks.

Routing

The default router (or standard-gateway) can be entered with its IP address into the file /etc/defaultrouter. If you specify a host name in that file, make sure the host name is defined in /etc/inet/hosts.

The equivalent runtime commands are:

  • Delete all current routes: route flush
  • Define 1.2.3.4 as default router: route add default 1.2.3.4
  • Check with netstat -r

DNS

Enter your DNS server into the file /etc/resolv.conf

nameserver 192.168.222.254

Tell Solaris OS software to use DNS when resolving host names. Edit /etc/nsswitch.conf,and add dns after files in the line starting with hosts.

# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.

~
~
hosts:      files dns
~
~

sys-unconfig

If you want to change the network configuration and you are unsure which files are involved, there is an easy solution:
The command sys-unconfig shuts down the machine. After the next reboot (enter boot at the OK prompt), all network-related questions you know from the Solaris OS installation tool are asked again (IP address, gateway, netmask, and so on).

Virtual Interfaces

Sometimes, it may be useful to define two IP addresses for a system with only one physical network interface.
This can be done in the same manner like “normal” interfaces. The only difference is that you now use a interface <interface-name>:<number

Example:
# ifconfig hme0:1 172.16.1.27 netmask 255.255.255.0
# ifconfig -a
lo0: flags=849<UP,LOOPBACK,RUNNING,MULTICAST> mtu 8232
        inet 127.0.0.1 netmask ff000000
hme0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
        inet 192.168.222.7 netmask ffffff00 broadcast 192.168.222.255
        ether 8:0:20:86:94:6f
hme0:1: flags=843<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
        inet 172.16.1.27 netmask ffffff00 broadcast 172.16.1.255

Create Wireshark-readable file with tcpdump

Sometimes, it’s necessary to capture packets with tcpdump on a machine without running X-Windows installation.
But most people are not such  cracks, that they can read the confusing output on the console (me included).

To get a better overview, i prefer Wireshark (former known as Ethereal).

With the following tcpdump-flags, you can create a file in .pcap format readable by Wireshark, which you can transfer to another system (perhaps to your PC).

tcpdump -s0 -w <file> -i <interface> [filter]
Example:
bash-3.1# tcpdump -V
tcpdump version 3.8.3
libpcap version 0.8.3
Usage: tcpdump [-aAdDeflLnNOpqRStuUvxX] [-c count] [ -C file_size ]
                [ -E algo:secret ] [ -F file ] [ -i interface ] [ -r file ]
                [ -s snaplen ] [ -T type ] [ -w file ] [ -y datalinktype ]
                [ expression ]

bash-3.1# tcpdump -s0 -w ldap.tcpdump -i hme0 port 389
tcpdump: listening on hme0, link-type EN10MB (Ethernet), capture size 65535 bytes
^C
21 packets captured
164 packets received by filter
0 packets dropped by kernel
bash-3.1#
bash-3.1#
bash-3.1# ls -la ldap.tcpdump
-rw-r--r--   1 root     other       2322 Oct 24 10:50 ldap.tcpdump
bash-3.1#

For a deeper overview of the different tcpdump options, you can consult the manpage.

ACL log identifiers

When Access Control List Logging is activated on your Cisco device, you will see log entries like that in syslog:

Jun 14 09:49:13 RTR-1 41716: Jun 14 09:49:12.148 MEZ: %SEC-6-IPACCESSLOGP: list 120 denied udp x.x.x.x(1670) -> x.x.x.x(4808), 1 packet
Jun 16 22:14:09 RTR-1 42271: Jun 16 22:14:08.847 MEZ: %SEC-6-IPACCESSLOGDP: list 125 denied icmp x.x.x.x -> x.x.x.x (0/0), 1 packet
.
.

As you can see, there are different syslog identifiers (blue) depending on the packet being reported.

Here’s a table with valid identifiers:

Identifier v4/v6 Protocols
%SEC-6-IPACCESSLOGP IPv4 TCP (6) and UDP (17)
%SEC-6-IPACCESSLOGSP IPv4 IGMP (2)
%SEC-6-IPACCESSLOGRP IPv4 IPinIP (4), GRE (47), EIGRP (88), OSPF (89), NOSIP (94), and PIM (103)
%SEC-6-IPACCESSLOGDP IPv4 ICMP (1)
%SEC-6-IPACCESSLOGNP IPv4 Used for all other IPv4 protocols
%IPV6-6-ACCESSLOGP IPv6 TCP (6), UDP (17), and SCTP (132)
%IPV6-6-ACCESSLOGSP IPv6 TCP (6), UDP (17), SCTP (132), and ICMPv6 (58) with unknown Layer 4 information
%IPV6-6-ACCESSLOGDP IPv6 ICMPv6 (58)
%IPV6-6-ACCESSLOGNP IPv6 Used for all other IPv6 protocols

(Information taken from Cisco website)

BGP Cease Subcode definition

When you deal with Cisco and BGP, you probably know syslog messages like this:

Apr 11 16:34:38 ROUTER 1026843: Apr 11 16:34:38.010 CET: %BGP-3-NOTIFICATION: received from neighbor 80.x.x.x 6/2 (cease) 0 bytes
Apr 17 14:13:41 ROUTER 30082: Apr 17 14:13:41.126 CET: %BGP-3-NOTIFICATION: received from neighbor 80.x.x.x 6/0 (cease) 0 bytes
Apr 27 05:30:39 ROUTER 1028828: Apr 27 05:30:39.833 CET: %BGP-3-NOTIFICATION: received from neighbor 80.x.x.x 6/3 (cease) 0 bytes
May  5 08:12:03 ROUTER 38467: May  5 08:12:03.644 CET: %BGP-3-NOTIFICATION: received from neighbor 80.x.x.x 6/4 (cease) 0 bytes
May  7 06:06:04 ROUTER 38956: May  7 06:06:04.092 CET: %BGP-3-NOTIFICATION: received from neighbor 80.x.x.x 6/6 (cease) 0 bytes
May 10 13:28:39 ROUTER 4366: May 10 13:28:38.919 CET: %BGP-3-NOTIFICATION: received from neighbor 80.x.x.x 6/7 (cease) 0 bytes

I think in backbone environments, your BGP should be stable and slotspie you don’t want to see lots of these messages. But at a big peering point, it’s the normal “noise”….

According to RFC4486, Cisco reports the Subcode of Cease Notification Message (blue) in the log message.
Here’s an overview of subcode definition:

Subcode Meaning
1 Maximum Number of Prefixes Reached
2 Administrative Shutdown
3 Peer De-configured
4 Administrative Reset
5 Connection Rejected
6 Other Configuration Change
7 Connection Collision Resolution
8 Out of Resources

and here comes a deeper explanation (also taken from the RFC):

  • If a BGP speaker decides to terminate its peering with a neighbor because the number of address prefixes received from the neighbor exceeds a locally configured upper bound,  then the speaker MUST send to the neighbor a NOTIFICATION message  with the Error Code Cease and the Error Subcode “Maximum Number of Prefixes Reached“.
  • If a BGP speaker decides to administratively shut down its peering with a neighbor, then the speaker SHOULD send a NOTIFICATION message with the Error Code Cease and the Error Subcode “Administrative Shutdown“.
  • If a BGP speaker decides to de-configure a peer, then the speaker  SHOULD send a NOTIFICATION message with the Error Code Cease and the  Error Subcode “Peer De-configured“.
  • If a BGP speaker decides to administratively reset the peering with a neighbor, then the speaker SHOULD send a NOTIFICATION message with the Error Code Cease and the Error Subcode “Administrative Reset“.
  • If a BGP speaker decides to disallow a BGP connection (e.g., the peer is not configured locally) after the speaker accepts a transport protocol connection, then the BGP speaker SHOULD send a NOTIFICATION message with the Error Code Cease and the Error Subcode “Connection Rejected“.
  • If a BGP speaker decides to administratively reset the peering with a neighbor due to a configuration change other than the ones described above, then the speaker SHOULD send a NOTIFICATION message with the Error Code Cease and the Error Subcode “Other Configuration Change“.
  • If a BGP speaker decides to send a NOTIFICATION message with the Error Code Cease as a result of the collision resolution procedure then the subcode SHOULD be set to “Connection Collision Resolution“.
  • If a BGP speaker runs out of resources (e.g., memory) and decides to reset a session, then the speaker MAY send a NOTIFICATION message with the Error Code Cease and the Error Subcode “Out of Resources“.

Convert dBm to milliwatts (mW)

Sometimes you have to convert a dBm value to milliwatts, e.g. when you retrieve the output power of a laser or a xDSL port…
You can calculate these values with the following formulas or have a look in the attached conversion table.

mW to dBm:              dBm=10*log10(P/1mW)

dBm to mW:              mW=10(dBm/10)

dBm to mW conversion table

dBm mW dBm mW dBm mW dBm mW dBm mW
0.0 1.00000 0.1 1.02329 0.2 1.04713 0.3 1.07152 0.4 1.09648
0.5 1.12202 0.6 1.14815 0.7 1.17490 0.8 1.20226 0.9 1.23027
1.0 1.2589 1.1 1.2882 1.2 1.3183 1.3 1.3490 1.4 1.3804
1.5 1.4125 1.6 1.4454 1.7 1.4791 1.8 1.5136 1.9 1.5488
2.0 1.5849 2.1 1.6218 2.2 1.6596 2.3 1.6982 2.4 1.7378
2.5 1.7783 2.6 1.8197 2.7 1.8621 2.8 1.9055 2.9 1.9498
3.0 1.9953 3.1 2.0417 3.2 2.0893 3.3 2.1380 3.4 2.1878
3.5 2.2387 3.6 2.2909 3.7 2.3442 3.8 2.3988 3.9 2.4547
4.0 2.5119 4.1 2.5704 4.2 2.6303 4.3 2.6915 4.4 2.7542
4.5 2.8184 4.6 2.8840 4.7 2.9512 4.8 3.0200 4.9 3.0903
5.0 3.1623 5.1 3.2359 5.2 3.3113 5.3 3.3884 5.4 3.4674
5.5 3.5481 5.6 3.6308 5.7 3.7154 5.8 3.8019 5.9 3.8905
6.0 3.9811 6.1 4.0738 6.2 4.1687 6.3 4.2658 6.4 4.3652
6.5 4.4668 6.6 4.5709 6.7 4.6774 6.8 4.7863 6.9 4.8978
7.0 5.0119 7.1 5.1286 7.2 5.2481 7.3 5.3703 7.4 5.4954
7.5 5.6234 7.6 5.7544 7.7 5.8884 7.8 6.0256 7.9 6.1660
8.0 6.3096 8.1 6.4565 8.2 6.6069 8.3 6.7608 8.4 6.9183
8.5 7.0795 8.6 7.2444 8.7 7.4131 8.8 7.5858 8.9 7.7625
9.0 7.9433 9.1 8.1283 9.2 8.3176 9.3 8.5114 9.4 8.7096
9.5 8.9125 9.6 9.1201 9.7 9.3325 9.8 9.5499 9.9 9.7724
10.0 10.0000 10.1 10.2329 10.2 10.4713 10.3 10.7152 10.4 10.9648
10.5 11.2202 10.6 11.4815 10.7 11.7490 10.8 12.0226 10.9 12.3027
11.0 12.5893 11.1 12.8825 11.2 13.1826 11.3 13.4896 11.4 13.8038
11.5 14.1254 11.6 14.4544 11.7 14.7911 11.8 15.1356 11.9 15.4882
12.0 15.8489 12.1 16.2181 12.2 16.5959 12.3 16.9824 12.4 17.3780
12.5 17.7828 12.6 18.1970 12.7 18.6209 12.8 19.0546 12.9 19.4984
13.0 19.9526 13.1 20.4174 13.2 20.8930 13.3 21.3796 13.4 21.8776
13.5 22.3872 13.6 22.9087 13.7 23.4423 13.8 23.9883 13.9 24.5471
14.0 25.1189 14.1 25.7040 14.2 26.3027 14.3 26.9153 14.4 27.5423
14.5 28.1838 14.6 28.8403 14.7 29.5121 14.8 30.1995 14.9 30.9030
15.0 31.6228 15.1 32.3594 15.2 33.1131 15.3 33.8844 15.4 34.6737
15.5 35.4813 15.6 36.3078 15.7 37.1535 15.8 38.0189 15.9 38.9045
16.0 39.8107 16.1 40.7380 16.2 41.6869 16.3 42.6580 16.4 43.6516
16.5 44.6684 16.6 45.7088 16.7 46.7735 16.8 47.8630 16.9 48.9779
17.0 50.1187 17.1 51.2861 17.2 52.4807 17.3 53.7032 17.4 54.9541
17.5 56.2341 17.6 57.5440 17.7 58.8844 17.8 60.2560 17.9 61.6595
18.0 63.0957 18.1 64.5654 18.2 66.0693 18.3 67.6083 18.4 69.1831
18.5 70.7946 18.6 72.4436 18.7 74.1310 18.8 75.8578 18.9 77.6247
19.0 79.4328 19.1 81.2831 19.2 83.1764 19.3 85.1138 19.4 87.0964
19.5 89.1251 19.6 91.2011 19.7 93.3254 19.8 95.4993 19.9 97.7237
20.0 100.0000 20.1 102.3293 20.2 104.7129 20.3 107.1519 20.4 109.6478
20.5 112.2018 20.6 114.8154 20.7 117.4898 20.8 120.2264 20.9 123.0269
21.0 125.8925 21.1 128.8250 21.2 131.8257 21.3 134.8963 21.4 138.0384
21.5 141.2538 21.6 144.5440 21.7 147.9108 21.8 151.3561 21.9 154.8817
22.0 158.4893 22.1 162.1810 22.2 165.9587 22.3 169.8244 22.4 173.7801
22.5 177.8279 22.6 181.9701 22.7 186.2087 22.8 190.5461 22.9 194.9845
23.0 199.5262 23.1 204.1738 23.2 208.9296 23.3 213.7962 23.4 218.7762
23.5 223.8721 23.6 229.0868 23.7 234.4229 23.8 239.8833 23.9 245.4709
24.0 251.1886 24.1 257.0396 24.2 263.0268 24.3 269.1535 24.4 275.4229
24.5 281.8383 24.6 288.4032 24.7 295.1209 24.8 301.9952 24.9 309.0295
25.0 316.2278 25.1 323.5937 25.2 331.1311 25.3 338.8442 25.4 346.7369
25.5 354.8134 25.6 363.0781 25.7 371.5352 25.8 380.1894 25.9 389.0451
26.0 398.1072 26.1 407.3803 26.2 416.8694 26.3 426.5795 26.4 436.5158
26.5 446.6836 26.6 457.0882 26.7 467.7351 26.8 478.6301 26.9 489.7788
27.0 501.1872 27.1 512.8614 27.2 524.8075 27.3 537.0318 27.4 549.5409
27.5 562.3413 27.6 575.4399 27.7 588.8437 27.8 602.5596 27.9 616.5950
28.0 630.9573 28.1 645.6542 28.2 660.6934 28.3 676.0830 28.4 691.8310
28.5 707.9458 28.6 724.4360 28.7 741.3102 28.8 758.5776 28.9 776.2471
29.0 794.3282 29.1 812.8305 29.2 831.7638 29.3 851.1380 29.4 870.9636
29.5 891.2509 29.6 912.0108 29.7 933.2543 29.8 954.9926 29.9 977.2372
30 1000.000 31 1258.925 32 1584.893 33 1995.262 34 2511.886
35 3162.278 36 3981.072 37 5011.872 38 6309.573 39 7943.282
40 10000.00 41 12589.25 42 15848.93 43 19952.62 44 25118.86
45 31622.78 46 39810.72 47 50118.72 48 63095.73 49 79432.82

Using apt with proxy

If you are using APT (Advanced Package Tool) and you are bound to use a proxy server to connect to the internet, you have to configure it as follows.

If not existent, you have to create the file /etc/apt/apt.conf

touch /etc/apt/apt.conf

Now insert the following line…

Acquire::http::Proxy http://username:password@proxy:8080;

Please adjust the parameters to your requirements.
When you try “apt-get update”, it should work now.

JunOS - Recover BGP password

When you need to recover missing BGP MD5 password on Juniper routers, you have the possibility to extract it from a specific file.

First, you have to start a shell:

alex@M10> start shell
% su -
Password:
root@M10%

After changing to the root user, you have the necessary permissions to view the file /var/etc/keyadmin.conf

root@M10% cd /var/etc/
root@M10% more keyadmin.conf
tcp 179 0.0.0.0 <IP address> md5 instance default 0x424157395877553351436a5263586b37
tcp 179 0.0.0.0 <IP address> md5 instance default 0x393831633666333463366663

Now you can convert the HEX keys back to MD5 with this small Perl one-liner:

perl -e 'print "Hex: ";$_=<>;print "MD5: ";s/(\w\w)/\1:/g;for (split(/:/)) {printf "%s", chr(hex($_))};print "\n"'
Hex: 0x424157395877553351436a5263586b37
MD5: BAW9XwU3QCjRcXk7