# how I  can get ipv6 over pppoe?



## supersnd (Dec 29, 2020)

rc.conf

```
ppp_enable="YES"
ppp_mode="ddial"
#ppp_nat="YES"  # if you want to enable nat for your local network, otherwise NO
ppp_profile="isp1"
```
ppp.conf

```
default:
  set log Phase tun command # you can add more detailed logging if you wish
  set ifaddr 192.168.1.1/0 192.168.2.1/0

isp1:
  set device PPPoE:igb0 # replace xl1 with your Ethernet device
  set authname **
  set authkey ***
  set dial
  set login
  add default HISADDR
```

`ppp -ddial isp1`

```
ifconfig
tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1492
    options=80000<LINKSTATE>
    inet6 fe80::a236:9f13:170f:7730%tun0 prefixlen 64 scopeid 0x6
    inet 49.83.187.154 --> 49.83.187.1 netmask 0xffffffff
    groups: tun
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
    Opened by PID 3235
```
If I connect my route, I can get IPv6 address like 240e:3a1:8840:268:*.*.*.*
What can I do for IPv6?


----------



## PMc (Dec 29, 2020)

I did the following:

ppp option:
`enable ipv6cp`

then:

```
> show ipv6cp
     IPV6CP [Opened]
       His side:        fe80::ee13:dbff:fe17:2b3d
       My side:         fe80::2e0:18ff:fe36:f13c
```

then: 
check that firewall allows icmp6 message 134 and 143.

then:
`ifconfig tun0 inet6 accept_rtadv`

And then a real address (not just linklocal) appeared on tun0.


----------



## supersnd (Dec 29, 2020)

`enable ipv6cp`  is the default options, I set `disable ipv6cp`,  the locallink ipv6 address is disappear.
`ifconfig tun0 inet6 accept_rtadv`, this command I can't get the real address, and it change resolv.conf ,set dns to ipv6 fe******


----------



## sol289 (Dec 29, 2020)

Hello! Read this (it's in russian, but you only need configs): https://onlyfriends.name/2013/12/zhenitba-freebsd-i-dom-ru-ipv6/


----------



## supersnd (Dec 30, 2020)

thanks


----------



## mickey (Dec 30, 2020)

supersnd said:


> `enable ipv6cp`  is the default options, I set `disable ipv6cp`,  the locallink ipv6 address is disappear.
> `ifconfig tun0 inet6 accept_rtadv`, this command I can't get the real address, and it change resolv.conf ,set dns to ipv6 fe******


There are two parts to this. First a link-local IPv6 address is negotiated by ppp's IPV6CP protocol. Then you can receive ICMP6 router advertisement messages from your ISP and perform SLAAC to get a global IPv6 address. For the second part to work, you should add the following to your /etc/rc.conf:

```
ipv6_cpe_wanif="tun0"
```
This enables your WAN interface (tun0) to receive router advertisements and to add received routes to the system's routing table, see rc.conf(5).

If you require an IPv6 prefix in addition for use on your LAN, you will also have to set up a dhcp6 client like net/dhcp6 to perform prefix delegation and use rtadvd(8) to advertise this prefix on your LAN interface.


----------



## Alain De Vos (Dec 31, 2020)

I don't have a accept_rtadv setting in rc.conf.
Only , enable ipv6cp in ppp.conf
And :
sysctl net.inet6.ip6.accept_rtadv
net.inet6.ip6.accept_rtadv: 0
Yet everything works fine for me.
Weird.


----------

