Routingeintrag dauerhaft speichern

  • Hallo,


    ich möchte den folgenden Routingeintrag dauerhaft speichern:

    Code
    route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.0.6 dev eth0


    Kann ich dies mit den beiden folgenden Dateien machen oder gibt es bei der 7025 eine bessere Möglichkeit?



    /etc/rc5.d/S30route

    Bash
    #!/bin/sh
    /etc/init.d/setroute &


    /etc/init.d/setroute

    Code
    /sbin/route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.0.6 dev eth0


    Gruß Ralf

    Two mit SSD, One, 7025-S, 7000-S

  • I think it should be possible to just add the script that contains the extra commands to the /etc/network/if-up.d directory. Then you could also remove the static route when the interface is brought down again by adding the appropriate script to /etc/network/if-down.d.


    Look at the samba scripts for an example.

  • Zitat

    Original von noggie
    I think it should be possible to just add the script that contains the extra commands to the /etc/network/if-up.d directory.
    Then you could also remove the static route when the interface is brought down again by adding the appropriate script to /etc/network/if-down.d.


    Danke, damit funktioniert es.

    Code
    root@dm7025:~# cat /etc/network/if-up.d/02route
    #!/bin/sh
    /etc/init.d/setroute &


    Kann es beim shutdown probleme geben (längere shutdown Zeit?), wenn ich kein script in /etc/network/if-down.d ablege?



    noggie
    ist es ok, wenn ich in deutsch antworte?


    Gruß Ralf

    Two mit SSD, One, 7025-S, 7000-S

  • Zitat

    Originally posted by ralfK
    Kann es beim shutdown probleme geben (längere shutdown Zeit?), wenn ich kein script in /etc/network/if-down.d ablege?


    Don't think so. There might be minor security considerations, but I can't think of anything serious.

    Zitat


    noggie
    ist es ok, wenn ich in deutsch antworte?


    Sure. I understand a little German, but unfortunately it takes me forever when I try to write it myself...