2

I have a pool of public ipv6 address I want to use to expose lxc containers.

On the host machine I created a macvlan interface eth0-macvlan and bound a public address to it 2600:3c01:e000:83::1/64. I then bound the containers eth1 to and address on the same subnet 2600:3c01:e000:83::11/64 I can ping the container address from the host machine, but not the internet. Do I need to add a route? I might be doing this completely wrong.

eth0      Link encap:Ethernet  HWaddr f2:3c:91:6e:25:63
          inet addr:173.230.156.218  Bcast:173.230.156.255  Mask:255.255.255.0
          inet6 addr: fe80::f03c:91ff:fe6e:2563/64 Scope:Link
          inet6 addr: 2600:3c01::f03c:91ff:fe6e:2563/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:955129 errors:0 dropped:0 overruns:0 frame:0
          TX packets:547825 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1369203060 (1.3 GB)  TX bytes:59723654 (59.7 MB)

eth0-macvlan Link encap:Ethernet  HWaddr 1e:dd:2e:bf:86:3a
          inet6 addr: fe80::1cdd:2eff:febf:863a/64 Scope:Link
          inet6 addr: 2600:3c01:e000:83::1/64 Scope:Global
          inet6 addr: 2600:3c01::1cdd:2eff:febf:863a/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3061 errors:0 dropped:0 overruns:0 frame:0
          TX packets:78 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:360888 (360.8 KB)  TX bytes:7069 (7.0 KB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:196 errors:0 dropped:0 overruns:0 frame:0
          TX packets:196 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:24808 (24.8 KB)  TX bytes:24808 (24.8 KB)

lxcbr0    Link encap:Ethernet  HWaddr 06:9d:8f:ec:b6:e1
          inet addr:10.0.3.1  Bcast:10.0.3.255  Mask:255.255.255.0
          inet6 addr: fe80::49d:8fff:feec:b6e1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:648 (648.0 B)

vethDqo9GU Link encap:Ethernet  HWaddr 4e:e4:a8:3d:cf:f5
          inet6 addr: fe80::4ce4:a8ff:fe3d:cff5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:648 (648.0 B)  TX bytes:648 (648.0 B)

LXC container:

eth0      Link encap:Ethernet  HWaddr da:e0:6a:b5:8b:b0
          inet addr:172.17.0.2  Bcast:0.0.0.0  Mask:255.255.0.0
          inet6 addr: fe80::d8e0:6aff:feb5:8bb0/64 Scope:Link
          UP BROADCAST RUNNING  MTU:1500  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:648 (648.0 B)  TX bytes:648 (648.0 B)

eth1      Link encap:Ethernet  HWaddr 8e:29:ed:5d:0a:6d
          inet6 addr: 2600:3c01::8c29:edff:fe5d:a6d/64 Scope:Global
          inet6 addr: fe80::8c29:edff:fe5d:a6d/64 Scope:Link
          inet6 addr: 2600:3c01:e000:83::11/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:68 errors:0 dropped:0 overruns:0 frame:0
          TX packets:38 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:7047 (7.0 KB)  TX bytes:4034 (4.0 KB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

UPDATE Since the original posting I've setup radvd and a bridge interface br0 Here is my radvd.conf

interface eth0 {
MinRtrAdvInterval 3;
MaxRtrAdvInterval 10;
AdvSendAdvert on;
AdvLinkMTU 1480;
# Prefix of what i'm advertising
    prefix 2600:3c01:e000:0083::/64 {
        AdvOnLink on;
        AdvAutonomous on;
        AdvRouterAddr on;
    };
};

interface br0 {
MinRtrAdvInterval 3;
MaxRtrAdvInterval 10;
AdvSendAdvert on;
AdvLinkMTU 1480;
# Prefix of what i'm advertising
    prefix 2600:3c01:e000:0083::/64 {
        AdvOnLink on;
        AdvAutonomous on;
        AdvRouterAddr on;
    };
};

ip -6 r:

HOST:
    2600:3c01::/64 dev eth0  proto kernel  metric 256  expires 2545193sec
    fe80::/64 dev eth0  proto kernel  metric 256
    fe80::/64 dev br0  proto kernel  metric 256
    fe80::/64 dev veth334e  proto kernel  metric 256

CONTAINER:
    2600:3c01:e000:83::/64 dev eth0  proto kernel  metric 256  expires 86395sec
    fe80::/64 dev eth0  proto kernel  metric 256
    default via fe80::f83b:3bff:fef6:3759 dev eth0  proto ra  metric 1024  expires 25sec
6
  • Did you enable IPv6 forwarding on the host machine ?
    – user9517
    Commented Mar 20, 2014 at 6:36
  • @lain I don't think so how can I confirm?
    – kevzettler
    Commented Mar 20, 2014 at 15:32
  • We really value people trying to help themselves here - google is your friend.
    – user9517
    Commented Mar 20, 2014 at 16:15
  • @lain does your definition of 'enable' include configuring radvd or just flipping net.ipv6.conf.default.forwarding=1
    – kevzettler
    Commented Mar 24, 2014 at 21:17
  • please post output of ip -6 r on both machines
    – Zabuzzman
    Commented Mar 31, 2014 at 20:45

2 Answers 2

2

I would expect you to have a different /64 on either side of the server. You will need to configure bridge the interfaces to make the routing work correctly.

Normally, your provider will provide a block of /64 networks for your use. You can then configure these on your internal network, and normal routing will make the addresses available externally. You would run a radvd process to allow hosts to autoconfigure, or manually configure addresses.

WARNING: These IPv6 addresses are globally routable. Access controls need to be considered.

2
+50

When you have a network where you connect IPv6 machines directly to the network, the easiest way to work with virtual machines is to ignore macvlan and use a bridge instead. Your output, while not very useful, includes a bridge probably already. You just need to connect both your ethernet and your veth devices to the bridge and configure it properly so that also the host has connectivity.

Please use ip address instead of ifconfig, especially when advanced networking matters. The output of ifconfig lacks important information.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .