Friday, 4 November 2016

How to delete inet6 Link address or Removing an IPv6 address !

Not so often needed, be carefully with removing non existent IPv6 address, sometimes using older kernels it results in a crash.

Using "ip"

Usage:

# /sbin/ip -6 addr del <ipv6address>/<prefixlength> dev <interface>
Example:

# /sbin/ip -6 addr del 2001:0db8:0:f101::1/64 dev eth0
Using "ifconfig"

Usage:

# /sbin/ifconfig <interface> inet6 del <ipv6address>/<prefixlength>
Example:

# /sbin/ifconfig eth0 inet6 del 2001:0db8:0:f101::1/64

Example
There is an inet6 addr on the eth0 interface:
eth0      Link encap:Ethernet  HWaddr 00:0c:29:d9:46:f5  
          inet6 addr: fe80::20c:29ff:fed9:46f5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:38 errors:0 dropped:0 overruns:0 frame:0
          TX packets:193 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4133 (4.1 KB)  TX bytes:32902 (32.9 KB)
          Interrupt:19 Base address:0x2024 
I don't need this address and I use the following command to delete it:
sudo ifconfig eth0 inet6 del fe80::20c:29ff:fed9:46f5/64

2 comments:

  1. Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking.Big data hadoop online Course

    ReplyDelete