2

In my LAN network I have a server with Scientific Linux (RedHat or Fedora based distro), I've done yum install nginx but the welcome page is not accessible from other computers in my network.

When I do telnet open localhost 80 and then GET / HTTP/1.0 I get some html code from nginx, so it's running for sure. But when I want to connect remotly, doing telnet open 192.168.3.130 80 I get:

Trying 192.168.3.130...
telnet: Unable to connect to remote host: No route to host

So I assume that there is something wrong with my network settings, maybe iptables or something else?

Next step, I turned off iptables: service iptables stop and it helped, now I can connect remotely using telnet.

So I think, I need to fix my iptables rules. I did some googling and found this rule -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT but it still didn't allow me to connect remotely when iptables is up.

Can someone please help me setting a proper iptables configuration?

fixer1234
  • 27,064
  • 61
  • 75
  • 116
SP5RFD
  • 123
  • 1
  • 5
  • Look into nginx config and check if local connections are allowed. – tikend Jul 01 '13 at 09:40
  • In `/etc/nginx/nginx.conf` there is nothing about local connections. – SP5RFD Jul 01 '13 at 09:44
  • I thing that nginx just ignore telnet connections. If nginx returns html code, it should work just fine. – tikend Jul 01 '13 at 09:46
  • The problem is, that nginx returns html after connecting from telnet localy, when I do it remotely it says `no route to host`, but when I turn off iptables on server, telnet works also remotely. No offence, but I think you didn't read my post ;) – SP5RFD Jul 01 '13 at 09:51
  • I read it, I just understand the problem different, sorry. Can you ping the server? You didn't write that. – tikend Jul 01 '13 at 09:58
  • Yes, I can ping it – SP5RFD Jul 01 '13 at 10:02

1 Answers1

3

Try this

Open the firewall dialog (Applications -> Other -> Firewall) , select "Persistent Configuration" and then proceeded to mark the "http" service as trusted on all zones.

tikend
  • 265
  • 1
  • 12
  • I have only console access to the server, there are no graphic env. installed at all. So I've installed `system-config-firewall-tui` and walked through steps, enabling http access, but... no success :/ – SP5RFD Jul 01 '13 at 10:15
  • 1
    Ok, this works! The problem was, that I had also a global proxy on my machine routing everything out of the local network. Adding http rule and disabling proxy resolved the problem. Thanks @tikend! – SP5RFD Jul 01 '13 at 10:25