Reboot on kill switch?

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Goto page Previous  1, 2
Author Message
Viewmax
DD-WRT Novice


Joined: 05 Jul 2021
Posts: 17

PostPosted: Sat Jul 24, 2021 14:46    Post subject: Reply with quote
Tried few times with Connection Watchdog (as I understood it's the only option for automatic reboot), but it's not working. It's keep rebooting after mentioned timeout period. Looks like it pinging, but not getting the response and that's why keep rebooting.

Any ideas? Maybe ping blocked on dd-wrt router? But I didn't find such option though.
Sponsor
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Sat Jul 24, 2021 16:42    Post subject: Reply with quote
Why not use a watchdog built specifically to monitor the OpenVPN process, like my own (see my signature).

@egc also describes one in his own documentation. They each work a bit differently.

_________________
ddwrt-ovpn-split-basic.sh (UPDATED!) * ddwrt-ovpn-split-advanced.sh (UPDATED!) * ddwrt-ovpn-client-killswitch.sh * ddwrt-ovpn-client-watchdog.sh * ddwrt-ovpn-remote-access.sh * ddwrt-ovpn-client-backup.sh * ddwrt-mount-usb-drives.sh * ddwrt-blacklist-domains.sh * ddwrt-wol-port-forward.sh * ddwrt-dns-monitor.sh (NEW!)
Viewmax
DD-WRT Novice


Joined: 05 Jul 2021
Posts: 17

PostPosted: Sun Jul 25, 2021 7:57    Post subject: Reply with quote
eibgrad wrote:
Why not use a watchdog built specifically to monitor the OpenVPN process, like my own (see my signature).

Sounds like a great idea.

I followed instruction ddwrt-ovpn-watchdog.sh. I enabled jffs2, but in Total row it showing "not mounted". Probably to this, upon running installation command from Commands tab, I got error:
Code:
warning: /jffs not mounted; using /tmp


I rebooted and tried to install again, but got this error:
Code:
warning: /jffs not mounted; using /tmp
warning: existing file: /tmp/ddwrt-ovpn-watchdog.startup
sh: can't open /dev/tty: No such device or address
info: installation aborted
tr: write error: Broken pipe


What can I do in this situation? Thank you and sorry for noobish questions (never worked with scripts before).
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6865
Location: Romerike, Norway

PostPosted: Sun Jul 25, 2021 8:16    Post subject: Reply with quote
Add a USB Stick to the router and mount as jffs.
Viewmax
DD-WRT Novice


Joined: 05 Jul 2021
Posts: 17

PostPosted: Sun Jul 25, 2021 13:35    Post subject: Reply with quote
Per Yngve Berg wrote:
Add a USB Stick to the router and mount as jffs.

Thank you.

I formatted USB stick (8GB) in fat32. Enabled USB support in DD-WRT router and plug it.

Jffs showed that internal storage 80MB.

In Commands tab used installation command and it showed that installation successful. Rebooted.

After that, I used command "killall openvpn", but it didn't reconnect. In syslog got some error:

Code:
Jul 25 16:16:21 DD-WRT user.info : cron : daemon successfully started
Jul 25 16:16:21 DD-WRT cron.info cron[3810]: (CRON) STARTUP (fork ok)
Jul 25 16:16:21 DD-WRT user.info : sfe : shortcut forwarding engine successfully stopped
Jul 25 16:16:21 DD-WRT user.info : sfe : shortcut forwarding engine successfully started
Jul 25 16:16:22 DD-WRT user.info : sfe : shortcut forwarding engine successfully stopped
Jul 25 16:16:22 DD-WRT user.info : vpn modules : vpn modules successfully unloaded
Jul 25 16:16:22 DD-WRT user.info : vpn modules : nf_conntrack_proto_gre successfully loaded
Jul 25 16:16:22 DD-WRT user.info : vpn modules : nf_nat_proto_gre successfully loaded
Jul 25 16:16:22 DD-WRT user.info : vpn modules : nf_conntrack_pptp successfully loaded
Jul 25 16:16:22 DD-WRT user.info : vpn modules : nf_nat_pptp successfully loaded
Jul 25 16:16:22 DD-WRT user.info : sfe : shortcut forwarding engine successfully started
Jul 25 16:16:23 DD-WRT user.info : sfe : shortcut forwarding engine successfully started
Jul 25 16:16:23 DD-WRT user.info : wland : daemon successfully stopped
Jul 25 16:16:23 DD-WRT user.info : wland : daemon successfully started
Jul 25 16:16:23 DD-WRT user.err : flash : Could not unlock MTD device: /dev/mtd10
Jul 25 16:16:23 DD-WRT user.info : flash : Flash is NAND
Jul 25 16:16:23 DD-WRT user.info : flash : erase[0]
Jul 25 16:16:23 DD-WRT user.info : flash : erase[131072]
Jul 25 16:16:23 DD-WRT user.info : flash : erase[262144]
Jul 25 16:16:23 DD-WRT user.info : flash : erase[393216]
Jul 25 16:16:23 DD-WRT user.info : flash : erase[524288]
Jul 25 16:16:23 DD-WRT user.info : flash : erase[655360]
Jul 25 16:16:23 DD-WRT user.info : flash : erase[786432]
Jul 25 16:16:23 DD-WRT user.info : flash : erase[917504]


Looks like I did something wrong with USB stick. Please assist.
eibgrad
DD-WRT Guru


Joined: 18 Sep 2010
Posts: 9157

PostPosted: Sun Jul 25, 2021 17:37    Post subject: Reply with quote
The JFFS partition has to be formatted as either ext2, ext3, or ext4, since it will be used to execute Linux programs/scripts. Linux can't read DOS-based partitions like FAT32 for these purposes. You can use a bootable distro of Linux and the gparted utility to create a ext2/3/4 partition (e.g., Ubuntu Live CD). There's even a distro specifically for gparted.

https://gparted.org/

Also (and maybe this is easier in your case), since my watchdog script is just a startup script, worst case, instead of using jffs, you could copy/paste it (from the Raw Paste Data section of PasteBin) into the Commands field on the Administration->Commands page and hit Save Startup. Just so long as you have sufficient nvram. If you don't, you may need to delete some of the comments to reduce its size.

_________________
ddwrt-ovpn-split-basic.sh (UPDATED!) * ddwrt-ovpn-split-advanced.sh (UPDATED!) * ddwrt-ovpn-client-killswitch.sh * ddwrt-ovpn-client-watchdog.sh * ddwrt-ovpn-remote-access.sh * ddwrt-ovpn-client-backup.sh * ddwrt-mount-usb-drives.sh * ddwrt-blacklist-domains.sh * ddwrt-wol-port-forward.sh * ddwrt-dns-monitor.sh (NEW!)
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 1447
Location: Appalachian mountains, USA

PostPosted: Sun Jul 25, 2021 19:42    Post subject: Reply with quote
FWIW, I have formatted USB drives as ext2 or ext4 from the dd-wrt NAS page. I don't remember the details, but it was fairly obvious. So no need for a linux machine external to the router.
_________________
2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
Viewmax
DD-WRT Novice


Joined: 05 Jul 2021
Posts: 17

PostPosted: Mon Jul 26, 2021 21:30    Post subject: Reply with quote
Huge thanks to all! Seems everything is working as desired!
Goto page Previous  1, 2 Display posts from previous:    Page 2 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum