Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
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.
|
 |
09-06-2005, 07:01 AM
|
#1
|
LQ Newbie
Registered: Aug 2005
Location: Singapore
Distribution: Red Hat Enterprise Linux WS
Posts: 5
Rep:
|
Networking 2 pc
Hi,
I am trying to setup a communication between 2 PC say PC1 and PC2 via ethernet using sockets. I've created a simple server program for PC1 and a client program for PC2 and is able to transmit data and echo back to the sender. However, when I swap the order (server program for PC2 and a client program for PC1), I encounter an error saying that "No route to host".
PC1 can ping to PC2 and vice versa, and so I suspect some mechanism is blocking the transmission.
Is there anyone who knows what could be the likely reason?
|
|
|
09-06-2005, 07:27 AM
|
#2
|
Member
Registered: Oct 2004
Location: UK
Distribution: Ubuntu/Kubuntu
Posts: 249
Rep:
|
It may help if we knew what distribution you are using, an idea would be to update the "Distribution" field in your profile.
When you say "No route to host" error, is this an error produced from your program? Do both the server and client give the same error, does it only happen on the client side or server side?
What programming language are you using? What port is the app using? Have you checked firewall settings on either machine?
|
|
|
09-06-2005, 10:17 PM
|
#3
|
LQ Newbie
Registered: Aug 2005
Location: Singapore
Distribution: Red Hat Enterprise Linux WS
Posts: 5
Original Poster
Rep:
|
I am using Red Hat Enterprise Linux WS. I believe the fault is due to the firewire settings. As running the following command:
/etc/rc.d/init.d/iptables stop
will solve my problem and I can run both server/client program on either PC. The problem now is that this is not a permanent solution. As whenever I reboot, the firewalls are activated again. I try deciphering the iptables but some terms looks alien to me.
Can anyone advise me if I still want my firewall to be up, but I also want to allow access of a particular IP say 178.13.18.18 to my pc, how can I do it? And is there a permanent solution that allow a particular IP to access my pc even after rebooting? Please enlighten me. Thanks!
Qn1:What programming language are you using?
I am using C++ with cross complier.
Qn2:What port is the app using?
I randomly select a port greater than 1023.
|
|
|
09-11-2005, 07:56 AM
|
#4
|
Red Hat India
Registered: Nov 2004
Location: Kerala/Pune,india
Distribution: RedHat, Fedora
Posts: 260
Rep:
|
Hi wiki,
it's obvious that your firewall is blocking your connection. first of all you must issue the command "iptables -F" which will flush your default iptables that was setup when you installed your OS. after that you have to save your changes by issuing the command " service iptables save". this will save the configuration,. after that you have to configure the new rules. you must issue the command
" iptables -I INPUT -d 'your ip' -j REJECT" . then add this command also..
" iptables -I INPUT -d 178.13.18.18 -j ALLOW".
Remember this will block every connection from any systems except 178.13.18.18.
Another very important configuration that i have to suggest is that you dont flush ur default iptables using the command " iptables -F". let it stay.. you just that issue the command " iptables -I INPUT -d 178.13.18.18 -j ALLOW".
now your 178.13.18.18 will be allowed in. after that always remember to save the service using the command " service iptables save" and restart it using " service iptables restart". this must solve your problem .......
please feel free to contact
vimal........
|
|
|
09-12-2005, 10:51 PM
|
#5
|
LQ Newbie
Registered: Aug 2005
Location: Singapore
Distribution: Red Hat Enterprise Linux WS
Posts: 5
Original Poster
Rep:
|
Hi Vimal,
Thanks a lot! Your suggestion work very well.
|
|
|
All times are GMT -5. The time now is 02:54 AM.
|
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
|
|