このコマンドブロックを80から8080へのルーティングに使用しますが、現在は機能しません。
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -A PREROUTING -i wlp8s0 -p tcp --dport 80 -j REDIRECT --to-port 8080
sudo iptables -P FORWARD ACCEPT
そして iptables -L -vt nat
出力は
Chain PREROUTING (policy ACCEPT 3 packets, 236 bytes)
pkts bytes target prot opt in out source destination
0 0 REDIRECT tcp -- wlp8s0 any anywhere anywhere tcp dpt:http redir ports 8080
Chain INPUT (policy ACCEPT 2 packets, 184 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 2 packets, 128 bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 2 packets, 128 bytes)
そして最後に、 cat /proc/sys/net/ipv4/ip_forward
output => 1
出力をunameします。
Linux 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u3 (2017-08-06) GNU/Linux
何が悪いの?
1
あなたが得ていた行動、現在得ている行動、そしてその時から現在までに何が変わったのかを説明してください。
—
G-Man
私は自分のIPアドレスを変更するだけで、コマンドを変更することはありません。
—
ibrahim
すべてのクライアントは私の新しいIPアドレスを知っているので、ゼロとは異なるiptables.normally prekouting pktsとbytesセクション(iptables -L -vt nat)の問題を考えています。
—
ibrahim