Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How can I assign two or more IPv6 address on one NIC. I tried Google but no luck. I've done it with ipv4 but ipv6 can not.

share|improve this question
    
Can you elaborate more on what you've tried and the issues you've encountered? Otherwise you'll likely just find the same answers you got on Google. –  Mark Henderson Mar 10 '12 at 21:07
add comment

migrated from serverfault.com Mar 11 '12 at 15:03

This question came from our site for professional system and network administrators.

3 Answers

up vote 2 down vote accepted

I tried a search for freebsd ip tools ipv6. I found instruction at http://www.kame.net/~suz/freebsd-ipv6-config-guide.txt.

method 1) completely static configuration like IPv4
Linklocal prefix (fe80:....) is automatically generated, so you 
don't have to configure it.
-------/etc/rc.conf---------
ipv6_network_interfaces="fxp0"
ipv6_ifconfig_fxp0="3ffe:501:ffff:2::1 prefixlen 64"
ipv6_ifconfig_fxp0_alias0="2001:ffff:0:2::2 prefixlen 64"
ipv6_defaultrouter="fe80::1%fxp0"
----------------------------
share|improve this answer
add comment

Manually configuring IPv6 addresses:

ifconfig if_name inet6 ipv6_address/len action

So to add an address to em0

ifconfig em0 inet6 2001:db8:bdbd::1/64 add

Delete that address simply by swapping delete for add

Configure addresses in rc.conf almost the exact same way as IPv4:

ifconfig_em0_aliasN="inet6 2001:db8:bdbd::1/64"

See man ifconfig and man rc.conf for lots more info too.

share|improve this answer
1  
Newer versions of /etc/defaults/rc.conf suggest following syntax ifconfig_${ifname}_ipv6="inet6 2001:db8:bdbd::1 prefixlen 64" –  SaveTheRbtz Mar 11 '12 at 21:56
add comment

Method at http://www.kame.net/~suz/freebsd-ipv6-config-guide.txt is obsolete. Below method is working for me (I'm using FreeBSD 9.0) :

Example :

ifconfig_em0_ipv6="inet6 2607:f358:0001:fed2:0023:0000:6cd2:aaaa/64"
ifconfig_em0_alias0="inet6 2607:f358:0001:fed2:0023:0000:6cd2:aabb/64"
ipv6_defaultrouter="2607:f358:0001:fed2:0023::1"
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.