|Using veth on debian [message #10854]
||Mon, 05 March 2007 18:02
Registered: March 2007
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.
I basicaly change the vznetaddroute script mentioned in the wiki:
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
echo "found no VETH_IP_ADDRESS in $VZCONFDIR/conf/$VEID.conf!"
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/
iface eth0 inet static
up sysctl -w net.ipv4.conf.eth0.proxy_arp=1
up sysctl -w net.ipv4.conf.eth0.forwarding=1
Hope this helps someone ;-)