I have an ubuntu pc and an android phone conneted to my router through a cable and wi-fi respectively. I set the android phone to use a proxy
my-wan-ip:5555 and enabled port forwarding on my router on port
5555 to my ubuntu pc. I want all http/https connections from port
5555 to be forwarded to the internet, I tried the following but it didn't work:
iptables -F iptables -t nat -F iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 5555 -j REDIRECT --to-port 80 iptables -A FORWARD -i eth0 -p tcp --dport 80 -j ACCEPT iptables -t nat -A POSTROUTING -o eth0 -p tcp --dport 80 -j MASQUERADE echo '1' | tee /proc/sys/net/ipv4/ip_forward
I'm not sure but it seems to me that the sent packets are received on my pc but nothing is sent back, (i can see the received packets on wireshark and tcpdump), how do i fix it?
- Also i just noticed that after adding these rules i can't connect to the internet on my pc.
- I have
ufwinstalled on my PC, not sure if it's affecting anything.
- I have
apachewebserver installed as well and port forwaring enabled on port
80to my ubuntu pc.