Friday, January 8, 2016

networking - How to assign multiple IPv6 Alias addresses to one network interface

I have an IPv6 Range which i am trying to assign on a centos6 server. I have updated my below files for IPv6 configuration:



[root@test ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=test.techsuccor.com

[root@test ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0

HWADDR=82:d7:5d:50:c9:86
TYPE=Ethernet
UUID=8ea314f3-d89a-4a5c-9ede-64b6675cae71
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=180.149.X.X
NETMASK=255.255.255.0

DNS2=206.183.X.X

GATEWAY=180.X.X.X
DNS1=206.X.X.X
IPV6INIT=yes
USERCTL=no
IPV6ADDR=2001:0df3:3cXX::X/64
IPV6_DEFAULTGW=2001:0df3:3cXX::1
[root@test ~]#


With the above configuration am able to ping the single main ipv6 ipaddress in & out.




Using the IPV6ADDR_SECONDARIES option am also able to add Alias IP's and ping them in and out



IPV6ADDR_SECONDARIES="2001:0df3:3cXX::X1/64 \
2001:0df3:3cXX::X2/64 \
2001:0df3:3cXX::X3/64 \
2001:0df3:3cXX::X4/64 \
2001:0df3:3cXX::X5/64"



What I actually need to do is assign full ipv6 range to the single NIC as alias ip's in one go. I can do this with below command



[root@test ~]# for ip in {4..10}; do /sbin/ifconfig eth0:1 inet6 add 2001:0df3:3c00::${ip}/64; done


Also after I run this command, I see my ipv6 ip's with ifconfig command as below but only the main IPv6 ping's and none of the Alias Ip ping from outside. Also is restart newtork all ip's go away.



[root@test ~]# ifconfig 
eth0 Link encap:Ethernet HWaddr 82:D7:5D:50:C9:86
inet addr:180.149.XX.XX Bcast:180.149.XX.XX Mask:255.255.255.0

**inet6 addr: 2001:df3:3c00::10/64 Scope:Global
inet6 addr: 2001:df3:3c00::1/64 Scope:Global
inet6 addr: 2001:df3:3c00::3/64 Scope:Global
inet6 addr: 2001:df3:3c00::4/64 Scope:Global
inet6 addr: 2001:df3:3c00::5/64 Scope:Global
inet6 addr: fe80::80d7:5dff:fe50:c986/64 Scope:Link
inet6 addr: 2001:df3:3c00::6/64 Scope:Global
inet6 addr: 2001:df3:3c00::7/64 Scope:Global
inet6 addr: 2001:df3:3c00::8/64 Scope:Global
inet6 addr: 2001:df3:3c00::9/64 Scope:Global**

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:312539319 errors:0 dropped:0 overruns:0 frame:0
TX packets:1808219 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:22772397919 (21.2 GiB) TX bytes:312003644 (297.5 MiB)
Interrupt:165

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host

UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:16406 errors:0 dropped:0 overruns:0 frame:0
TX packets:16406 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2295915 (2.1 MiB) TX bytes:2295915 (2.1 MiB)

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...