Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Enabled support for ipv6. Plus feature of multiple ips for macvlans. #94

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pamidur
Copy link

@pamidur pamidur commented Oct 24, 2019

IPV6

This PR removes limitations that prevents ipv6 usage.
With this changes user can run cache with ipv6 support.

In case no macvlan is setup but docker is configured for ipv6 support

sudo docker run -d \
        -e UPSTREAM_DNS="[fd01::1]:6453" \
        lancachenet/monolithic:latest

In case macvlan (name publan) network is setup

sudo docker run -d \
        -e UPSTREAM_DNS="[fd01::1]:6453" \
        --ip6=fd01::c:1 \
        --net=publan \
        lancachenet/monolithic:latest

Note, how to setup UPSTREAM_DNS ip (+ optional port) properly.
Ipv6 : [fd01::1]:6453 [fd01::2]
Ipv4 : 8.8.8.8 1.1.1.1:53
mixed : 8.8.8.8 [fd01::1]:6453

ADDITIONAL IPS

This feature requires macvlan to be setup and the container to be granted NET_ADMIN capability.

Since when using macvlan only one external IP can be set (one ipv4 + one ipv6) , this feature makes container to use additional IPs.

Assuming macvlan is set like this:

 sudo docker network create -d macvlan \
	 --subnet=fd01::/64 \
	 --subnet=192.168.1.0/24 \
	 --ip-range=192.168.1.192/28 \
	 --ipv6 \
	 -o parent=eth0 publan  

User can run the container like this:

sudo docker run -d \
        -e ADDITIONAL_IPS="fd01::c:2/64 fd01::c:3/64 192.168.1.202/24 192.168.1.203/24" \
        --ip6=fd01::c:1 \
        --ip=192.168.1.201 \
        --net=publan \
        --cap-add=NET_ADMIN \
        lancachenet/monolithic:latest

TEST

You can get images for testing here: https://hub.docker.com/r/pamidur/lancache/tags

@pamidur
Copy link
Author

pamidur commented Oct 24, 2019

When setup in my lan together with lancache-dns-ipv6:

PS> nslookup content1.steampowered.com
Server:  router
Address:  fd01::1

Non-authoritative answer:
Name:    steam.cache.lancache.net
Addresses:  fd01::c:6
          fd01::c:7
          fd01::c:8
          fd01::c:9
          fd01::c:a
          fd01::c:1
          fd01::c:2
          fd01::c:3
          fd01::c:4
          fd01::c:5
Aliases:  content1.steampowered.com
PS> ping  fd01::c:1

Pinging fd01::c:1 with 32 bytes of data:
Reply from fd01::c:1: time=2ms
Reply from fd01::c:1: time=1ms
Reply from fd01::c:1: time=2ms
Reply from fd01::c:1: time=1ms

PS> ping  fd01::c:2

Pinging fd01::c:2 with 32 bytes of data:
Reply from fd01::c:2: time=1ms
Reply from fd01::c:2: time=3ms
Reply from fd01::c:2: time=2ms
Reply from fd01::c:2: time=1ms

Download speeds are good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants