How do I add an additional IPv6 address to /etc/network/interfaces?












6















this question How do I add an additional IP address to /etc/network/interfaces? mostly asks what i want except that i want to add more IPv6 addresses in the same interface eth0 without incrementing to eth0.1 and so on. the ifconfig command does IPv6 like ifconfig eth0 add ... so ... how can i add more IPv6 addresses to eth0?










share|improve this question

























  • it would be nice if there was a practical way to do a whole /64

    – Skaperen
    May 1 '15 at 13:22











  • You can find some information about using a full /64 block on a single host here: serverfault.com/questions/590038/…

    – kasperd
    May 3 '15 at 15:04
















6















this question How do I add an additional IP address to /etc/network/interfaces? mostly asks what i want except that i want to add more IPv6 addresses in the same interface eth0 without incrementing to eth0.1 and so on. the ifconfig command does IPv6 like ifconfig eth0 add ... so ... how can i add more IPv6 addresses to eth0?










share|improve this question

























  • it would be nice if there was a practical way to do a whole /64

    – Skaperen
    May 1 '15 at 13:22











  • You can find some information about using a full /64 block on a single host here: serverfault.com/questions/590038/…

    – kasperd
    May 3 '15 at 15:04














6












6








6


6






this question How do I add an additional IP address to /etc/network/interfaces? mostly asks what i want except that i want to add more IPv6 addresses in the same interface eth0 without incrementing to eth0.1 and so on. the ifconfig command does IPv6 like ifconfig eth0 add ... so ... how can i add more IPv6 addresses to eth0?










share|improve this question
















this question How do I add an additional IP address to /etc/network/interfaces? mostly asks what i want except that i want to add more IPv6 addresses in the same interface eth0 without incrementing to eth0.1 and so on. the ifconfig command does IPv6 like ifconfig eth0 add ... so ... how can i add more IPv6 addresses to eth0?







networking server ethernet ipv6






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 13 '17 at 12:24









Community

1




1










asked May 1 '15 at 13:19









SkaperenSkaperen

1761115




1761115













  • it would be nice if there was a practical way to do a whole /64

    – Skaperen
    May 1 '15 at 13:22











  • You can find some information about using a full /64 block on a single host here: serverfault.com/questions/590038/…

    – kasperd
    May 3 '15 at 15:04



















  • it would be nice if there was a practical way to do a whole /64

    – Skaperen
    May 1 '15 at 13:22











  • You can find some information about using a full /64 block on a single host here: serverfault.com/questions/590038/…

    – kasperd
    May 3 '15 at 15:04

















it would be nice if there was a practical way to do a whole /64

– Skaperen
May 1 '15 at 13:22





it would be nice if there was a practical way to do a whole /64

– Skaperen
May 1 '15 at 13:22













You can find some information about using a full /64 block on a single host here: serverfault.com/questions/590038/…

– kasperd
May 3 '15 at 15:04





You can find some information about using a full /64 block on a single host here: serverfault.com/questions/590038/…

– kasperd
May 3 '15 at 15:04










2 Answers
2






active

oldest

votes


















4














In the question you reference, the second answer shows the equivalent solution for IPv4. In the case of IPv6, the /etc/network/interfaces file should contain something like this:



iface eth0 inet6 static
address 2001:db8:1:2::2
netmask 64
# Add additional IPv6 addresses when $IFACE goes up
up ip -6 addr add 2001:db8:1:2::3/64 dev $IFACE
up ip -6 addr add 2001:db8:1:2::4/64 dev $IFACE
# Remove them when $IFACE goes down
down ip -6 addr del 2001:db8:1:2::3/64 dev $IFACE
down ip -6 addr del 2001:db8:1:2::4/64 dev $IFACE


You will need the iproute2 package installed, but you should use ip instead of ifconfig anyway.





For adding a whole /64 to an interface: There are some Q&As in serverfault.se, like "Adding a whole IPv6 /64 block to an network interface on debian" or "Can I bind a (large) block of addresses to an interface?". Maybe they can help you.






share|improve this answer


























  • that local block route feature works so all i need to do now is get that added so it puts it back on reboot

    – Skaperen
    May 6 '15 at 9:25



















16














It would appear (tested with ifupdown version 0.7.53.1) that we can add several iface eth0 inet6 stanzas to the interfaces file, which is more declarative than the accepted answer. The following code instructs the ifupdown suite to use stateless autoconfiguration and two additional static IPv6 addresses for the eth0 network interface:



iface eth0 inet6 auto
iface eth0 inet6 static
address 3ffe:ffff::dead:beef
netmask 32
iface eth0 inet6 static
address 3ffe:ffff::c0de:d00d
netmask 32





share|improve this answer





















  • 3





    This is the "proper" answer - for IPv6 and IPv4!

    – Michael Hampton
    Jul 7 '16 at 20:50











  • in my case your answer did not work, but the approved one above did work. I am not sure why it might since it is a virtual machine (xen)?

    – Sverre
    Feb 1 '18 at 13:43











  • It would be useful to know what version of ifupdown you use. Can you look into the manpage of ifconfig?

    – Witiko
    Feb 1 '18 at 14:31













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f616856%2fhow-do-i-add-an-additional-ipv6-address-to-etc-network-interfaces%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














