enable ipv6 #12

Closed
opened 2023-12-01 15:05:52 +00:00 by earl-warren · 2 comments
Owner

Unfortunately IPv6 is not enabled by default in LXC containers even when the host is IPv6 capable.

$ curl -s -o /dev/null http://ipv6.google.com
$ echo $?
0
$ lxc-helpers.sh lxc_container_create mytest
$ lxc-helpers.sh lxc_container_start mytest
$ lxc-helpers.sh lxc_container_run mytest bash
root@mytest:/# apt-get update ; apt-get install curl  
root@mytest:/# curl -s -o /dev/null http://ipv6.google.com
root@mytest:/# echo $?
7
root@mytest:/# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0@if11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 00:16:3e:cd:6e:17 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 10.0.3.76/24 brd 10.0.3.255 scope global dynamic eth0
       valid_lft 3516sec preferred_lft 3516sec
    inet6 fe80::216:3eff:fecd:6e17/64 scope link 
       valid_lft forever preferred_lft forever

See also forgejo/runner#119

Unfortunately IPv6 is not enabled by default in LXC containers even when the host is IPv6 capable. ```sh $ curl -s -o /dev/null http://ipv6.google.com $ echo $? 0 $ lxc-helpers.sh lxc_container_create mytest $ lxc-helpers.sh lxc_container_start mytest $ lxc-helpers.sh lxc_container_run mytest bash root@mytest:/# apt-get update ; apt-get install curl root@mytest:/# curl -s -o /dev/null http://ipv6.google.com root@mytest:/# echo $? 7 root@mytest:/# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0@if11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 00:16:3e:cd:6e:17 brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet 10.0.3.76/24 brd 10.0.3.255 scope global dynamic eth0 valid_lft 3516sec preferred_lft 3516sec inet6 fe80::216:3eff:fecd:6e17/64 scope link valid_lft forever preferred_lft forever ``` --- See also https://code.forgejo.org/forgejo/runner/issues/119
Author
Owner

@s3lph FYI

@s3lph FYI
Author
Owner

To test the addition of IPv6 is a chicken-and-egg kind of problem. I created an additional runner for this repository, acting in place of the k8s runner and manually enabled IPv6 in LXC so it can run the workflow that will check it is able to do it itself. In /etc/default/lxc-net:

LXC_IPV6_ADDR="fc14::216:3eff:fe00:1"
LXC_IPV6_MASK="64"
LXC_IPV6_NETWORK="fc14::/64"
LXC_IPV6_NAT="true"
To test the addition of IPv6 is a chicken-and-egg kind of problem. I created an additional runner for this repository, acting in place of the `k8s` runner and manually enabled IPv6 in LXC so it can run the workflow that will check it is able to do it itself. In `/etc/default/lxc-net`: ``` LXC_IPV6_ADDR="fc14::216:3eff:fe00:1" LXC_IPV6_MASK="64" LXC_IPV6_NETWORK="fc14::/64" LXC_IPV6_NAT="true" ```
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference: forgejo/lxc-helpers#12
No description provided.