Changes between Version 4 and Version 5 of Linux/KvmQemuEasyRoutedNetwork


Ignore:
Timestamp:
06/02/09 22:48:44 (9 years ago)
Author:
tj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Linux/KvmQemuEasyRoutedNetwork

    v4 v5  
    1212Add an alias to the physical network interface that connects to ''upstream'' (whether that be the wider LAN, or WAN/Internet). Use some environment variables to make this process easily scriptable: 
    1313{{{ 
    14 WAN_IF=eth0 
    15 VMNET_GATEWAY_IF=eth0:0 
    16 VMNET_GATEWAY_IP=10.254.254.1 
    17 VMNET_NETMASK=255.255.255.0 
    18 VMNET_BROADCAST=10.254.254.255 
    19 VMNET_FIRST_GUEST_IP=10.254.254.2 
     14export WAN_IF=eth0 
     15export VMNET_GATEWAY_IF=eth0:0 
     16export VMNET_GATEWAY_IP=10.254.254.1 
     17export VMNET_NETMASK=255.255.255.0 
     18export VMNET_BROADCAST=10.254.254.255 
     19export VMNET_FIRST_GUEST_IP=10.254.254.2 
     20# set to 0 to disable; 1 to enable 
     21export PROXY_ARP=1 
     22 
    2023}}} 
    2124=== Create a New Interface Alias === 
     
    3033}}} 
    3134=== Enable ARP Proxy === 
    32 Optionally, if you need to 'hide' the MAC (Media Access Control) address(es) of the VM guest(s) from the rest of the network, enable the ARP (Address Resolution Protocol) proxy on the host and VMNET_GATEWAY interfaces: 
     35Optionally, if you need to 'hide' the MAC (Media Access Control) address(es) of the VM guest(s) from the rest of the network, enable the ARP (Address Resolution Protocol) proxy on the host and later, on each tap interface: 
    3336{{{ 
    34 sudo sh -c "echo 1 > /proc/sys/net/ipv4/conf/${WAN_IF}/proxy_arp" 
    35 sudo sh -c "echo 1 > /proc/sys/net/ipv4/conf/${VMNET_GATEWAY_IF}/proxy_arp" 
     37sudo sh -c "echo $PROXY_ARP > /proc/sys/net/ipv4/conf/${WAN_IF}/proxy_arp" 
    3638}}} 
    3739 
    38 === Create tap Interface === 
     40=== Create tap Interfaces === 
    3941Each simultaneous VM guest requires its own tap interface: 
    4042{{{ 
     
    4951 # start the interface 
    5052 sudo /sbin/ip link set tap${IF} up 
     53 # configure proxy_arp according to the environment variable setting 
     54 sudo sh -c "echo $PROXY_ARP > /proc/sys/net/ipv4/conf/tap${IF}/proxy_arp" 
    5155 # route packets destined for the VM guest's IP address to this interface 
    5256 sudo /sbin/ip route add unicast $IP dev tap${IF}