# Edit this file to introduce tasks to be run by cron. # # Each task to run has to be defined through a single line # indicating with different fields when the task will be run # and what command to run for the task # # To define the time you can provide concrete values for # minute (m), hour (h), day of month (dom), month (mon), # and day of week (dow) or use '*' in these fields (for 'any'). # # Notice that tasks will be started based on the cron's system # daemon's notion of time and timezones. # # Output of the crontab jobs (including errors) is sent through # email to the user the crontab file belongs to (unless redirected). # # For example, you can run a backup of all your user accounts # at 5 a.m every week with: # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/ # # For more information see the manual pages of crontab(5) and cron(8) # # m h dom mon dow command #-----2023-02-21起,改雙網路,所以停用------- #NAT用###擴大網路暫時更改🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽 @reboot /sbin/iptables -t nat -A POSTROUTING -s 192.168.8.0/23 -o eth0 -j MASQUERADE @reboot /sbin/iptables -A FORWARD -p tcp --syn -s 192.168.8.0/23 -j TCPMSS --set-mss 1356 #forward經常忽略的步驟 #sudo nano /etc/sysctl.conf #net.ipv4.ip_forward=1 #-----2023-02-21起,改雙網路,所以停用------- #↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ ##NAT用###擴大網路暫時更改🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼 #-----2023-02-21起----啟用 ###擴大網路暫時更改🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽 #@reboot sleep 35 ; sudo iptables -A FORWARD -o eth1 -i eth0 -s 192.168.9.254/24 -m conntrack --ctstate NEW -j ACCEPT #@reboot sleep 35 ; sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT #@reboot sleep 35 ; sudo iptables -t nat -F POSTROUTING #@reboot sleep 35 ; sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE ###擴大網路暫時更改🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼 ######網路設定的路徑############ #hckao@H96P:/etc/network$ cat interfaces ######網路設定的路徑############ @reboot sleep 180 ; sudo sh /home/hckao/rb-time.sh @reboot sleep 90 ; sudo mount -t cifs -o username=hckao,password=giga1144 //192.168.9.251/pi5/ /media/pi5 @reboot sleep 95 ; sudo mount -t cifs -o username=hckao,password=giga1144 //192.168.9.253/512G/ /media/pn63 @reboot sleep 99 ; sudo mount -t cifs -o username=hckao,password=giga1144 //192.168.9.1/x96max/ /media/x96max @reboot sleep 105 ; sudo mount -t cifs -o username=hckao,password=giga1144 //192.168.9.246/vc65/ /media/vc65 # @reboot sleep 120 ; sudo env LANG=C /usr/bin/mrtg /etc/mrtg.cfg #@reboot sleep 125 ; sudo service vpnserver start ###########將 default route 改成 Eth1(Gpon) #@reboot sleep 15 ; sudo ip route replace default via 192.168.8.1 metric 0 #@reboot sleep 17 ; sudo route del default #sudo ip route replace default via 192.168.8.1 metric 0 ############################################################### 59 03 * * * sudo apt update 10 04 * * * sudo apt upgrade -y ############################################################### #每天記錄IP一次 59 04 * * * sudo sh /home/hckao/ipaddress.sh 01 05 * * * sudo sh /home/hckao/sysuptime.sh 03 05 * * * sudo sh /home/hckao/iproute.sh #59 07 * * * sudo sh /home/hckao/getip.sh #45 07 * * * sudo sh /home/hckao/e-day.sh #60 * * * * sudo sh /home/hckao/1day.sh * */1 * * * sudo cp /media/pi5/hckao/tempsure.txt /var/www/html/kaodoc/x96/status/pi5-tempsure.txt 00 */2 * * * sudo cp /media/pi5/hckao/reboot_time.txt /var/www/html/kaodoc/x96/status/pi5-reboot_time.txt 00 */2 * * * sudo cp /media/pn63/hckao/reboot_time.txt /var/www/html/kaodoc/x96/status/pn63_reboot_time.txt 00 */2 * * * sudo cp /media/pn63/hckao/speed-test.txt /var/www/html/kaodoc/x96/status/pn63_speed-test.txt 00 */2 * * * sudo cp /media/vc65/vc65-start-time.txt /var/www/html/kaodoc/x96/status/vc65-start-time.txt 00 */2 * * * sudo cp /media/x96max/reboot_time_x96max.txt /var/www/html/kaodoc/x96/status/x96max_reboot_time.txt 00 */2 * * * sudo cp /media/x96max/x96max-ip-address.txt /var/www/html/kaodoc/x96/status/x96max-ip-address.txt 15 06 * * * sudo cp /media/pi5/hckao/pi5-iparrdess.txt /var/www/html/kaodoc/x96/status/pi5-iparrdess.txt 17 06 * * * sudo cp /media/pn63/hckao/pn63-iproute.txt /var/www/html/kaodoc/x96/status/pn63-iproute.txt 07 06 * * * sudo sh /home/hckao/x96max-pppoe.sh 08 06 * * * sudo sh /home/hckao/pi5-pppoe.sh 06 06 * * * sudo sh /home/hckao/x96max-uptime.sh ############################################################### 00 */8 * * * sudo sh /home/hckao/test-sp.sh 55 02 * * * sudo /etc/init.d/networking restart #59 23 * * * sudo systemctl restart networking