]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
- zmiana syntaxy dla routingu statycznego
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Mon, 28 Jun 1999 13:07:45 +0000 (13:07 +0000)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Mon, 28 Jun 1999 13:07:45 +0000 (13:07 +0000)
- if{up,down}-tnl -> tnl{up,down}
- poprawki dotyczące PREFIX
- tunnels-ip6.init, ifdhcpc-done - zbędne (zastąpione przez inne narzędzia)

svn-id: @392

doc/sysconfig.txt
rc.d/init.d/functions.network
rc.d/init.d/network
rc.d/init.d/tunnels-ip6.init [deleted file]
src/ipcalc.c
sysconfig/network-scripts/ifdhcpc-done [deleted file]
sysconfig/network-scripts/ifup
sysconfig/network-scripts/ifup-routes
sysconfig/network-scripts/tnldown [moved from sysconfig/network-scripts/ifdown-tnl with 100% similarity]
sysconfig/network-scripts/tnlup [moved from sysconfig/network-scripts/ifup-tnl with 100% similarity]
sysconfig/static-nat [new file with mode: 0644]

index 646b642067a28e7f36ab096d4a1469c70eaad8bd..95eff0fe8cecc8912bb0304d939f6b2fe1981fe4 100644 (file)
@@ -62,15 +62,40 @@ Files in /etc/sysconfig
 
   All the IPX stuff is optional, and should default to off.
 
+/etc/sysconfig/static-nat
+
+  Configuration file for static Network Address Translation (NAT).
+  Contains lines of the form:
+
+    <address> via <addressreal>
+
+  NAT will translate address <address> to <addressreal>.
+
 /etc/sysconfig/static-routes:
 
   Contains lines of the form:
 
-    <device> net <network> netmask <netmask> gw <gateway>
+    <device> to [type] <network>/<prefix> via <gateway>
 
   <device> may be a device name to have the route brought up and
   down with the device, or "any" to have the correct devices calculated
-  at run time.
+  at run time. [type] is optional. RH style isn't supported !
+
+  Also you can set few options after "<gateway>":
+    tos <tos>
+    metric <number>
+    table <table>
+    src <address>
+    realm <realmid>
+    mtu <mtu> or mtu lock <mtu>
+    window <number>
+    rtt <number>
+    nexthop <nexthop>
+    scope <scope>
+    protocol <rtproto>
+    onlink
+    equalize
+  For more informations see iproute2 documentation .
 
 /etc/sysconfig/routed:
 
index f725888925ec6bd74f7f4d2c75f48651c64e37a8..8e8b99c184f16da461933ada1eefc086c624dd84 100755 (executable)
@@ -324,6 +324,7 @@ local OISF len olen bad prefix
 #
 calcnetmask() {
 local prefix a
+MASK=""
 prefix=$[ $1 ]
 for i in 1 2 3 4
  do
index 23d3f3cd9820395c1bef75dba4a5725677463186..7fdb07c13cae38e210da671e57af6f5bb99a58d0 100644 (file)
@@ -43,12 +43,16 @@ network_deinit()
 
 }
 
-interfaces="`cd /etc/sysconfig/interfaces && ls -1 ifcfg-* | grep -v ifcfg-lo | xargs 2> /dev/null`"tunnels="`cd /etc/sysconfig/interfaces && ls -1 tnlcfg-* | xargs 2> /dev/null`"
+interfaces="`cd /etc/sysconfig/interfaces && ls -1 ifcfg-* | grep -v ifcfg-lo | xargs 2> /dev/null`"
+tunnels="`cd /etc/sysconfig/interfaces && ls -1 tnlcfg-* | xargs 2> /dev/null`"
 
 # See how we were called.
 case "$1" in
   start)
        network_init
+        for i in $tunnels do
+                [ -f /etc/sysconfig/interfaces/$i ] && /sbin/tnlup $i boot
+        done
        for i in $interfaces; do
                [ -f $i ] && /sbin/ifup $i boot
        done
@@ -58,6 +62,9 @@ case "$1" in
        for i in $interfaces; do
                [ -f $i ] && /sbin/ifdown $i boot
        done
+        for i in $tunnels do
+                [ -f /etc/sysconfig/interfaces/$i ] && /sbin/tnldown $i boot
+        done
        network_deinit
         rm -f /var/lock/subsys/network
         ;;
