20180710:
1、将IP_ENTRY改为TCPALL_ENTRY 2、将iptables规则在脚本中设置,不再代码中设置;
This commit is contained in:
@@ -4,14 +4,14 @@ SO_PATH=./plug/business/kni/kni.so
|
||||
INIT_FUNC=kni_init
|
||||
DESTROY_FUNC=
|
||||
|
||||
[IP]
|
||||
FUNC_FLAG=all
|
||||
FUNC_NAME=kni_ip_entry
|
||||
|
||||
|
||||
#[TCP_ALL]
|
||||
#[IP]
|
||||
#FUNC_FLAG=all
|
||||
#FUNC_NAME=kni_tcpall_entry
|
||||
#FUNC_NAME=kni_ip_entry
|
||||
|
||||
|
||||
[TCP_ALL]
|
||||
FUNC_FLAG=all
|
||||
FUNC_NAME=kni_tcpall_entry
|
||||
|
||||
|
||||
|
||||
|
||||
BIN
bin/kni/kni.so
BIN
bin/kni/kni.so
Binary file not shown.
@@ -6,19 +6,6 @@
|
||||
#ifconfig tun0 up
|
||||
|
||||
echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||
#route add default dev tun0
|
||||
|
||||
iptables -t mangle -N DIVERT
|
||||
iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
|
||||
iptables -t mangle -A DIVERT -j MARK --set-mark 1
|
||||
iptables -t mangle -A DIVERT -j ACCEPT
|
||||
|
||||
ip rule add fwmark 1 lookup 100
|
||||
#ip route add local 0.0.0.0/0 dev tun0 table 100
|
||||
ip route add local 0.0.0.0/0 dev lo table 100
|
||||
|
||||
#iptables -t mangle -A PREROUTING -p tcp -i tun0 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 50080
|
||||
|
||||
|
||||
ethtool -K p7p1 lro off
|
||||
ethtool -K p7p1 tso off
|
||||
@@ -28,3 +15,18 @@ ethtool -K em2 lro off
|
||||
ethtool -K em2 tso off
|
||||
ethtool -K em2 gro off
|
||||
|
||||
ip tuntap add dev tun0 mode tun multi_queue
|
||||
ifconfig tun0 up
|
||||
route add default dev tun0
|
||||
|
||||
iptables -F -t mangle
|
||||
iptables -t mangle -N DIVERT
|
||||
iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
|
||||
iptables -t mangle -A DIVERT -j MARK --set-mark 1
|
||||
iptables -t mangle -A DIVERT -j ACCEPT
|
||||
|
||||
ip rule add fwmark 1 lookup 100
|
||||
#ip route add local 0.0.0.0/0 dev tun0 table 100
|
||||
ip route add local 0.0.0.0/0 dev lo table 100
|
||||
|
||||
iptables -t mangle -A PREROUTING -p tcp -i tun0 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 50080
|
||||
|
||||
Reference in New Issue
Block a user