# IPv6 alias will not work



## Edelstoff (Nov 3, 2013)

Hello,

I didn't get the IPv6 alias up and running. ping6 to google.com is working - therefore the first IP is working. But I need more IPv6 addresses for multiple Apache Virtualhosts.

Here is my rc.conf:


```
hostname="host.example.com"
sshd_enable="YES"
sendmail_enable="NO"
zfs_enable="YES"
ntpd_enable="YES"
ifconfig_re0="inet 192.168.2.10 netmask 255.255.255.0"
defaultrouter="192.168.2.10"
ipv6_default_interface="re0"
ifconfig_re0_ipv6="inet6 2a01:4f8:162:5288::1 prefixlen 64"
ipv6_defaultrouter="fe80::1%re0"
ifconfig_re0_alias1="inet6 2a01:4f8:162:5288::2 prefixlen 64"
ifconfig_re0_alias2="inet6 2a01:4f8:162:5288::3 prefixlen 64"
```

The first IP is up:

```
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
	ether 8c:89:a5:63:ba:86
	inet 192.168.2.10 netmask 0xffffffe0 broadcast 192.168.2.255
	inet6 fe80::8e89:a5ff:fe63:ba86%re0 prefixlen 64 scopeid 0x5 
	inet6 2a01:4f8:162:5288::1 prefixlen 64 
	nd6 options=8021<PERFORMNUD,AUTO_LINKLOCAL,DEFAULTIF>
	media: Ethernet autoselect (1000baseT <full-duplex>)
	status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
	inet6 ::1 prefixlen 128 
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0xa 
	inet 127.0.0.1 netmask 0xff000000 
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
```

Any ideas?


----------



## junovitch@ (Nov 4, 2013)

Remember, counting starts at 0 in the programming world.  Also fix the prefix to not overlap on with the primary interface IPs.  Longhand.

```
ifconfig_re0_alias0="inet6 2a01:4f8:162:5288::2 prefixlen 128"
ifconfig_re0_alias1="inet6 2a01:4f8:162:5288::3 prefixlen 128"
```
Or shorthand.

```
ifconfig_re0_alias0="inet6 2a01:4f8:162:5288::2/128"
ifconfig_re0_alias1="inet6 2a01:4f8:162:5288::3/128"
```
Search for "alias" in rc.conf() for more details and examples.


----------



## kpa (Nov 4, 2013)

junovitch said:
			
		

> Also fix the prefix to not overlap on with the primary interface IPs.



This restriction does not apply to IPv6 aliases, only IPv4.


----------



## gustopn (Nov 4, 2013)

I have a far more interesting problem.

When you have 
	
	



```
ipv6_ifconfig_vtnet0="inet6 ..."
```
 set in your /etc/rc.conf and you also have there ifconfig_vtnet0_aliases with some INET6 aliases, then it overwrites your ipv6_ifconfig_vtnet0 setting. Interesting thing is that with IPv4 it does not happen. That configuration is being respected.


----------

