NamelessHero
March 2nd, 2012, 12:55 PM
Hello, could someone please share knowledge?
I set up internet sharing, using old PC with ubuntu 10.04 system.
eth0 is used for internet access, and eth1 for sharing internet, i set up eth1 as gateway 192.168.0.1 and pc connected to ubuntu system has 192.168.0.2.
But now i can't figure out how to port forward, first i want to forward port 16000 udp to 192.168.0.2.
Here are the commands that i would use:
-A INPUT -i eth0 -p udp -m udp --dport 16000 -j ACCEPT
-A PREROUTING -t nat -i eth0 -p udp --dport 16000 -j DNAT --to 192.168.0.2:16000
But the problem is, i don't know where to place it, i tried placing it in /etc/rc.local with no success, so could someone tell me all important iptable files and description of each (with /etc/... directories please).
And one more thing, what would be commands to first block all traffic and then add seperate IPTABLE rules to unblock necessary ports, and where to add it.
Please, help.. i see that i can't learn this all by myself, this would be beneficial for others too.
I set up internet sharing, using old PC with ubuntu 10.04 system.
eth0 is used for internet access, and eth1 for sharing internet, i set up eth1 as gateway 192.168.0.1 and pc connected to ubuntu system has 192.168.0.2.
But now i can't figure out how to port forward, first i want to forward port 16000 udp to 192.168.0.2.
Here are the commands that i would use:
-A INPUT -i eth0 -p udp -m udp --dport 16000 -j ACCEPT
-A PREROUTING -t nat -i eth0 -p udp --dport 16000 -j DNAT --to 192.168.0.2:16000
But the problem is, i don't know where to place it, i tried placing it in /etc/rc.local with no success, so could someone tell me all important iptable files and description of each (with /etc/... directories please).
And one more thing, what would be commands to first block all traffic and then add seperate IPTABLE rules to unblock necessary ports, and where to add it.
Please, help.. i see that i can't learn this all by myself, this would be beneficial for others too.