Find the answer to your Linux question:
Results 1 to 2 of 2
Hello! (CentOS server) How can I create a script will run the following command: # sysctl-w Net.ipv4.ip_forward = 1 - I need the script to work automatically between the hours: ...
  1. #1
    Just Joined!
    Join Date
    Nov 2009
    Posts
    18

    Enable IP Forwarding on the fly

    Hello! (CentOS server)

    How can I create a script will run the following command:
    # sysctl-w Net.ipv4.ip_forward = 1

    - I need the script to work automatically between the hours: 3:00 to 6:00 at night.

    Meanwhile I run the script manually at night with my computer:

    sysctl-w Net.ipv4.ip_forward = 0;
    sleep 2;
    sysctl-w Net.ipv4.ip_forward = 1;
    sleep 1200;
    sh Xxx.sh;

    So what do you say?
    How to solve the problem?
    How can I run the script without any software? (SSH)

    Thank you.

  2. #2
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    I say you use the crontab to execute the commands at the given times.
    Debian GNU/Linux -- You know you want it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...