From: Heiko Z. <he...@zu...> - 2010-09-05 19:08:56
|
Yes that would make sense. H. > -----Original Message----- > From: Serge Leschinsky [mailto:ser...@gm...] > Sent: Sunday, September 05, 2010 1:29 PM > To: dev...@li... > Subject: Re: [Devil-linux-develop] network configuration script - add > routes > > Hi Heiko, > > you are right. The code below converts "old style" routes to "new style" > and prints new ROUTE without modification. Can we use it as a template > for upgrade script? > > > # cat ./test > ######### Possible route configuration ######### # OLD ROUTES > > ROUTE="$ROUTE 192.168.254.0/255.255.255.0:10.90.1.252" > ROUTE="$ROUTE 192.168.3.0:10.90.1.252" > ROUTE="$ROUTE default/0:10.90.1.1" > > ROUTE="$ROUTE 192.168.3.0/255.255.255.0" > ROUTE="$ROUTE 192.168.5.7" > > # NEW ROUTES > > ROUTE="192.168.254.X/255.255.255.0 via 10.90.1.252 " > ROUTE="192.168.3.X via 10.90.1.252 " > ROUTE="default via 10.90.1.X " > ROUTE="192.168.3.X/255.255.255.0 dev $DEVICE" > ROUTE="192.168.5.X dev $DEVICE" > > ############################################### > grep "^ROUTE=" ./$0 | while read line; > do > unset ROUTE net gw > eval $line > > if echo $ROUTE | grep "via\|dev" > /dev/null 2>&1; then echo $line; > continue ; fi > > if echo $ROUTE | grep ":" > /dev/null 2>&1; then > net=$(echo $ROUTE | cut -d':' -f1) > gw=$(echo $ROUTE | cut -d':' -f2) > else > net=$(echo $ROUTE) # to remove spaces > fi > > #echo $net $gw $dev > > # fixes > if echo $net | grep default > /dev/null 2>&1; then > net="default"; > fi > > if [ x"$gw" == "x" ]; then > dev="dev \$DEVICE"; > else > gw="via $gw"; > fi > > echo "ROUTE=\"$net $gw $dev\"" > > done > > > On 09/05/2010 08:59 AM, Heiko Zuerker wrote: > > Hey, > > > > Seems like we need to update the upgrade script, to set the routes > > correctly. > > I just updated all my VMs and I had to fix the default route > everywhere. > > > > Heiko > > > >> -----Original Message----- > >> From: Serge Leschinsky [mailto:ser...@gm...] > >> Sent: Monday, August 30, 2010 3:08 PM > >> To: dev...@li... > >> Subject: Re: [Devil-linux-develop] network configuration script - add > >> routes > >> > >> Done. > >> > >> Serge > >> > >> On 08/30/2010 08:32 AM, Heiko Zuerker wrote: > >>> Seems good to me. > >>> Let's get it in CVS so we can have more testers. > >>> I'm still working on updating all the software packages Alby > >>> mentioned, including a couple of fixes to the script he provided. > >>> > >>> Heiko > >>> > >>> Quoting Serge Leschinsky <ser...@gm...>: > >>> > >>>> the final final version: > >>>> > >>>> Summary: > >>>> > >>>> - added all types of route > >>>> - added rules > >>>> - added tunnel interface configuration > >>>> > >>>> Serge > >>>> > >>>> > >>>> > > --------------------------------------------------------------------- > >>>> ---- > >>>> cat ifcfg-eth0.sample: > >>>> # > >>>> # example for a "normal" INTERFACE with no VLANs and no > BRIDGING > >> # > >>>> DHCP=no #DHCP=yes #DHCP=server # options passed directly to > >> dhcpcd on > >>>> startup #DHCP_OPTIONS="" > >>>> ONBOOT=yes > >>>> DEVICE=eth0 > >>>> IP=10.90.1.200 > >>>> NETMASK=255.255.255.0 > >>>> #BROADCAST=10.90.1.255 > >>>> #MAC= > >>>> MODULE=pcnet32 > >>>> #MODULE_OPTS= > >>>> # > >>>> > >>>> > >> > ####################################################### > >> # > >>>> # ROUTE=" ...... " > >>>> # where ROUTE is a key word and the line with ROUTE # should not > >> have > >>>> spaces between the beginning of # the line and the keyword # > Route > >>>> statement is a any valid "ip route"# command, # without "ip route > >>>> add" prefix - it will be added # automatically # # IPV6ROUTE="...." > >>>> # IPV6ROUTE keyword can be used for ipv6 routes. > >>>> # > >>>> # RULE=" ...... " > >>>> # where RULE is a key word and the line with RULE # should not > have > >>>> spaces between the beginning of # the line and the keyword # > Rule > >>>> statement is a any valid "ip rule" command, # without "ip rule add" > >>>> prefix - it will be added # automatically # # $DEVICE can be used > > to > >>>> directly specify the interface # ###### samples for several > > possible > >>>> scenarios # # route to network 192.168.254.0/255.255.255.0 via > >>>> gateway 10.90.1.252 > >>>> #ROUTE="192.168.254.0/255.255.255.0 via 10.90.1.252" > >>>> # or > >>>> #ROUTE="192.168.254.0/24 via 10.90.1.252" > >>>> # > >>>> # > >>>> # route to host 192.168.3.1 via 10.90.1.252 > >>>> #ROUTE="192.168.3.0/32 via 10.90.1.252" > >>>> # > >>>> # route to network that is also reachable via this interface > >>>> #ROUTE="192.168.3.0/24 dev $DEVICE" > >>>> # > >>>> > >>>> # special routes > >>>> #ROUTE="unreachable 10.0.0.0/8" > >>>> #ROUTE="blackhole 192.168.1.0/24" > >>>> # > >>>> # add as many ROUTE="...." lines as you need routes # # the next > > line > >>>> shows how to set the default gateway #ROUTE="default via > >> 10.90.1.1". > >>>> # > >>>> ###### advanced routing > >>>> # make sure additional routing table is created # # echo "500 > >>>> bypass" >> /etc/iproute2/rt_tables # #ROUTE="default via > >> 1.234.123.1 > >>>> table bypass" > >>>> #RULE="from 10.0.0.0/24 table bypass prio 500" > >>>> #RULE="from 10.0.1.0/24 table bypass prio 600" > >>>> #RULE="from 10.0.2.123/32 to 10.8.0.0/16 table main prio 400" > >>>> # > >>>> > >>>> > > --------------------------------------------------------------------- > >>>> ---- > >>>> cat ifcfg-tun0.sample: > >>>> # > >>>> # example for a tunnel INTERFACE > >>>> # > >>>> ONBOOT=yes > >>>> TUNNEL=yes > >>>> > >>>> # bind the tunnel to the device DEVICE so that tunneled packets # > >>>> will only be routed via this device and will not be able to escape > > # > >>>> to another device when the route to endpoint changes. > >>>> #DEVICE=eth4 > >>>> > >>>> # set the fixed local address for tunneled packets. > >>>> LOCAL=10.90.1.200 > >>>> > >>>> # set the remote endpoint of the tunnel. > >>>> REMOTE=1.2.3.204 > >>>> > >>>> # Available modes depend on the encapsulating address family. > >>>> # Modes for IPv4 encapsulation available: ipip, sit, isatap and > > gre. > >>>> # Modes for IPv6 encapsulation available: ip6ip6, ipip6 and any. > >>>> MODE=ipip > >>>> > >>>> # addtional tunnel options if any > >>>> TUN_OPTS="" > >>>> > >>>> > >>>> > >>> > >>> > >>> > >> > >> > >> > > ---------------------------------------------------------------------- > > -- > > ------ > >> This SF.net Dev2Dev email is sponsored by: > >> > >> Show off your parallel programming skills. > >> Enter the Intel(R) Threading Challenge 2010. > >> http://p.sf.net/sfu/intel-thread-sfd > >> _______________________________________________ > >> Devil-linux-develop mailing list > >> Dev...@li... > >> https://lists.sourceforge.net/lists/listinfo/devil-linux-develop > > > > > > ---------------------------------------------------------------------- > > -------- This SF.net Dev2Dev email is sponsored by: > > > > Show off your parallel programming skills. > > Enter the Intel(R) Threading Challenge 2010. > > http://p.sf.net/sfu/intel-thread-sfd > > _______________________________________________ > > Devil-linux-develop mailing list > > Dev...@li... > > https://lists.sourceforge.net/lists/listinfo/devil-linux-develop > > > > > ------------------------------------------------------------------------ ------ > This SF.net Dev2Dev email is sponsored by: > > Show off your parallel programming skills. > Enter the Intel(R) Threading Challenge 2010. > http://p.sf.net/sfu/intel-thread-sfd > _______________________________________________ > Devil-linux-develop mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/devil-linux-develop |