Veth einrichten

Aus xinux.net
Zur Navigation springen Zur Suche springen

brctl installieren

apt-get install bridge-utils

nachschauen, ob das Modul vzethdev geladen ist

lsmod | grep vzeth
vzethdev                8224  0
vzmon                  35164  5 vzethdev,vznetdev,vzrst,vzcpt
vzdev                   3080  4 vzethdev,vznetdev,vzmon,vzdquota

und gegebenenfalls laden

modprobe vzethdev

VE starten

vzctl start 101

veth in eine VE hinzufügen

vzctl set 101 --netif_add eth0 --save

Device Konfigurieren ifconfig veth101.0 0

echo 1 > /proc/sys/net/ipv4/conf/veth101.0/forwarding
echo 1 > /proc/sys/net/ipv4/conf/veth101.0/proxy_arp
echo 1 > /proc/sys/net/ipv4/conf/eth0/forwarding
echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp

VZ entern ...

vzctl enter 101

... und Device Konfigurieren

ifconfig eth0 0
ip addr add 192.168.0.101 dev eth0
ip route add default dev eth0

Route im Host-System eintragen

ip route add 192.168.0.101 dev veth101.0

Bridge-Device hinzufügen

brctl addbr <BRIDGENAME>

Bridge und Device verbinden

brctl addif <BRIDGENAME> veth101.0

Bridge-Device konfigurieren

ifconfig <BRIDGENAME> 0
echo 1 > /proc/sys/net/ipv4/conf/<BRIDGENAME>/forwarding
echo 1 > /proc/sys/net/ipv4/conf/<BRIDGENAME>/proxy_arp

Route eintragen

ip route add <VE-IPADRESSE> dev <BRIDGENAME>