LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-06-2018, 10:54 AM   #1
netpumber
Member
 
Registered: Sep 2007
Location: In My Box
Distribution: Arch Linux
Posts: 423

Rep: Reputation: 33
IPV6 support for VPN server inside a linux container


Hi.

Today I was given a remote VM that it has only ipv6. So I can only connect to that if I too obtain ipv6 address.

I realized that a VPS that I have has an ipv6 because I can use the command

Code:
ping6 www.iana.org
and get responses.

Now, in that VPS I have set up a VPN server inside an LXC. From that container I cannot use the ping6 command and also, VPN clients obtain only ipv4 addresses. What I want to achieve is to give access to the ipv6 network to the VPN clients. So, in the end, to connect through this VPN to the new VM I mentioned earlier.

Here is how I have configured the host and the container so far:

@HOST:

Code:
 cat /var/lib/lxc/VPN/config 

# Template used to create this container: /usr/share/lxc/templates/lxc-debian
# Parameters passed to the template: -r jessie
# For additional config options, please look at lxc.container.conf(5)
#lxc.network.type = empty
lxc.rootfs = /var/lib/lxc/VPN/rootfs

# Common configuration
lxc.include = /usr/share/lxc/config/debian.common.conf

# Container specific configuration
lxc.mount = /var/lib/lxc/VPN/fstab
lxc.utsname = VPN
lxc.arch = amd64
lxc.autodev = 1
lxc.kmsg = 0
lxc.start.auto = 1

# Network config
lxc.network.type = veth
lxc.network.veth.pair = vethVPN
lxc.network.name = veth0
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e:42:1d:a7
lxc.network.link = br0

## for openvpn
lxc.mount.entry = /dev/net dev/net none bind,create=dir
lxc.cgroup.devices.allow = c 10:200 rwm
Code:
cat /etc/iptables/rules.v4

# Generated by iptables-save v1.4.21 on Thu Jun 28 08:57:47 2018
*filter
:INPUT ACCEPT [17498738:2002935490]
:FORWARD ACCEPT [75677814:64716798763]
:OUTPUT ACCEPT [16825445:2395228038]
COMMIT
# Completed on Thu Jun 28 08:57:47 2018
# Generated by iptables-save v1.4.21 on Thu Jun 28 08:57:47 2018
*nat
:PREROUTING ACCEPT [5:288]
:INPUT ACCEPT [5:288]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -i eth0 -p udp -m udp --dport 1194 -j DNAT --to-destination 192.168.1.2:1194
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
Code:
cat /proc/sys/net/ipv4/ip_forward
1
@ VPN CONTAINER:

Code:
cat /etc/network/interfaces

auto lo
iface lo inet loopback

#auto eth0
#iface eth0 inet dhcp

auto veth0
iface veth0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1

iface veth0 inet6 static
address 5:6:7:8:101:1:1:1
netmask 80
Code:
cat /etc/iptables/rules.v4

# Generated by iptables-save v1.4.21 on Sat Mar 11 19:37:10 2017
*nat
:PREROUTING ACCEPT [3:180]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [1:67]
:POSTROUTING ACCEPT [1:67]
-A POSTROUTING -s 10.8.0.0/24 -o veth0 -j MASQUERADE
COMMIT
Code:
cat /proc/sys/net/ipv4/ip_forward
1
As you can see I tried to assign an ipv6 address to the container (/etc/network/interfaces) but that didn't really work (still no results from ping6 command).

Can someone help/guide me in order to give access to the ipv6 network in both container and vpn clients?

Any idea / hint is welcome.

Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to use IPv6 on my server as public IP via VPN server Mates1774 Linux - Networking 1 03-16-2018 02:52 AM
Multiple VPN clients to VPN server Proxy for technical support using Pi. nicedreams Linux - Networking 6 07-31-2017 06:22 PM
LXer: Inside the Open Container Project: How Docker plans to unite the container market LXer Syndicated Linux News 0 06-23-2015 04:30 AM
(vpn router - file server - other) inside ESXi creatureofthedark Linux - Virtualization and Cloud 2 11-03-2010 03:16 PM
VPN Question Win98->internet->Router->Linux VPN Server->Win2k Server patrickrea Linux - Networking 1 08-10-2004 02:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration