Friday, July 24, 2015

Google.com Not Working - Redirects to IPV6 address in Squid (Centos)

Sometime I noticed that google is not working in my network. After checking logs it was noticed that squid is forwarding the requests to IPV6 address of google

1437666658.051  60298 172.XXX.XXX.XX TCP_MISS/503 0 CONNECT clients4.google.com:443 - DIRECT/2a00:1450:4001:805::1003
1437666660.121  60292 172.XXX.XXX.XX TCP_MISS/503 0 CONNECT clients2.google.com:443 - DIRECT/2a00:1450:4001:805::1004

To fix this issue first disable IPV6 from your linux machine with below commands

In /etc/sysctl.conf change/create entries:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

In /etc/sysconfig/network change/create entries:

NETWORKING_IPV6=no
IPV6INIT=no

service ip6tables stop
chkconfig ip6tables off

& finally run this command
echo "install ipv6 /bin/true" > /etc/modprobe.d/ipv6_disabled.conf


Restart you PC & add below rules in squid.conf file. Restart squid & your issue will resolved
tcp_outgoing_address <Your Server IP> all
dns_v4_first on

Friday, July 17, 2015

[Solved] VMWare Workstation 10 stopped working after upgrading to Centos 6.6

After upgrading to Centos 6.6 My Vmware-workstation stopped working & showing below error while running any virtual machine

Could not open /dev/vmmon: No such file or directory.
Please make sure that the kernel module `vmmon' is loaded.

On terminal vmware status showing below errors & modules not loaded

[root@bhagwat vmware-root]# /etc/init.d/vmware start
Starting VMware services:
   Virtual machine monitor                                 [FAILED]
   Virtual machine communication interface                 [  OK  ]
   VM communication interface socket family                [  OK  ]
   Blocking file system                                    [  OK  ]
   Virtual ethernet                                        [  OK  ]
   VMware Authentication Daemon                            [  OK  ]

[root@bhagwat vmware-root]# /etc/init.d/vmware status
Module vmmon not loaded
Module vmnet not loaded

Solution 
Solution is very simple just run below commands

/etc/init.d/vmware stop

rm /lib/modules/$(uname -r)/misc/vmmon.ko

vmware-modconfig --console --build-mod vmmon /usr/bin/gcc /lib/modules/$(uname -r)/build/include/

sudo depmod -a

/etc/init.d/vmware start

& Done..... Your issue is resolved.

Saturday, July 11, 2015

"SOLVED" How to fix Error "No module named yum"

Many time after upgrading your OS or any package you are getting this error while running any command with yum
############################
[root@bhagwat ~]# yum clean all
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   No module named yum

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.7.3 (default, Jan 21 2015, 16:18:50)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-11)]
#############################
This is related with python version of your system. You may have many versions of python installed in your PC & only one of them has the yum library installed.

SOLUTION - 
Run the below command - It will show the current python path (In my case it is working with python 2.7)
[root@bhagwat yum.repos.d]# ls -l /usr/bin/python
lrwxrwxrwx 1 root root 24 Jan 13 15:55 /usr/bin/python -> /usr/local/bin/python2.7

Check the python version available at your /usr/bin
[root@bhagwat]# /usr/bin/python
python       python2      python2.6    python2.6.6  python-pip

For each of your python version run below command

/usr/bin/python2.x
You'll get a python prompt. Run:

>>> import yum

Do this for every python binary until you find one that doesn't raise an ImportError at this step.
[root@bhagwat yum.repos.d]# /usr/bin/python2.6
Python 2.6.6 (r266:84292, Jan 22 2014, 09:37:14)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import yum
>>>

Now, run as root:

ln -s /usr/bin/python2.6 /usr/bin/python

& Done....Your Issue is resolved

In case you are getting error "ln: creating symbolic link `/usr/bin/python': File exists"
Just run the below command
[root@bhagwat bin]# mv /usr/bin/python /usr/bin/python-origin
-----------------------------
[root@bhagwat bin]# ln -s /usr/bin/python2.6 /usr/bin/python