# 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 ######################################## #menu_reboot.sh ######################################## ######################################## ####################################### #-----2023-02-21起,改雙網路,所以停用------- #NAT用 #@reboot /sbin/iptables -t nat -A POSTROUTING -s 192.168.9.0/24 -o eth0 -j MASQUERADE #@reboot /sbin/iptables -A FORWARD -p tcp --syn -s 192.168.9.0/24 -j TCPMSS --set-mss 1356 #forward經常忽略的步驟 #sudo nano /etc/sysctl.conf #net.ipv4.ip_forward=1 #-----2023-02-21起,改雙網路,所以停用------- #↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ #########以下是雙網路卡設定的地方########### # #hckao@pn63:/etc/netplan$ sudo cat 00-installer-config.yaml # #########以下是雙網路卡設定的地方########### #########以下是雙網路卡########### #@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 ### 更改 default route ####### #sudo ip route replace default via 192.168.1.1 metric 0 ###### 以下是目前的 #hckao@pn63:~$ route #Kernel IP routing table #Destination Gateway Genmask Flags Metric Ref Use Iface #default _gateway 0.0.0.0 UG 0 0 0 eth0 #default _gateway 0.0.0.0 UG 100 0 0 eth1 #172.18.20.0 0.0.0.0 255.255.255.0 U 0 0 0 wg0 #192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 #192.168.9.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 #🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽 #設定固定ip的路徑 #hckao@pn63:/etc/netplan$ sudo nano 00-installer-config.yaml #🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽 #重新啟動網路 #sudo netplan apply #sudo systemctl restart systemd-networkd.service ################################# #阻擋 ppp0 的 FTP 服務 @reboot sleep 35 ; sudo iptables -A INPUT -i eth1 -p tcp --dport 21 -j DROP @reboot sleep 35 ; sudo iptables -A INPUT -i ppp0 -p tcp --dport 21 -j DROP ################################# #↑↑↑↑↑↑↑↑↑↑↑↑阻擋 ppp0 的 FTP 服務↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ #重新開機時,紀錄開機時間 @reboot sleep 60 ; sudo sh /home/hckao/rb.sh @reboot sleep 60 ; sudo systemctl stop noip2.service @reboot sleep 62 ; sudo systemctl start noip2.service @reboot sleep 70 ; sudo systemctl restart xl2tpd.service @reboot sleep 72 ; sudo systemctl restart ipsec.service @reboot sleep 90 ; sudo route add -net 192.168.8.0/24 gw 192.168.9.254 @reboot sleep 3600 ; sudo systemctl restart xl2tpd.service @reboot sleep 3605 ; sudo systemctl restart ipsec.service #🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽 @reboot sleep 600 ; sudo cp /etc/fstab.nousb /etc/fstab 50 08 * * * sudo ntpdate -q time.stdtime.gov.tw #🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽 #🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼 #啟動 collabora @reboot sleep 180 ; docker run -t -d -p 9980:9980 -e "extra_params=--o:ssl.enable=false" collabora/code #🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼 #🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽 #53 08 * * * sudo wakeonlan a8:5e:45:bc:54:ce #🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽 #每日紀錄一次測速網站 00 */6 * * * sudo sh /home/hckao/test-sp.sh 12 06 * * * sudo sh /home/hckao/ck-route.sh 00 */8 * * * sudo dmesg -T |grep handshake > /home/hckao/wglog/wg_$(date "+%y%m%d_%H%M%S") 00 */12 * * * sudo cat /var/log/auth.log | grep l2tp > /home/hckao/wglog/l2tp_$(date "+%y%m%d_%H%M%S") 00 */12 * * * sudo cat /var/log/auth.log | grep ikev2 > /home/hckao/wglog/ikev2_$(date "+%y%m%d_%H%M%S") 00 */12 * * * sudo cat /var/log/auth.log | grep xauth > /home/hckao/wglog/xauth_$(date "+%y%m%d_%H%M%S") #🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼🔼 00 04 * * * sudo apt update 10 04 * * * sudo apt upgrade -y 30 05 * * * sudo systemctl restart xl2tpd.service 31 05 * * * sudo systemctl restart ipsec.service 32 05 * * * sudo systemctl restart wg-quick@wg0.service 30 18 * * * sudo systemctl restart xl2tpd.service 31 18 * * * sudo systemctl restart ipsec.service 32 18 * * * sudo systemctl restart wg-quick@wg0.service