# netsed: modify network packets on-the-fly


Bridge mode

# # eth0 = outside & eth1 = inside
# ifconfig eth0 promisc up
# ifconfig eth1 promisc up
# brctl addbr br0
# brctl addif br0 eth0 eth1
# ifconfig br0 192.168.1.111/24 up
# iptables --table nat -A PREROUTING --match physdev --physdev-in eth0 --source 192.168.1.0/24 --protocol tcp --dport 80 --jump REDIRECT --to-port 1080
# # --match physdev --physdev-in eth0 | --in-interface br0
# netsed tcp 1080 0 0 's/Accept-Encoding/4ccept-Encoding' 's/Never/Forever'
Host mode

# iptables --table nat -A PREROUTING --in-interface eth0 --source 192.168.1.0/24 --protocol tcp --dport 80 --jump REDIRECT --to-port 1080
# netsed tcp 1080 0 0 's/Accept-Encoding/4ccept-Encoding' 's/Never/Forever'

No comments: