How to open a particular port in ubuntu?
Run this on the commandline; it should solve issue: sudo iptables -A INPUT -m conntrack --ctstate NEW,RELATED,ESTABLISHED -j ACCEPT
To do a specific port:
sudo iptables -A INPUT -p <tcp OR udp> <--dport OR --sport> <port> -j ACCEPT
INPUT
is the chain for incoming traffic.
-p
is protocol (either tcp
or udp
--dport
or --sport
specify allowing for destination or source port.
-j
is "jump" and its where you ACCEPT
, REJECT
, or DROP
the packet(s)
Details on iptables
can be found by reading the man page. Since you're a beginner you'll probably find this useful: http://www.netfilter.org/documentation/HOWTO//packet-filtering-HOWTO.html
Related videos on Youtube
charlie
Fell in love with the "Gutsy Gibbon", and the romance continued through the "Hardy Heron"... Now, after many on and off flings, got into the "Quantal Quetzal" and moved on to the "Raring Ringtail"...and the bond intensifies with the "Saucy Salamander". Continued on the "Trusty Tahr", the "Utopic Unicorn", and the "Vivid Vervet" for as long as I could. Now on a hiatus, hoping to delve into the magical world again soon...
Updated on September 18, 2022Comments
-
charlie about 1 year
My SoulSeek client Nicotine+ checks my open ports during initial configuration and promts that the one port number it needs is closed, cutting me off frmo about 50% of the users. Is there anyway I can open that particular port for the application to use?
RUnning ubuntu desktop 13.04. I have not manually installed any firewalls, but not sure if its included in the default installation.
-
Mitch over 10 yearsAre you running Ubuntu Desktop or Server? Are running any Firewall?
-
charlie over 9 yearsDesktop (Trusty) and no additional firewall installed
-
-
charlie over 10 years@J Moore: Thanks, but where do I put in the port number? Also would help if you could put in a one liner about what these arguments are for?
-
charlie over 10 yearsI tried the methods above, and though I think they should work, the client port-checking page: tools.slsknet.org/porttest.php?port=2234 always shows that the port is CLOSED. Any ideas?
-
sinekonata over 7 yearsI don't think this is addressing the matter at all. Also clearly the op has little idea of how to execute what you just put forward.