6,534
edits
Changes
m
1. ==== Start a VE====
2. ==== Add veth device to VE====
3. ==== Configure devices in VE0====
4. ==== Configure device in VE====
5. ==== Add route in [[VE0]] ====
Reformatted →Simple configuration with virtual ethernet device
=== Simple configuration with virtual ethernet device ===
<pre>
[host-node] # vzctl start 101
</pre>
<pre>
[host-node] # vzctl set 101 --veth_add veth101.0,00:12:34:56:78:9A,eth0,00:12:34:56:78:9B --save
</pre>
<pre>
[host-node] # ifconfig veth101.0 up[host-node] # echo 1 > /proc/sys/net/ipv4/conf/veth101.0/forwarding[host-node] # echo 1 > /proc/sys/net/ipv4/conf/veth101.0/proxy_arp[host-node] # echo 1 > /proc/sys/net/ipv4/conf/eth0/forwarding[host-node] # echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp
</pre>
<pre>
[host-node] # vzctl enter 101[ve-101] # /sbin/ifconfig eth0 up[ve-101] # /sbin/ip addr add 192.168.0.101 dev eth0[ve-101] # /sbin/ip ro route add default dev eth0
</pre>
<pre>
[host-node] # ip ro route add 192.168.0.101 dev veth101.0
</pre>