In the question you reference, the second answer shows the equivalent solution for IPv4. In the case of IPv6, the /etc/network/interfaces file should contain something like this:



iface eth0 inet6 static
address 2001:db8:1:2::2
netmask 64
# Add additional IPv6 addresses when $IFACE goes up
up ip -6 addr add 2001:db8:1:2::3/64 dev $IFACE
up ip -6 addr add 2001:db8:1:2::4/64 dev $IFACE
# Remove them when $IFACE goes down
down ip -6 addr del 2001:db8:1:2::3/64 dev $IFACE
down ip -6 addr del 2001:db8:1:2::4/64 dev $IFACE


You will need the iproute2 package installed, but you should use ip instead of ifconfig anyway.





For adding a whole /64 to an interface: There are some Q&As in serverfault.se, like "Adding a whole IPv6 /64 block to an network interface on debian" or "Can I bind a (large) block of addresses to an interface?". Maybe they can help you.






share|improve this answer


























  • that local block route feature works so all i need to do now is get that added so it puts it back on reboot

    – Skaperen
    May 6 '15 at 9:25
















4














In the question you reference, the second answer shows the equivalent solution for IPv4. In the case of IPv6, the /etc/network/interfaces file should contain something like this:



iface eth0 inet6 static
address 2001:db8:1:2::2
netmask 64
# Add additional IPv6 addresses when $IFACE goes up
up ip -6 addr add 2001:db8:1:2::3/64 dev $IFACE
up ip -6 addr add 2001:db8:1:2::4/64 dev $IFACE
# Remove them when $IFACE goes down
down ip -6 addr del 2001:db8:1:2::3/64 dev $IFACE
down ip -6 addr del 2001:db8:1:2::4/64 dev $IFACE


You will need the iproute2 package installed, but you should use ip instead of ifconfig anyway.





For adding a whole /64 to an interface: There are some Q&As in serverfault.se, like "Adding a whole IPv6 /64 block to an network interface on debian" or "Can I bind a (large) block of addresses to an interface?". Maybe they can help you.






share|improve this answer


























  • that local block route feature works so all i need to do now is get that added so it puts it back on reboot

    – Skaperen
    May 6 '15 at 9:25














4












4








4







In the question you reference, the second answer shows the equivalent solution for IPv4. In the case of IPv6, the /etc/network/interfaces file should contain something like this:



iface eth0 inet6 static
address 2001:db8:1:2::2
netmask 64
# Add additional IPv6 addresses when $IFACE goes up
up ip -6 addr add 2001:db8:1:2::3/64 dev $IFACE
up ip -6 addr add 2001:db8:1:2::4/64 dev $IFACE
# Remove them when $IFACE goes down
down ip -6 addr del 2001:db8:1:2::3/64 dev $IFACE
down ip -6 addr del 2001:db8:1:2::4/64 dev $IFACE


You will need the iproute2 package installed, but you should use ip instead of ifconfig anyway.





For adding a whole /64 to an interface: There are some Q&As in serverfault.se, like "Adding a whole IPv6 /64 block to an network interface on debian" or "Can I bind a (large) block of addresses to an interface?". Maybe they can help you.






share|improve this answer















In the question you reference, the second answer shows the equivalent solution for IPv4. In the case of IPv6, the /etc/network/interfaces file should contain something like this:



iface eth0 inet6 static
address 2001:db8:1:2::2
netmask 64
# Add additional IPv6 addresses when $IFACE goes up
up ip -6 addr add 2001:db8:1:2::3/64 dev $IFACE
up ip -6 addr add 2001:db8:1:2::4/64 dev $IFACE
# Remove them when $IFACE goes down
down ip -6 addr del 2001:db8:1:2::3/64 dev $IFACE
down ip -6 addr del 2001:db8:1:2::4/64 dev $IFACE


You will need the iproute2 package installed, but you should use ip instead of ifconfig anyway.





For adding a whole /64 to an interface: There are some Q&As in serverfault.se, like "Adding a whole IPv6 /64 block to an network interface on debian" or "Can I bind a (large) block of addresses to an interface?". Maybe they can help you.







share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 13 '17 at 12:23









Community

1




1










answered May 3 '15 at 14:39









DubuDubu

718310




718310













  • that local block route feature works so all i need to do now is get that added so it puts it back on reboot

    – Skaperen
    May 6 '15 at 9:25



















  • that local block route feature works so all i need to do now is get that added so it puts it back on reboot

    – Skaperen
    May 6 '15 at 9:25

















that local block route feature works so all i need to do now is get that added so it puts it back on reboot

– Skaperen
May 6 '15 at 9:25





that local block route feature works so all i need to do now is get that added so it puts it back on reboot

– Skaperen
May 6 '15 at 9:25













16














