OpenVZ Forum


Home » Mailing lists » Users » Using veth on debian
Using veth on debian [message #10854] Mon, 05 March 2007 18:02
Nils Domrose is currently offline  Nils Domrose
Messages: 6
Registered: March 2007
Junior Member
Hi all,

today i need setup a Virtual Server with a veth device since a
commercial Software required a Mac Address for the license.

I think that it won't be the lasttime that we require such a setup
(unfortunately), therfore I put some more effort into the scripts and
added information to the wiki.

http://wiki.openvz.org/Virtual_Ethernet_device


I basicaly change the vznetaddroute script mentioned in the wiki:

#!/bin/bash

VZCONFDIR=/etc/vz
VZHOSTIF=$BASH_ARGV

. $VZCONFDIR/conf/$VEID.conf

if [ -n $VETH_IP_ADDRESS ]; then
echo "Adding interface $VZHOSTIF and route $VETH_IP_ADDRESS
for VE$VEID to VE0"
/sbin/ifconfig $VZHOSTIF 0
echo 1 > /proc/sys/net/ipv4/conf/$VZHOSTIF/proxy_arp
echo 1 > /proc/sys/net/ipv4/conf/$VZHOSTIF/forwarding
/sbin/ip route add $VETH_IP_ADDRESS dev $VZHOSTIF
else
echo "found no VETH_IP_ADDRESS in $VZCONFDIR/conf/$VEID.conf!"
exit 1;
fi
exit

with this little script one is finaly able to just apply changes to
the VE's config file by adding a VETH_IP_ADDRESS variable including
the desired IP Address, the rest is done by the script.

I decided to not include the sysctl / proc settings for forwarding
and proxy arp into this script since I prefere the /etc/networks/
interfaces way.


e.g.

auto eth0
iface eth0 inet static
address 10.1.1.1
netmask 255.255.255.0
network 10.1.1.0
broadcast 10.1.1.255
gateway 10.215.1.254
dns-nameservers 10.215.1.20
dns-search prod.your.domain
up sysctl -w net.ipv4.conf.eth0.proxy_arp=1
up sysctl -w net.ipv4.conf.eth0.forwarding=1




Hope this helps someone ;-)


Nils Domrose
 
Read Message
Previous Topic: openvz issues.
Next Topic: [Devel] 2.6.18-ovz028test015 and 2.6.18-ovz028test018 break IPv6
Goto Forum:
  


Current Time: Sun Sep 29 23:07:00 GMT 2024

Total time taken to generate the page: 0.03889 seconds