Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-26-2010, 06:41 AM
|
#1
|
LQ Newbie
Registered: Jan 2010
Posts: 24
Rep:
|
Enabling port 843
Hi ,
How Do I enable a port 843 in a Linux machine . I have written a server program that listens to port 843 and responds when requested . But Client socket request is not able to reach that port . socket.connect functions returns -1 with timeout . I have edited /etc/services to add that port . But this is not working . Please help me out . Thanks in advance .
regards
Suman
|
|
|
01-26-2010, 06:48 AM
|
#2
|
Senior Member
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375
|
Hi Suman,
What distribution are you using? I suspect this answer will lay in a firewall and as the most common firewalling tool in linux tends to be iptables (that interacts with the kernel routing tables). Try the following two commands.
/etc/init.d/iptables status
iptables -nvL
If the two commands give the same output then copy and paste one set of results here and we should be able to better guide you what modifications. If iptables status says that iptables is on or active then copy and paste the results of "iptables -nvL" here.
|
|
|
01-26-2010, 07:43 AM
|
#3
|
LQ Newbie
Registered: Jan 2010
Posts: 24
Original Poster
Rep:
|
Thanks for the reply . I am using ("MontaVista 3.4.3-25.0.143.0800417 2008-02-22" distribution . Though I could not execute "/etc/init.d/iptables status" , I have executed "iptables -nvL" . It gives the following output .
Chain INPUT (policy DROP 8828 packets, 834K bytes)
pkts bytes target prot opt in out source destination
0 0 DROP all -- eth0 * 0.0.0.0/0 127.0.0.0/8
415K 42M ACCEPT all -- * * 0.0.0.0/0 127.0.0.0/8
0 0 ACCEPT all -- vlan4042 * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT all -- vlan4043 * 0.0.0.0/0 0.0.0.0/0
163K 19M ACCEPT all -- vlan4044 * 0.0.0.0/0 0.0.0.0/0
44 17408 ACCEPT all -- vlan4047 * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
15320 968K samrules all -- * * 0.0.0.0/0 10.65.124.26
Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all -- * * 127.0.0.0/8 0.0.0.0/0
Chain OUTPUT (policy ACCEPT 552K packets, 214M bytes)
pkts bytes target prot opt in out source destination
0 0 DROP all -- * eth0 127.0.0.0/8 0.0.0.0/0
Chain samrules (1 references)
pkts bytes target prot opt in out source destination
15 820 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443
12675 722K ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
2407 202K ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
0 0 DROP tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:514
11 832 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
116 37587 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
|
|
|
01-26-2010, 07:57 AM
|
#4
|
Senior Member
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375
|
If this server is sitting on the 10.65.124.26 ip, then I believe the solution to this on is the following.
iptables -I samrules -p tcp --dport 843 -j ACCEPT
however I don't know much about the service, if it instead uses udp then the following would be the more correct line
iptables -I samrules -p udp --dport 843 -j ACCEPT
Please note this line is not a perm fix and will be lost on the next restart of iptables, the service is likely stored in /etc/init.d/ but under a different name, like firewall. I do not know the iptables save method preferred by the distribution you are using either.
Last edited by r3sistance; 01-26-2010 at 08:01 AM.
Reason: ip
|
|
|
01-26-2010, 08:07 AM
|
#5
|
LQ Newbie
Registered: Jan 2010
Posts: 24
Original Poster
Rep:
|
Thanks . It works . I appreciate your help .
|
|
|
01-26-2010, 08:11 AM
|
#6
|
Senior Member
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375
|
If this works and you are satisfied with it, could you go to the thread tools and click the "mark this thread as solved" link.
As I would point out however, this rule is only temporary and will be lost on an iptables restart (you can easily re-apply this but this manual method has a few drawbacks), so you may want to look into that yourself. However if you need further help here, feel free to ask for it and do not mark this thread as solved yet.
R3sistance
|
|
|
01-26-2010, 08:18 AM
|
#7
|
LQ Newbie
Registered: Jan 2010
Posts: 24
Original Poster
Rep:
|
Hi ,
My problem is solved temporarily . But I am investigating for a permanent solution as you suggested . Lets keep the thread open .
regards
Suman
|
|
|
All times are GMT -5. The time now is 12:57 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|