#!/bin/sh # cd /home/liuyang/src/forge_socket-master/;insmod forge_socket.ko #ip tuntap add dev tun0 mode tun #ifconfig tun0 up echo 1 > /proc/sys/net/ipv4/ip_forward ethtool -K p7p1 lro off ethtool -K p7p1 tso off ethtool -K p7p1 gro off 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