diff --git a/rc.d/init.d/tunnels-ip6.init b/rc.d/init.d/tunnels-ip6.init
deleted file mode 100755 (executable)
index 712c877..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/bin/sh
-#
-# /etc/rc.d/init.d/tunnels-ip6.init
-#
-# based on 
-##     network       Bring up/down networking
-##
-##     Modified:       Ngo Than
-##     Date:           07.04.1998
-######################################################################
-##     Modified: Erik Heim <erik@seitz.de>
-##     Date    : 19.3.98
-##     Reason  : for startup
-#####################################################################
-
-# and based on my
-#      /etc/rc.d/init.d/tunnels-ip6.init
-#      Version 1.03
-#
-# Starts and stops the IPv6 over IPv4 tunnels
-#
-# Copyright 1997-1998 Peter Bieringer <pb@bieringer.de>
-#
-# Version 1.12 07.08.1998
-#
-# Changes to
-#  1.10: Merge into DLD 5.4
-#  1.11: Updates for dual usage (DLD 5.4 or another RedHat compatible system)
-#  1.12: Bugfix, don't used the switch from network-ip6
-
-subsys_parameter=$1
-LOCKDIR=/var/lock/subsys
-##################################################################
-start_and_stop() {
-       # Source function library.
-       [ ! -f /etc/rc.d/init.d/functions ] && exit 1
-       . /etc/rc.d/init.d/functions
-       
-    # If some used functions were not defined until now...
-    # At the moment, only Delix DLD 5.4 supports them directly
-       
-       if ! print_message >/dev/null 2>&1; then
-           print_message () {
-               $0 ${subsys_parameter}_msg
-           }
-       fi
-
-       if ! check_lock >/dev/null 2>&1; then
-           check_lock() {
-               local LOCK_FAIL
-               if [ $# = 0 ]; then
-                   echo "check_lock Lockfile start|stop"
-                   return 2
-               fi
-               LOCK_FAIL=0
-               if [ -f "$1" -a "$2" = "stop" ]; then LOCK_FAIL=1 ; fi
-               if [ ! -f "$1" -a "$2" = "start" ]; then LOCK_FAIL=1 ; fi
-               echo
-               return $LOCK_FAIL
-           }
-       fi
-
-       if ! logexec >/dev/null 2>&1; then
-           logexec() {
-               $*
-           }
-       fi
-
-    # End of defines
-       
-       [ ! -f /etc/sysconfig/network ] && exit 1
-       . /etc/sysconfig/network
-       # Check that networking is up.
-       [ "$NETWORKING" = "yes" ] || exit 2
-       
-       [ -x /sbin/ifconfig ] || exit 1
-       print_message
-       
-    check_lock $LOCKDIR/tunnels-ip6.init "$subsys_parameter"
-       if [ "$?" = 0 ]; then exit 0 ; fi
-
-
-        [ ! -f /etc/rc.d/init.d/functions-ip6 ] && exit 1
-       . /etc/rc.d/init.d/functions-ip6
-       
-       test-ip6 || exit 
-       
-       [ "$IP6TUNNELCONFIG" = "yes" ] || exit 2
-}
-
-##################################################################
-# See how we were called.
-##################################################################
-case "$subsys_parameter" in
-  start_msg)
-       echo -n "Start IPv6-over-IPv4-Tunnel(s)."
-        ;;
-  stop_msg)
-       echo -n "Stop IPv6-over-IPv4-Tunnel(s)."
-       ;;
-  start)
-        start_and_stop
-       
-       logexec tunnels-up-ip6
-       
-        logexec touch $LOCKDIR/tunnels-ip6.init
-       
-        exit $FAIL
-        ;;
-  stop)
-        start_and_stop
-       
-       logexec tunnels-down-ip6
-       
-        logexec rm -f $LOCKDIR/tunnels-ip6.init
-       
-        exit $FAIL
-        ;;
-  restart)
-       $0 stop
-       $0 start
-       exit $?
-       ;;
-  *)
-       echo "Usage: tunnels-ip6.init {start|stop|restart|start_msg|stop_msg}"
-       exit 1
-        ;;
-esac
-
-exit 0
-
index 03d08cc1b57c8e7ac27eff3101fc67ca3441a400..891b4bebf053a42ddaacf601897deb7c87ef393e 100644 (file)
@@ -8,7 +8,7 @@
 typedef unsigned int int32;
 
 int main(int argc, char ** argv) {
-    int showBroadcast = 0, showNetwork = 0, showHostname = 0, showNetmask = 0, showShortNetmask = 0;
+    int showBroadcast = 0, showNetwork = 0, showHostname = 0, showNetmask = 0, showPrefix = 0;
     int beSilent = 0;
     int rc;
     poptContext optCon;
diff --git a/sysconfig/network-scripts/ifdhcpc-done b/sysconfig/network-scripts/ifdhcpc-done
deleted file mode 100755 (executable)
index 5444f10..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-SLEEPPIDFILE=/var/run/dhcp-wait-${IFNAME}.pid
-
-if [ ! -f $SLEEPPIDFILE ]; then
-    # the parent must have timed out already -- we can't do much about
-    # it now
-    echo "DHCP configured but ifup timed out"
-    #exit 0
-fi
-
-# get the pid of the process which is waiting for this to complete
-SLEEPPID=`cat $SLEEPPIDFILE`
-rm -f $SLEEPPIDFILE
-kill $SLEEPPID
-
-if [ -f /etc/dhcpc/resolv.conf ]; then
-       cp /etc/dhcpc/resolv.conf /etc
-fi
index 5e697d02efb0c5617386d8aaeb8e9544e5ae2503..b4c2dd034782774c644016ec5a3e062f7e7cce5c 100755 (executable)
@@ -106,7 +106,7 @@ fi
 
 if [ "$IPSETUP" != yes ]; then
     if [ -z "$PREFIX" ]; then
-       eval `/bin/ipcalc --short-netmask ${IPADDR}`
+       eval `/bin/ipcalc --prefix ${IPADDR}`
     fi
 
     if [ -z "$BROADCAST" ]; then
index eb4094ca42ad23aeb9527dc00429cfbd737fc300..56de007953e8bdf08536a7adffbb846a8d5ce9b1 100755 (executable)
@@ -12,5 +12,5 @@ if [ ! -f /etc/sysconfig/static-routes ]; then
 fi
 #note the trailing space in the grep gets rid of aliases
 grep "^$1 " /etc/sysconfig/static-routes | while read device args; do
-    /sbin/route add -$args $device
+    /sbin/ip route add $args dev $device
 done
diff --git a/sysconfig/static-nat b/sysconfig/static-nat
new file mode 100644 (file)
index 0000000..e69de29
This page took 0.9865 seconds and 4 git commands to generate.