IPv6 over PPPoe?

17,740

You can try adding

+ipv6 ipv6cp-use-ipaddr

to /etc/ppp/options. Depending on how your ISP provides IPv6 this might be enough to give the machine itself IPv6.

Many ISPs assume that a router connects with PPPoE instead of a PC, so this might not work for you. The only way to get IPv6 in this situation is to configure your machine as a router. It should then use DHCP for IPv6 to ask for Prefix Delegation. The prefix it gets can then be used to assign /64 subnets to your networks or your local machine. And if you want to provide IPv6 service to your local networks you should run radvd (router advertisement daemon) to advertise that your machine is a router.

The easiest is to use wide-dhcpdv6 for this. The basic idea is to request prefix delegation from one interface and then use that prefix to assign subnets to other interfaces, like:

interface ppp0 {
    # Request Prefix Delegation on ppp0, and give the received prefix id 0
    send ia-pd 0;
};

# Use subnets from the prefix with id 0
id-assoc pd 0 {
    prefix-interface eth0 {
        # Assign subnet 1 to eth0
        sla-id 1;
    };
};

Let's say that you received prefix 2001:db8:1234::/48 from your ISP. This example would then assign 2001:db8:1234:1::/64 to eth0.

A basic radvd.conf would look like:

interface eth0
{
    AdvSendAdvert on;
    prefix ::/64
    {
        AdvOnLink on;
        AdvAutonomous on;
    };
};

Oh, and don't forget to put

net.ipv6.conf.all.forwarding=1

in your /etc/sysctl.conf.

Share:
17,740

Related videos on Youtube

Dan Hibbert
Author by

Dan Hibbert

Updated on September 18, 2022

Comments

  • Dan Hibbert
    Dan Hibbert almost 2 years

    What is the best way to be able to get IPv6 addresses over PPPoe?

    I currently use NM-Applet to get internet service from my ISP, but it has no IPv6 tab on PPPOE connections. I wouldn't mind using some command line tool, but it would be nice to transfer my settings from NM-applet to whatever tool if I have to do that.

  • Sander Steffann
    Sander Steffann almost 13 years
    Oh, and 6deploy.org/workshops/brazil_20080526/autoconf_and_dhcpv6.pd‌​f might also contain useful information!
  • Dan Hibbert
    Dan Hibbert almost 13 years
    Well, I knew about radvd and DHCPv6, but I sure didn't know you could use them over a pppoe interface. Can you use dibbler to request a prefix and then give out addresses on other interfaces? I don't have anything against wide-dhcpv6, but I do already have dibbler set up for one of my home networks. Thanks!
  • Sander Steffann
    Sander Steffann almost 13 years
    Should be no problem. IPv6 with PPP (and therefore PPPoE and PPPoA) just create a link. Everything else just works like your local network :-)
  • kasperd
    kasperd almost 8 years
    Instead of adding the option to /etc/ppp/options I added it to the relevant file in /etc/ppp/peers which appears to achieve the same result. I think your answer could be improved slightly by mentioning what ipv6cp-use-ipaddr does.
  • kasperd
    kasperd almost 8 years
    When I enable IPv6 in the PPP configuration I get a functional default route looking like this: default via fe80::203:97ff:fe27:c000 dev ppp0 proto ra metric 1024 expires 65503sec hoplimit 64 but when I enable packet forwarding with net.ipv6.conf.all.forwarding = 1 the default route is removed. I can make the connection work by manually creating the route from the command line, but I am pretty sure that is not how I am supposed to do. Any obvious explanation what I did wrong, or do I need to ask a separate question about that?
  • Sander Steffann
    Sander Steffann almost 8 years
    Your system learned its default route from the Router Advertisements (RAs) sent to you from the other side of the PPP connection. When you enable forwarding on Linux the kernel stops processing RAs. If you want to enable receiving RAs even when forwarding you need to set accept_ra=2 which forces it to on even when forwarding is enabled. Also see kernel.org/doc/Documentation/networking/ip-sysctl.txt.
  • kasperd
    kasperd almost 8 years
    @SanderSteffann That does work. But it looks like with that approach I will have to change it for the default interface because sysctl.conf would be loaded before the ppp0 interface exists. Is there a way to only accept a default route from ppp0 and not from other interfaces?
  • kasperd
    kasperd almost 8 years
    @SanderSteffann I ended up creating a /etc/ppp/ipv6-up.d/default-route script with these two lines #!/bin/sh -e ip route add ::/0 via "$LLREMOTE" dev "$PPP_IFACE". I'm not sure if I should be using PPP_REMOTE or LLREMOTE there, both seems to have the same value.