added remaining steps and examples

This commit is contained in:
ahrenholz 2009-04-06 15:29:22 +00:00
parent 69a476334b
commit b0778e16cd

View file

@ -18,3 +18,18 @@ Example:
# Place a hub or switch node in CORE and link it to the router/PC/host node that you want to connect to the external network. In the example shown here, node n3 is linked to hub n7, and n3 has the IP address 10.0.0.3/24. # Place a hub or switch node in CORE and link it to the router/PC/host node that you want to connect to the external network. In the example shown here, node n3 is linked to hub n7, and n3 has the IP address 10.0.0.3/24.
# Run the emulation. CORE will create a Linux bridge on the host having a name such as 'vzbrn7' if the hub is node 7. # Run the emulation. CORE will create a Linux bridge on the host having a name such as 'vzbrn7' if the hub is node 7.
# Assign an IP address to the bridge. This address should belong to the same IP subnet as the node. In this example, 10.0.0.1/24 is used for the bridge vzbrn7 on the host. # Assign an IP address to the bridge. This address should belong to the same IP subnet as the node. In this example, 10.0.0.1/24 is used for the bridge vzbrn7 on the host.
# Now the container should be able to ping the bridge interface: {{{ vzctl exec 1003 ping 10.0.0.1 }}}
# Determine the interface and IP address of the host on the external network. In this example, the host has eth0 with the public address 123.4.50.6.
# Add a NAT rule: {{{ iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o eth0 -j SNAT --to 123.4.50.6 }}}
# Set the container's nameservers: {{{ cat /etc/resolv.conf > /vz/private/1003/etc/resolv.conf }}}
# Set the container's default route. You may have to delete any existing default route. {{{ vzctl exec 1003 ip ro del default; vzctl exec 1003 ip ro add default via 10.0.0.1 }}}
# Now the container should have NAT access to the outside world. You may now run commands such as {{{ yum }}} from inside the container.
{{{
root@n3# ping www.yahoo.com
PING www.yahoo.com (209.131.36.158) 56(84) bytes of data.
64 bytes from www.yahoo.com (209.131.36.158): icmp_seq=1 ttl=250 time=0.960 ms
64 bytes from www.yahoo.com (209.131.36.158): icmp_seq=2 ttl=250 time=1.09 ms
64 bytes from www.yahoo.com (209.131.36.158): icmp_seq=3 ttl=250 time=1.00 ms
64 bytes from www.yahoo.com (209.131.36.158): icmp_seq=4 ttl=250 time=1.35 ms
}}}