Thursday, October 21, 2010

Assign IPv6 addresses in Linux

Hi All,

Now the IPV6 came.But  in linux how to assign the static IPV6 ? It is inevitable that IPv6 addresses are going to eventually take over. When that happens you will need to know just how to assign an IPv6 address in your Linux operating system. Of course this will only be necessary on a system that uses a static IP address, but when you’re using Linux that can happen fairly often. Having this knowledge on hand will make this transition easy.
 you will have to have a kernel that is compiled with IPv6 support. Most modern Linux distributions already have this built in. You also have to have your IPv6 addresses handy.  simple web-based IPv6 calculator. With that tool select the IPv4 to IPv6 conversion and you should be good to go. So with everything in hand, you are ready to configure.
 go to  ipv4 to ipv6 converter tool click here

IPv6 support
First make sure your kernel supports IPv6. To do this you can first run the command:
sudo lsmod|less
and search the listing to see if ipv6 is there. If not try loading it with the command:
sudo /sbin/modprobe ipv6
Now issue the lsmod command to see if it is there. It should be.
Configuration
The file you want to configure will be the standard network interface configuration. Remember you are going to configure for static IP addresses. The file in question is /etc/network/interfaces. We are also going to add something to this file that will ensure IPv6 is loaded properly and that your networking us making use of the new address scheme.
The details of our configuration:
IPv4 address: 192.168.1.10
IPv6 Address: 2002:c0a8:10a::
IPv4 gateway: 192.168.1.1
IPv6 gateway: 2002:c0a8:0101::
Now let’s add this to the /etc/network/interfaces file. The new file will look like this:
#IPV6 static configuration
iface eth0 inet6 static
pre-up modprobe ipv6
address 2002:c0a8:10a::

netmask 64
gateway 2002:c0a8:0101::


Notice the “pre-up” command. That is where we ensure that IPv6 is added to the kernel, otherwise you run the risk of attempting to use an IPv6 address in a system that is looking for an IPv4 address.
Now you will want to restart networking with the command:
/etc/init.d/networking restart
You should now have an IPv6 address enabled.
Testing
Before you assume everything is working, let’s make sure first. You can check your IP routing with the command:
ip -6 route show
The above command should return something like:
2002:c0a8:0100/64 dev eth0 proto kernel  scope  link src 2002:c0a8:10a
You can also check by pinging with the ping6 tool. A good IPv6 address to try is the Google address. Issue this command:
ping6 ipv6.google.com
If IPv6 isn’t working you will get error:
Network is unreachable
If IPv6 is working you will see the standard ping results in your terminal window.

Another Method :

Using "ip"

Usage:
# /sbin/ip -6 addr add <ipv6address>/<prefixlength> dev <interface> 
Example:
# /sbin/ip -6 addr add 2001:0db8:0:f101::1/64 dev eth0 

Using "ifconfig"

Usage:
# /sbin/ifconfig <interface> inet6 add <ipv6address>/<prefixlength>
Example:
# /sbin/ifconfig eth0 inet6 add 2001:0db8:0:f101::1/64 

No comments:

Post a Comment

Popular Posts

Followers

Disclaimer

All Data and Information Provided on This BLOG is only for Education purposes only.If you done any thing else these in real time the blog is not Responsible.Try all those on your own risk.
IF you find any thing else here as per in violation of copyright law .mail me on srinathceh@gmail.com as soon as possible action will be taken.