ia64/xen-unstable

changeset 5271:bd5698b07fb8

bitkeeper revision 1.1637 (429efe55wJJIZHFiBeWAvMfzBaNppw)

network:
- remove route added by setting addr/netmask on new interface
- do exact match on interface names (eth0 matches veth0 otherwise)
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Thu Jun 02 12:40:53 2005 +0000 (2005-06-02)
parents d431df247b8a
children cefe173ea09b d823045eab51
files tools/examples/network
line diff
     1.1 --- a/tools/examples/network	Thu Jun 02 10:01:09 2005 +0000
     1.2 +++ b/tools/examples/network	Thu Jun 02 12:40:53 2005 +0000
     1.3 @@ -72,6 +72,12 @@ s/inet/ip addr add/
     1.4  s@\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+/[0-9]\+\)@\1@
     1.5  s/${src}/dev ${dst}/
     1.6  " | sh -e
     1.7 +    # Remove automatic routes on destionation device
     1.8 +    ip route list | sed -ne "
     1.9 +/dev ${dst}\( \|$\)/ {
    1.10 +  s/^/ip route del /
    1.11 +  p
    1.12 +}" | sh -e
    1.13  }
    1.14  
    1.15  # Usage: del_addrs src
    1.16 @@ -95,16 +101,17 @@ transfer_routes () {
    1.17      # List all routes and grep the ones with $src in.
    1.18      # Stick 'ip route del' on the front to delete.
    1.19      # Change $src to $dst and use 'ip route add' to add.
    1.20 -    ip route list | grep ${src} | sed -e "
    1.21 -h
    1.22 -s/^/ip route del /
    1.23 -P
    1.24 -g
    1.25 -s/${src}/${dst}/
    1.26 -s/^/ip route add /
    1.27 -P
    1.28 -d
    1.29 -" | sh -e
    1.30 +    ip route list | sed -ne "
    1.31 +/dev ${src}\( \|$\)/ {
    1.32 +  h
    1.33 +  s/^/ip route del /
    1.34 +  P
    1.35 +  g
    1.36 +  s/${src}/${dst}/
    1.37 +  s/^/ip route add /
    1.38 +  P
    1.39 +  d
    1.40 +}" | sh -e
    1.41  }
    1.42  
    1.43  # Usage: create_bridge bridge