Sunday, September 27, 2009

Disabling IPv6 lookup for the time being

Just had a chance to open up my hosts file under F11,and saw an entry that got my attention it was the second row as shown below.

[root@sawrub-xbox ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@sawrub-xbox ~]#
Moving around the web get me to the conclusion that its related to the IPv6. The IPv6 site also shouted out at me ,with my IPv4 IP Address.
Thinking over it, questions came up to the every answer that i was getting, let me collect all question together first and make the answers follow them:
Q1] If my machine is still IPv4, why was the entry of IPv6 over there under /etc/hosts.
Q2] Why is this enabled by default.
Q3] How do i control IPv6 fetch from my applications.
Q4] How do I disable IPv6 at my machine.
Q5] How do i get IPv6 address.

The answers are here.
A1] Kernel 2.2+ come with IPv6 built in.

A2] Ipv4 is now ~30 Yr old from its birth in January 1980, what a great job done but the world is running out of IP address now due to the hundreds of computers coming live every day,.The solution to this is wider IP address size, with IPv6 addresses being 128 bits long being 4 times larger than the present IPv4.
So enabling this by default ensures that when ever there is a transition from Ipv4 to Ipv6, no configuration is needed.
Just the drawback of having IPv6 enabled by default is that application s/w like Firefox, which access Internet and have the ability to use IPv6 try to get the Domain Name resolved into the IPv6 IP address by DNS Server,and if the DNS is not capable of returning the IPv6 address, then that handshake between the client and the DNS server is just a waste of time, which gets solved by Firefox re-requesting the DNS but now for the Ipv4 address. So its always better to switch off the use of IPv6 at application and OS to speed up the IP address fetching.Which is read as "Disabling IPv6 increases browsing speed".

A3] Disabling the Ipv6 under application s/w can be done if they provide any such option.I do have option for the most used Firefox.But this needs to be undone ,when you get an IPv6 address in future and your DNS is capable of

Following are the steps :
1] Type in "about:config" in the address bar.
2] In the Filter field. search for "ipv6"
network.dns.disableIPv6 will show up.
3] Right click on the row listing network.dns.disableIPv6,and click Toggle from the pop-up, and the value will be set to 'True'. If its not just edit the value column and set it to 'True' ,me using Firefox 3.5.3.

A4] Disabling the IPv6, services and firewalls involved couple of steps as :
[root@sawrub-xbox ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=sawrub-xbox
[root@sawrub-xbox ~]#
Check the /etc/sysconfig/network file for following entry,if settings are there just set it to 'no' as in :
NETWORKING_IPV6=no
IPV6INIT=no
if the lines as above were not there, then just execute the following.
[root@sawrub-xbox ~]# echo -e "NETWORKING_IPV6=no\nIPV6INIT=no" >> /etc/sysconfig/network
[root@sawrub-xbox ~]# cat /etc/sysconfig/network
--- snipped ---
NETWORKING_IPV6=no
IPV6INIT=no
--- snipped ---
Followed by few changes to ip-tables and services.
Stopping the IPv6 Iptables.
[root@sawrub-xbox ~]# service ip6tables stop
ip6tables: Flushing firewall rules: [ OK ]
ip6tables: Setting chains to policy ACCEPT: filter [ OK ]
ip6tables: Unloading modules: [ OK ]
[root@sawrub-xbox ~]#
Setting the values to off in chkconfig insures that the service will not come up on system restart, and finally re-starting the network service.
[root@sawrub-xbox ~]# chkconfig ip6tables off
[root@sawrub-xbox ~]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
[root@sawrub-xbox ~]#

A5] Lastly i'll have to live with IPv4 as getting the IPv6 solely depends on the ISP.

0 comments:

Post a Comment