Changes

Jump to: navigation, search

Virtual Ethernet device

No change in size, 11:46, 11 March 2008
m
Robot: Automated text replacement (-VE0 +CT0)
including IPs, gateways etc.
Virtual ethernet device consist of two ethernet devices - one in [[VE0CT0]] and another one
in VE. These devices are connected to each other, so if a packet goes to one
device it will come out from the other device.
Here
* <tt>dev_name</tt> is the ethernet device name that you are creating on the [[VE0CT0|host system]]
* <tt>dev_addr</tt> is its MAC address
* <tt>ve_dev_name</tt> is the corresponding ethernet device name you are creating on the VE
* <tt>ifname</tt> is the ethernet device name in the VE
* <tt>mac</tt> is its MAC address in the VE
* <tt>host_ifname</tt> is the ethernet device name on the host ([[VE0CT0]])* <tt>host_mac</tt> is its MAC address on the host ([[VE0CT0]])
{{Note|All parameters except ifname are optional and are automatically generated if not specified.}}
vzctl set <VEID> --veth_del <dev_name>
</pre>
Here <tt>dev_name</tt> is the ethernet device name in the [[VE0CT0|host system]].
Example:
</pre>
==== Configure devices in VE0 CT0 ====
<pre>
[host-node]# ifconfig veth101.0 0
</pre>
==== Add route in [[VE0CT0]] ====
<pre>
[host-node]# ip route add 192.168.0.101 dev veth101.0
</pre>
==== Configure devices in [[VE0CT0]] ====
<pre>
[host-node]# ifconfig veth101.0 0
</pre>
==== Start router advertisement daemon (radvd) for IPv6 in VE0 CT0 ====
First you need to edit radvd configuration file. Here is a simple example of <tt>/etc/radv.conf</tt>:
<pre>
</pre>
==== Add IPv6 addresses to devices in [[VE0CT0]] ====
<pre>
[host-node]# ip addr add dev veth101.0 3ffe:2400::212:34ff:fe56:789a/64
</pre>
==== Add routes in [[VE0CT0]] ====
<pre>
[host-node]# ip route add 192.168.101.1 dev vzbr0
for IP in $VETH_IP_ADDRESS; do
echo "Adding interface $VZHOSTIF and route $IP for VE$VEID to VE0CT0"
/sbin/ifconfig $VZHOSTIF 0
echo 1 > /proc/sys/net/ipv4/conf/$VZHOSTIF/proxy_arp
#!/bin/bash
# /usr/sbin/vznetaddbr
# a script to add virtual network interfaces (veth's) in a VE to a bridge on VE0CT0
CONFIGFILE=/etc/vz/conf/$VEID.conf
fi
echo "Adding interface $VZHOSTIF to bridge $VZHOSTBR on VE0 CT0 for VE$VEID"
/sbin/ifconfig $VZHOSTIF 0
echo 1 > /proc/sys/net/ipv4/conf/$VZHOSTIF/proxy_arp
2,253
edits

Navigation menu