0

I am using Genymotion emulator for Testing My proxy.So I need use iptables to redirect all tcp data to my proxy Port. when I use

iptables -t nat -N REDSOCKS

it prints 'can't initialize iptables table `nat': Table does not exist (do you need to insmod?)'

But when I use

iptables -L

it prints the default table 'filter' complete chains.

'nat' and 'filter' are default tables in netfilter, Why nat table does not exist?

1 Answers1

0

Users of retail Android devices cannot access iptables binary. Even Android OS itself cannot access that binary. Source.

A few general things about routing with iptables.

Dont forget to enable routing .

  1. sudo sysctl net.ipv4.ip_forward=1

    or

  2. echo 1 > /proc/sys/net/ipv4/ip_forward

and

  1. iptables -t nat -A PREROUTING -i $device -p tcp --dport $srcPortNumber -j REDIRECT --to-port $dstPortNumber
Community
  • 1
  • 1
Wiffzack
  • 315
  • 3
  • 10