Vorbereitung  

IP- Forwarding auf dem Hostsystem aktivieren

sysctl -w net.ipv4.ip_forward=1
sysctl -w net.ipv6.conf.all.forwarding=1

Bei Fritzbox notwendig

sysctl -w net.ipv4.conf.eth0.proxy_arp=1

Superuser für Linux Remote

adduser myuser

nano /etc/sudoers

myuser ALL=(ALL:ALL) NOPASSWD: ALL

Linux Container installieren  

Linux Container installieren

sudo apt-get update

sudo apt-get install lxc debootstrap bridge-utils

 

sudo nano /etc/fstab 

cgroup /sys/fs/cgroup cgroup defaults 0 0

Cgroup mounten

sudo mount cgroup -t cgroup /sys/fs/cgroup

Konfiguration testen

lxc-checkconfig

Installation Debian

aptitude install bridge-utils libvirt-bin debootstrap

Localhost Server Fritz config  

nano /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static

address 192.168.178.100
netmask 255.255.255.0
gateway 192.168.178.1
pointopoint 192.168.178.1
dns-nameservers 192.168.178.1
 
auto br0
iface br0 inet static
address 192.168.178.100
netmask 255.255.255.255
bridge_stp off
bridge_ports none
bridge_fd 0
bridge_maxwait 0
 
up ip route add 192.168.178.101 dev br0
up ip route add 192.168.178.102 dev br0
up ip route add 192.168.178.103 dev br0
up ip route add 192.168.178.104 dev br0
up ip route add 192.168.178.105 dev br0

Neuen Container erstellen  

lxc-create  -n vserver1  -download

Linux Version auswählen

... wird installiert

starten mit

lxc-start -n vserver1

login mit

lxc-attach -n vserver1

Localhost Client Fritz config  

nano /etc/network/interfaces

auto lo 
iface lo inet loopback  
auto eth0 
iface eth0 inet static 
address 192.168.178.101
netmask 255.255.255.255 
gateway 192.168.178.100
pointopoint 192.168.178.100
dns-nameservers 8.8.8.8

Netwerkkarte umbenennen ( optional )  

sudo nano /etc/udev/rules.d/10-network.rules

SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:00:00:00:00:00",KERNEL=="kartenname", NAME="eth0"