Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 03 Mar 2015, 18:43
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
How to use iptables to open a port.
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
legendofthor

Joined: 17 May 2007
Posts: 219
Location: Queensland Australia

PostPosted: Tue 11 Aug 2009, 20:08    Post_subject:  How to use iptables to open a port.
Sub_title: plus a launch script to open a port and start your programme
 

G'day,
Sometimes a programme is not able to run as the Linux firewall has restricted its access due port a closed port. Well here's a workaround that works for me.
This code will open port 2234 for you:

Code:
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:
#!/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.

Cheers
Martin

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.

_________________
Toowoomba Linux Users Group http://groups.google.com/group/toowoombalinux
Back to top
View user's profile Send_private_message 
legendofthor

Joined: 17 May 2007
Posts: 219
Location: Queensland Australia

PostPosted: Tue 11 Aug 2009, 20:15    Post_subject:  

how to find out what programmes are accessing ports type in Terminal:

Code:
netstat -nlp


Thanks to trapster for this info.

To check if the port has opened from the first post type:

Code:
iptables -L


Cheers
Martin

_________________
Toowoomba Linux Users Group http://groups.google.com/group/toowoombalinux
Back to top
View user's profile Send_private_message 
fat.tuesday

Joined: 06 Mar 2011
Posts: 4

PostPosted: Sun 06 Mar 2011, 07:04    Post_subject: nicotine install
Sub_title: port 2234
 

when i type the code to open the port 2234:
#!/bin/sh
iptables -A INPUT -i eth1 -p tcp --sport 2234 -m state --state ESTABLISHED -j ACCEPT
/usr/bin/nicotine

i recieve this message:
Error: Symbol iptables is not defined in current scope (tmpfile):1:
Error: Symbol AINPUT is not defined in current scope (tmpfile):1:
Error: Symbol ieth1 is not defined in current scope (tmpfile):1:
Error: Symbol ptcp is not defined in current scope (tmpfile):1:
Error: Symbol sport2234 is not defined in current scope (tmpfile):1:
Error: Symbol mstate is not defined in current scope (tmpfile):1:
Error: Symbol stateESTABLISHED is not defined in current scope (tmpfile):1:
Error: Symbol jACCEPT is not defined in current scope (tmpfile):1:
(const int)0
*** Interpreter error recovered ***

what should i do?
could you reply to me in my email then i keep it if some friends need it i give it to him...thank in advance
Back to top
View user's profile Send_private_message 
fat.tuesday

Joined: 06 Mar 2011
Posts: 4

PostPosted: Sun 06 Mar 2011, 07:05    Post_subject:  

my email:

fattuesdayfestival@gmail.com
Back to top
View user's profile Send_private_message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11275
Location: Arizona USA

PostPosted: Sun 06 Mar 2011, 08:34    Post_subject:  

Please don't do that, especially not in the How to section. The forum is not just for you to solve problems, it is also for other people to learn from the solution to your problems. If you want to send someone an email with the solution, send them a link to this thread in the forum. Smile
Back to top
View user's profile Send_private_message 
fat.tuesday

Joined: 06 Mar 2011
Posts: 4

PostPosted: Sun 06 Mar 2011, 08:52    Post_subject:  

ok...but could you tell me how to do it then? cuz i'm using ubuntu 10.10 and maybe...don't know but if you know how to tell me
Back to top
View user's profile Send_private_message 
fat.tuesday

Joined: 06 Mar 2011
Posts: 4

PostPosted: Sun 06 Mar 2011, 09:03    Post_subject:  

is it possible to config nicotine allowing the port 2234 to nicotine server only and use it safely?
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0535s ][ Queries: 11 (0.0036s) ][ GZIP on ]