This discussion is archived
14 Replies Latest reply: Feb 27, 2008 4:52 PM by 807603 RSS

Firewall help needed

807603 Newbie
Currently Being Moderated
I am trying to make a application where different computers( clients) can connect to one computer which is running the server. Right now it works if the clients and the server are on the same computer. When i try to do it on different computers, i just get errors. Is there some firewall or proxy setting that i need to change to make this work. i am using eclipse if it makes a difference. Thanks!
  • 1. Re: Firewall help needed
    791266 Explorer
    Currently Being Moderated
    Open the server port in the firewall (on the server machine or on the machine that is protecting the server)

    Kaj

    Edited by: kajbj on Feb 27, 2008 4:51 PM
  • 2. Re: Firewall help needed
    807603 Newbie
    Currently Being Moderated
    kajbj wrote:
    Open the server port in the firewall (on the server machine or on the machine that is protecting the server)
    Do you know how to do this on a mac?
  • 3. Re: Firewall help needed
    800645 Newbie
    Currently Being Moderated
    Please give more details about the error you're getting. It's a connection time out, refused or what?

    Before you test your program execute a telnet to the server/port and if you get any response, maybe the problem is not in the network configuration. You can do this way (in a unix shell):

    $ telnet host_ip port
    i.e
    $ telnet 10.10.10.1 8080

    Is the server deployed in a mac box?

    Regards
  • 4. Re: Firewall help needed
    807603 Newbie
    Currently Being Moderated
    hjuarez wrote:
    Please give more details about the error you're getting. It's a connection time out, refused or what?
    it is a connection time out exception. When i startthe program, it shows a blank screne for about 20 seconds and then gives the connection time out exception. I am pretty sure that it is the computers and not the code because i tried connecting two computers on our network with Java's code from the tutorial and it did not work
  • 5. Re: Firewall help needed
    807603 Newbie
    Currently Being Moderated
    >
    Before you test your program execute a telnet to the server/port and if you get any response, maybe the problem is not in the network configuration. You can do this way (in a unix shell):
    cmd is blocked on my computer, is there a way to find/make open ports using java?
  • 6. Re: Firewall help needed
    800645 Newbie
    Currently Being Moderated
    It seems to be much easier to disable the mac box firewall. Take a look at:

    http://kb.iu.edu/data/aozg.html

    Often , when your machine are firewalled, the packets are dropped and you receive a Connection Refused. This behavior is configurable in most firewall programs, so you can try to disable the server firewall and try again.

    Try to use the "Execute..." menu to launch the telnet program as I post it before.

    Regards
  • 7. Re: Firewall help needed
    807603 Newbie
    Currently Being Moderated
    thanks for the info, i'll try it out. do you know if i need to disable the firewall on the client side aswell?
  • 8. Re: Firewall help needed
    800645 Newbie
    Currently Being Moderated
    Sure, you must do it. At least you have to enable the outgoing packages, but if you don't have to enforce high security in your applications, just disable the firewall in your client as well.

    Regards
  • 9. Re: Firewall help needed
    807603 Newbie
    Currently Being Moderated
    thank you. i will test it out now
  • 10. Re: Firewall help needed
    807603 Newbie
    Currently Being Moderated
    hjuarez wrote:

    Before you test your program execute a telnet to the server/port and if you get any response, maybe the problem is not in the network configuration. You can do this way (in a unix shell):

    $ telnet host_ip port
    i.e
    $ telnet 10.10.10.1 8080
    when i do the telnet, it comes up with this:
    Trying (IP)...
    telnet: connect to address (IP): Connection refused
    telnet: Unable to connect to remote host

    do you have any ideas what to do?
  • 11. Re: Firewall help needed
    800645 Newbie
    Currently Being Moderated
    If you've disabled both firewalls, you have network connectivity problems. If not, disable them.

    Once disabled, check if the machines can see each other. you can use ping, if the ping succeed, you have network connectivity , therefore the problem is in the server socket listener, maybe the port listener only listen in the local interface. If the ping fails, maybe you don't have configured the network correctly.

    In order to see if the socket listener is up, in the mac machine try:

    netstat -an

    you must see the server port active.

    I think the most probable issue you're facing is the network configuration. First be sure if the network is OK, only then check the sockets, firewall, etc.
  • 12. Re: Firewall help needed
    807603 Newbie
    Currently Being Moderated
    thanks, i got it to work now. i had to disable both firewalls and change some settings on my router. one last question, do computers have to be on my local network to connect?
  • 13. Re: Firewall help needed
    800645 Newbie
    Currently Being Moderated
    It is not necessary, but if you want that other subnetworks can connect, ensure that exist routes from the other subnetworks to your server. If there's connectivity, your program will work.
  • 14. Re: Firewall help needed
    807603 Newbie
    Currently Being Moderated
    thank you very much for your help!!!