Я хочу сделать своего рода WiFi прокси. И поэтому я хочу знать, как перенаправить пакеты, проходящие через определенный адаптер, на IP-порт назначения.
I assume you want to do that on a GNU/Linux system.
In order to re-route all the TCP traffic (since you're talking about packets) from a specific adapter to a specific IP address and port, you should:
Enable the IP forwarding capability of the Linux kernel. To do that, you must add the following configuration to /etc/sysctl.conf and reboot your system:
net.ipv4.ip_forward = 1
Next, create the iptables rule for the forwarding:
iptables -t nat -A PREROUTING -i $DEVICE -p TCP -d $IP --dport $PORT -j REDIRECT