I copied bits of this post from 2009 by martin, legend of thor, bit fiddlyfinikity, but that is the linux way sometimes
This code will open port 2234:
Code:
Code: Select all
iptables -A INPUT -i eth1 -p tcp --sport 2234 -m state --state ESTABLISHED -j ACCEPT
If a programme requires a particular port to be opened, such as Nicotine, you can make a simple script that opens the port and executes the programme. Eg:
Code:
Code: Select all
#!/bin/sh
iptables -A INPUT -i eth1 -p tcp --sport 2234 -m state --state ESTABLISHED -j ACCEPT
/usr/bin/nicotine
This will open port 2234 and run the Nicotine programme. This works for me.
Remember, that some programmes require multiple ports to be opened. Just add extra iptables lines and the required port.
how to find out what programmes are accessing ports type in Terminal:
Code:
Thanks to trapster for this info.
To check if the port has opened from the first post type:
Code:
PS: Sometimes your programme still won't be able to access the internet - this may due to:
1. It requires extra ports to be opened or
2. Modem firewall is blocking.
Security does not appear compromised with this procedure - I went to ShieldUp! to test and it came back as stealthed.