Skip to content

Instantly share code, notes, and snippets.

@shimarin
Last active December 30, 2017 23:54
Show Gist options
  • Select an option

  • Save shimarin/e94aaa44f1d709e96e5e0d9c41c103fb to your computer and use it in GitHub Desktop.

Select an option

Save shimarin/e94aaa44f1d709e96e5e0d9c41c103fb to your computer and use it in GitHub Desktop.
mine
RC_AFTER="network-bridge"
RC_NEED="!net net.eth0"
subnet 192.168.81.0 netmask 255.255.255.0 {
range 192.168.81.10 192.168.81.100;
option domain-name-servers 8.8.8.8,8.8.4.4;
option routers 192.168.81.1;
}
/var/lib/iptables/rules-save
/etc/conf.d/net
/etc/conf.d/network-bridge
/etc/conf.d/dhcpd
/etc/hostapd/hostapd.conf
/etc/dhcp/dhcpd.conf
/etc/sysctl.conf
/etc/cron.hourly/reboot-if-disconnected
config_eth0="192.168.81.1/24"
config_ppp0="ppp"
link_ppp0="/dev/serial/by-id/usb-NTT_DOCOMO__INC._docomo_L03F-if01-port0"
pppd_ppp0="call soracom-air"
RC_NEED="!net net.eth0"
#!/bin/sh
LOGFILE=/var/log/reboot-if-disconnected.log
tty -s || exec >$LOGFILE 2>&1
ping -c 3 -n 172.19.0.1 && exit
service openvpn stop
service net.ppp0 restart
sleep 10
service openvpn start
sleep 10
ping -c 3 -n 172.19.0.1 || reboot
# Generated by iptables-save v1.4.21 on Wed Nov 29 03:01:37 2017
*raw
:PREROUTING ACCEPT [165818396:43332720372]
:OUTPUT ACCEPT [112227014:4426276342168]
COMMIT
# Completed on Wed Nov 29 03:01:37 2017
# Generated by iptables-save v1.4.21 on Wed Nov 29 03:01:37 2017
*nat
:PREROUTING ACCEPT [20560:1694227]
:INPUT ACCEPT [794:168823]
:OUTPUT ACCEPT [4705:343098]
:POSTROUTING ACCEPT [2965:393166]
[11760:843087] -A POSTROUTING -o ppp0 -j MASQUERADE
COMMIT
# Completed on Wed Nov 29 03:01:37 2017
# Generated by iptables-save v1.4.21 on Wed Nov 29 03:01:37 2017
*mangle
:PREROUTING ACCEPT [165818396:43332720372]
:INPUT ACCEPT [164759546:43051506655]
:FORWARD ACCEPT [1054205:281702863]
:OUTPUT ACCEPT [112227014:4426276342168]
:POSTROUTING ACCEPT [113282388:4426558255000]
COMMIT
# Completed on Wed Nov 29 03:01:37 2017
# Generated by iptables-save v1.4.21 on Wed Nov 29 03:01:37 2017
*filter
:INPUT ACCEPT [164759546:43051506655]
:FORWARD ACCEPT [1054205:281702863]
:OUTPUT ACCEPT [112227014:4426276342168]
COMMIT
# Completed on Wed Nov 29 03:01:37 2017
net.ipv4.ip_forward = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment