- 开启ipv4转发
vi /etc/sysctl.conf
# 将net.ipv4.ip_forward=0更改为net.ipv4.ip_forward=1
sysctl -p
- 安装dnsmasq 和pdnsd解决dns污染
DNS的解析方案为 resolve.conf ==> dnsmasq ==> pdnsd
[General] | |
loglevel = warning | |
bypass-system = true | |
skip-proxy = 192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,localhost,*.local,*.lan | |
bypass-tun = 192.168.0.0/16,10.0.0.0/8,172.16.0.0/12 | |
dns-server = 114.114.114.114,114.114.115.115 | |
[Proxy] | |
PROXY = custom,服务器地址,服务器端口,加密方式,密码,模块地址,tcp-fast-open=true |
[General] | |
loglevel = notify | |
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 127.0.0.0/8, 100.64.0.0/10, localhost, *.local, e.crashlytics.com | |
bypass-tun = 192.168.0.0/16, 0.0.0.0/8, 1.0.0.0/9, 1.160.0.0/11, 1.192.0.0/11, 10.0.0.0/8, 14.0.0.0/11, 14.96.0.0/11, 14.128.0.0/11, 14.192.0.0/11, 27.0.0.0/10, 27.96.0.0/11, 27.128.0.0/9, 36.0.0.0/10, 36.96.0.0/11, 36.128.0.0/9, 39.0.0.0/11, 39.64.0.0/10, 39.128.0.0/10, 42.0.0.0/8, 43.224.0.0/11, 45.64.0.0/10, 47.64.0.0/10, 49.0.0.0/9, 49.128.0.0/11, 49.192.0.0/10, 54.192.0.0/11, 58.0.0.0/9, 58.128.0.0/11, 58.192.0.0/10, 59.32.0.0/11, 59.64.0.0/10, 59.128.0.0/9, 60.0.0.0/10, 60.160.0.0/11, 60.192.0.0/10, 61.0.0.0/10, 61.64.0.0/11, 61.128.0.0/10, 61.224.0.0/11, 100.64.0.0/10, 101.0.0.0/9, 101.128.0.0/11, 101.192.0.0/10, 103.0.0.0/10, 103.192.0.0/10, 106.0.0.0/9, 106.224.0.0/11, 110.0.0.0/7, 112.0.0.0/9, 112.128.0.0/11, 112.192.0.0/10, 113.0.0.0/9, 113.128.0.0/11, 113.192.0.0/10, 114.0.0.0/9, 114.128.0.0/11, 114.192.0.0/10, 115.0.0.0/8, 116.0.0.0/8, 117.0.0.0/9, |
#!/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 | |
# |
vi /etc/sysctl.conf
# 将net.ipv4.ip_forward=0更改为net.ipv4.ip_forward=1
sysctl -p
DNS的解析方案为 resolve.conf ==> dnsmasq ==> pdnsd
---- | |
Linux 基于策略的路由(Linux Policy Routing) | |
Linux 有传统的基于数据包目的地址的路由算法,和新的基于策略的路由算法 | |
新算法优点:支持多个路由表,支持按数据报属性(源地址、目的地址、协议、端口、数据包大小、内容等)选择不同路由表 | |
# 查看规则命令,后面可跟其它参数,默认为 show(list) 显示全部 | |
ip rule |
1) Filter Table
Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.
git clone https://www.github.com/openwrt/openwrt -b branch_name
cd openwrt
.This is our <buildroot dir>
for this guide../scripts/feeds update -a
./scripts/feeds install <PACKAGENAME>
./scripts/feeds install -a