It would appear (tested with ifupdown version 0.7.53.1) that we can add several iface eth0 inet6 stanzas to the interfaces file, which is more declarative than the accepted answer. The following code instructs the ifupdown suite to use stateless autoconfiguration and two additional static IPv6 addresses for the eth0 network interface:



iface eth0 inet6 auto
iface eth0 inet6 static
address 3ffe:ffff::dead:beef
netmask 32
iface eth0 inet6 static
address 3ffe:ffff::c0de:d00d
netmask 32





share|improve this answer





















  • 3





    This is the "proper" answer - for IPv6 and IPv4!

    – Michael Hampton
    Jul 7 '16 at 20:50











  • in my case your answer did not work, but the approved one above did work. I am not sure why it might since it is a virtual machine (xen)?

    – Sverre
    Feb 1 '18 at 13:43











  • It would be useful to know what version of ifupdown you use. Can you look into the manpage of ifconfig?

    – Witiko
    Feb 1 '18 at 14:31


















16














It would appear (tested with ifupdown version 0.7.53.1) that we can add several iface eth0 inet6 stanzas to the interfaces file, which is more declarative than the accepted answer. The following code instructs the ifupdown suite to use stateless autoconfiguration and two additional static IPv6 addresses for the eth0 network interface:



iface eth0 inet6 auto
iface eth0 inet6 static
address 3ffe:ffff::dead:beef
netmask 32
iface eth0 inet6 static
address 3ffe:ffff::c0de:d00d
netmask 32





share|improve this answer





















  • 3





    This is the "proper" answer - for IPv6 and IPv4!

    – Michael Hampton
    Jul 7 '16 at 20:50











  • in my case your answer did not work, but the approved one above did work. I am not sure why it might since it is a virtual machine (xen)?

    – Sverre
    Feb 1 '18 at 13:43











  • It would be useful to know what version of ifupdown you use. Can you look into the manpage of ifconfig?

    – Witiko
    Feb 1 '18 at 14:31
















16












16








16







It would appear (tested with ifupdown version 0.7.53.1) that we can add several iface eth0 inet6 stanzas to the interfaces file, which is more declarative than the accepted answer. The following code instructs the ifupdown suite to use stateless autoconfiguration and two additional static IPv6 addresses for the eth0 network interface:



iface eth0 inet6 auto
iface eth0 inet6 static
address 3ffe:ffff::dead:beef
netmask 32
iface eth0 inet6 static
address 3ffe:ffff::c0de:d00d
netmask 32





share|improve this answer















It would appear (tested with ifupdown version 0.7.53.1) that we can add several iface eth0 inet6 stanzas to the interfaces file, which is more declarative than the accepted answer. The following code instructs the ifupdown suite to use stateless autoconfiguration and two additional static IPv6 addresses for the eth0 network interface:



iface eth0 inet6 auto
iface eth0 inet6 static
address 3ffe:ffff::dead:beef
netmask 32
iface eth0 inet6 static
address 3ffe:ffff::c0de:d00d
netmask 32






share|improve this answer














share|improve this answer



share|improve this answer








edited Jul 6 '16 at 13:39

























answered Jul 6 '16 at 12:33









WitikoWitiko

28627




28627








  • 3





    This is the "proper" answer - for IPv6 and IPv4!

    – Michael Hampton
    Jul 7 '16 at 20:50











  • in my case your answer did not work, but the approved one above did work. I am not sure why it might since it is a virtual machine (xen)?

    – Sverre
    Feb 1 '18 at 13:43











  • It would be useful to know what version of ifupdown you use. Can you look into the manpage of ifconfig?

    – Witiko
    Feb 1 '18 at 14:31
















  • 3





    This is the "proper" answer - for IPv6 and IPv4!

    – Michael Hampton
    Jul 7 '16 at 20:50











  • in my case your answer did not work, but the approved one above did work. I am not sure why it might since it is a virtual machine (xen)?

    – Sverre
    Feb 1 '18 at 13:43











  • It would be useful to know what version of ifupdown you use. Can you look into the manpage of ifconfig?

    – Witiko
    Feb 1 '18 at 14:31










3




3





This is the "proper" answer - for IPv6 and IPv4!

– Michael Hampton
Jul 7 '16 at 20:50





This is the "proper" answer - for IPv6 and IPv4!

– Michael Hampton
Jul 7 '16 at 20:50













in my case your answer did not work, but the approved one above did work. I am not sure why it might since it is a virtual machine (xen)?

– Sverre
Feb 1 '18 at 13:43





in my case your answer did not work, but the approved one above did work. I am not sure why it might since it is a virtual machine (xen)?

– Sverre
Feb 1 '18 at 13:43













It would be useful to know what version of ifupdown you use. Can you look into the manpage of ifconfig?

– Witiko
Feb 1 '18 at 14:31







It would be useful to know what version of ifupdown you use. Can you look into the manpage of ifconfig?

– Witiko
Feb 1 '18 at 14:31




















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f616856%2fhow-do-i-add-an-additional-ipv6-address-to-etc-network-interfaces%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How did Captain America manage to do this?

迪纳利

南乌拉尔铁路局