
IP테이블
나 10.8.0.7 데비안
Linux 서버 cent8 eth0 192.168.88.11 tun0 10.8.0.6
10.8.0.6:8888 포트 전달을 로컬 192.168.88.10:443 시스템에 연결하는 방법은 무엇입니까?
전달 활성화
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
sudo sysctl -w net.ipv4.ip_forward=1
echo '1' | sudo tee /proc/sys/net/ipv4/conf/eth0/forwarding ;
echo '1' | sudo tee /proc/sys/net/ipv4/conf/tun0/forwarding
sudo iptables -A FORWARD -i tun0 -o eth0 -j ACCEPT
# forward 10.8.0.6:8888 to local 192.168.88.10:443
sudo iptables -t nat -A PREROUTING -p tcp -d 10.8.0.6 --dport 8888-j DNAT --to-destination 192.168.88.10:443
# return
sudo iptables -t nat -A POSTROUTING -p tcp --dst 192.168.88.10 -j SNAT --to-source 10.8.0.6:8888
# remove
sudo iptables -t nat -D PREROUTING 2
sudo iptables -t nat -D POSTROUTING 2
작동하지 않는 이유는 무엇입니까?