ia64/xen-unstable

changeset 7748:08f0066158c3

Updates comments in network-bridge, removes dead code, minor typo fixes.
Signed-off-by: Nivedita Singhvi <niv@us.ibm.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Nov 10 11:53:51 2005 +0100 (2005-11-10)
parents 8a5dca8c1e8f
children b8eaf192bad7
files tools/examples/network-bridge
line diff
     1.1 --- a/tools/examples/network-bridge	Thu Nov 10 11:43:26 2005 +0100
     1.2 +++ b/tools/examples/network-bridge	Thu Nov 10 11:53:51 2005 +0100
     1.3 @@ -16,7 +16,7 @@
     1.4  #
     1.5  # Usage:
     1.6  #
     1.7 -# network (start|stop|status) {VAR=VAL}*
     1.8 +# network-bridge (start|stop|status) {VAR=VAL}*
     1.9  #
    1.10  # Vars:
    1.11  #
    1.12 @@ -27,18 +27,27 @@
    1.13  # netdev     The interface to add to the bridge (default eth${vifnum}).
    1.14  # antispoof  Whether to use iptables to prevent spoofing (default no).
    1.15  #
    1.16 +# Internal Vars:
    1.17 +# pdev="p${netdev}"
    1.18 +# vdev="veth${vifnum}"
    1.19 +# vif0="vif0.${vifnum}"
    1.20 +#
    1.21  # start:
    1.22 -# Creates the bridge and enslaves netdev to it.
    1.23 -# Copies the IP addresses from netdev to the bridge.
    1.24 -# Deletes the routes to netdev and adds them on bridge.
    1.25 +# Creates the bridge
    1.26 +# Copies the IP and MAC addresses from netdev to vdev
    1.27 +# Renames netdev to be pdev 
    1.28 +# Renames vdev to be netdev 
    1.29 +# Enslaves pdev, vdev to bridge
    1.30  #
    1.31  # stop:
    1.32 -# Removes netdev from the bridge.
    1.33 -# Deletes the routes to bridge and adds them to netdev.
    1.34 +# Removes netdev from the bridge
    1.35 +# Transfers addresses, routes from netdev to pdev
    1.36 +# Renames netdev to vdev
    1.37 +# Renames pdev to netdev 
    1.38 +# Deletes bridge
    1.39  #
    1.40  # status:
    1.41 -# Print ifconfig for netdev and bridge.
    1.42 -# Print routes.
    1.43 +# Print addresses, interfaces, routes
    1.44  #
    1.45  #============================================================================
    1.46  
    1.47 @@ -97,7 +106,7 @@ s/inet/ip addr add/
    1.48  s@\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+/[0-9]\+\)@\1@
    1.49  s/${src}/dev ${dst}/
    1.50  " | sh -e
    1.51 -    # Remove automatic routes on destionation device
    1.52 +    # Remove automatic routes on destination device
    1.53      ip route list | sed -ne "
    1.54  /dev ${dst}\( \|$\)/ {
    1.55    s/^/ip route del /
    1.56 @@ -105,17 +114,6 @@ s/${src}/dev ${dst}/
    1.57  }" | sh -e
    1.58  }
    1.59  
    1.60 -# Usage: del_addrs src
    1.61 -del_addrs () {
    1.62 -    local src=$1
    1.63 -    ip addr show dev ${src} | egrep '^ *inet ' | sed -e "
    1.64 -s/inet/ip addr del/
    1.65 -s@\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)/[0-9]\+@\1@
    1.66 -s/${src}/dev ${src}/
    1.67 -" | sh -e
    1.68 -    ip link set dev ${dst} up
    1.69 -}
    1.70 -
    1.71  # Usage: transfer_routes src dst
    1.72  # Get all IP routes to device $src, delete them, and
    1.73  # add the same routes to device $dst.