Skip to content

Instantly share code, notes, and snippets.

@wynemo
wynemo / add_route
Last active February 20, 2023 16:47
openvpn over shadowsocks
# in /etc/sysctl.conf
# net.ipv4.ip_forward=1
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -s 10.8.0.0/24 -j ACCEPT
iptables -A FORWARD -j REJECT
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
@buddhazhou
buddhazhou / shadowsocks.sh
Created November 14, 2015 06:53 — forked from lanceliao/shadowsocks.sh
Shadowsocks startup script with iptables rules for OpenWrt
#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2011 OpenWrt.org
#
# Shadowsocks startup script with iptables rules for OpenWrt
#
# This file is located in directory /etc/init.d/
# rename this file to shadowsocks before using it
#
# By Lance http://www.shuyz.com
#