Monday, March 2, 2015

Netconnect on Ubuntu exits with ClassNotFoundException: SecureNCLauncher.class

Environment: Ubuntu 14.04.2 LTS ( i686 i.e. 32 bit )
Browser: Firefox 35.0.1
Java: Oracle Java: v1.8.0_31

Issue Description: While launching Juniper's Netconnect in firefox, it failed with an exception:
java.lang.ClassNotFoundException: SecureNCLauncher.class

Troubleshooting:
  1. Enabled Loggin, Traces & Applet lifecycle on Java ControlPanel (fire ControlPanel command from terminal" :
  2. Try to launch netconnect from browser. A Java Console will pop up and show a lot of logging as the applet loads.
  3. Monitor this console closely as the applet loads and you'll see below exception:
  4. So, the actual point of failure is Certification Path verification using OCSP. Workaround for this issue is to disable OCSP check in Java ControlPanel
  5. For complete resolution of this problem, refer to this article: http://kb.juniper.net/InfoCenter/index?page=content&id=KB29849



Tuesday, December 9, 2014

Linux based GRE tunnel using Policy Based Routing

Here we are not using DNAT but linux PBR. We'll need two IP addresses on your system, say IP1 & IP2. 


  1. On your system, create a GRE tunnel between Local IP1 and Remote IP:
    ## CREATE GRE TUNNELmodprobe ip_gre echo 1 > /proc/sys/net/ipv4/ip_forward ip tu add zen mode gre remote 10.66.63.5 local 10.66.63.21 ttl 128 ip ad ad dev zen 172.17.0.41 peer 172.17.0.42/30
    ip li set zen up ip tu ls zen ip ad ls zen ping 172.17.0.42 -c 5
  2. Create a custom routing table to handle routing for GRE traffic:
  3. echo 200 custom >> /etc/iproute2/rt_tables
  4. Create a rule to route traffic originating from IP2 through custom routing table created in step 3:
    ip rule add from 192.168.30.200 lookup custom
  5. Create a route in custom routing table to make GRE interface the default gateway.
    ip route add dev eth1 table custom
  6. Send traffic with IP2 as source ip.

GRE tunnel on a linux system using DNAT

## CREATE GRE TUNNEL
modprobe ip_gre echo 1 > /proc/sys/net/ipv4/ip_forward ip tu add zen mode gre remote 10.66.63.5 local 10.66.63.21 ttl 128 ip ad ad dev zen 172.17.0.41 peer 172.17.0.42/30 ip li set zen up #iptables -I POSTROUTING -o zen -j MASQUERADE ip tu ls zen ip ad ls zen ping 172.17.0.42 -c 5


### IPTABLE RULE TO FORWARD TRAFFIC THROUGH GRE iptables -F
iptables -I OUTPUT -t nat -p tcp -s 10.37.144.130 -m multiport --dport 80,443,9401 -j DNAT --to 172.17.0.58


Monday, March 4, 2013

damaged repomd.xml file on fedora


Error while installing a package on Fedora using yum:

Loaded plugins: axelget, fastestmirror, langpacks, presto, refresh-packagekit
Error: Error importing repomd.xml from fedora/17/x86_64: Damaged repomd.xml file

Solution:

sudo yum clean all
Loaded plugins: axelget, fastestmirror, langpacks, presto, refresh-packagekit
Cleaning repos: adobe-linux-x86_64 fedora google-chrome missingboxstudio missingboxstudio-Updates rpmfusion-free rpmfusion-free-rawhide rpmfusion-free-updates updates
Cleaning up Everything
Cleaning up list of fastest mirrors
24 delta-package files removed by presto

After this I was able to install using yum

Friday, September 24, 2010

How to physically locate a FreeBSD machine using its shell

If a machine is being used only through remote access, it is very likely that one will forget its physical location. And one won't care where it is located unless one day you plan to upgrade the hardware of the machine. This is when one will try to recall where the machine is placed. Most of the time, its not easy to recall where the machine is located.

Wouldn't it be great if it was possible for you to tell the machine to make some noise so that you can locate it? Actually, it is possible. How? very easy :

Load speaker device in kernel:
kldload speaker

Then you can use it this way
Code:
echo "BP" > /dev/speaker
echo "SO4L16G>L8C." > /dev/speaker

Tuesday, June 22, 2010

How to use regex in find command

Today I discovered how to use regex in unixs' find command. It has a very simple syntax as below:

Syntax: find \path\ -regex '\regex pattern\'
e.g. find ./ -regex 'file[0-9]+.txt'

In above example, we are looking for files with name like file1.txt or file23.txt or file567.txt. This is a match on the whole path, not a search. For example, to match a file named `./fubar3', you can use the regular expression `.*bar.' or `.*b.*3', but not `f.*r3'.

According to find man page, it is also possible to specify the type of regex to be used, like emacs regex, posix-awk, posix-basic, posix-egrep and posix-extended. Default is emacs regex.

Another option is -iregex. It is just like -regex, but the match is case insensitive.

Monday, June 21, 2010

How to specify destination for tar extraction

Specify a destination to extract a tar archive
It is very simple, say:
/root/file.tar.gz - gzipped tar archive file
/usr/local/tmp - destination location where above file needs to be extracted to.

command:
tar -xzf /root/file.tar.gz -C /usr/local/tmp

You might have already noticed '-C' option. This can be used to explicitly specify destination location if it is other than PWD.