LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Unable to access web server from my machine - network cache issue? (https://www.linuxquestions.org/questions/linux-networking-3/unable-to-access-web-server-from-my-machine-network-cache-issue-883682/)

nicky77 05-31-2011 04:46 AM

Unable to access web server from my machine - network cache issue?
 
Hi, I have a weird issue where all of the machines in my office can all connect to our web server, either via DNS or using the server IP directly. However, on my machine, which is using the same network IP as the rest of the office and I know it's not being blacklisted, I can't access the server at all via SSH or web or mail. I'm the only machine running Linux, I've flushed the network cache using nscd, but this made no difference. Can anyone think of what might be going on here?

tronayne 05-31-2011 06:51 AM

When you say "can't," does that mean that you try to connect and are unable to find the server or that you're getting a error message or something else entirely?

How are you finding servers -- via DNS? And, if so, is the address of the DNS server in your /etc/resolv.conf file? Ought to look something like this
Code:

search com
nameserver 68.94.156.1
nameserver 68.94.157.1

(That's two DNS servers, all you really need, but you're going to need some way within your intranet to find servers by name.)

If the server has a fixed-IP address, you could simply put that in /etc/hosts on your machine something like this:
Code:

# For loopbacking.
127.0.0.1              localhost
192.168.1.10            fubar.com fubar

Hope this helps some.

16pide 05-31-2011 06:56 AM

it could be a routing problem,
or it could be a dns problem
or it could be that the others use a proxy to reach the machine, and you don't.
I suggest you go to the command line, and try on a windows machine and on yours:
ping the server by IP address
telnet to port 80 and issue this command:
GET /
then compare the results and that should help you find the issue

nicky77 06-01-2011 04:51 AM

Thanks for the replies. Just going through it all now:

/etc/resolv.conf file

# Generated by NetworkManager
nameserver 192.168.0.1


/etc/hosts

127.0.0.1 localhost.localdomain localhost
::1 nicky-desktop localhost6.localdomain6 localhost6
127.0.1.1 nicky-desktop

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

I can ping the server IP fine, but any attempt to connect via ssh or telnet fails with a connection timed out error. The traceroute output is the same on my machine as on windows machines in my office. There's nothing listed on the firewall rules under chain INPUT, FORWARD and OUTPUT.

If there's anything else I can check which might help, grateful for any pointers.

tronayne 06-01-2011 07:24 AM

The entry in /etc/resolv.conf looks like a router gateway address and that may be a problem.

In my experience (which may have nothing whatsoever to do with your problem but it's worth a shot), routers can serve as a DNS server but they're not refreshed and after some time quit and you can't get anywhere. This has been my experience with Linksys routers and a couple of others than I can't remember the names of. Your intranet should have a DNS server address that is fed to Windows boxes that are connecting with DHCP (which is typical) -- check the address in a Windows box (or just ask the network administrator what the DNS server address(es) are and see if that helps.

The test would be if you can't ping the outside world, say new.google.com, then you don't have a DNS server address specified. Might be worth a couple of minutes to put a public server address in /etc/resolv.conf, for example Google public DNS servers
Code:

search com
nameserver 8.8.8.8
nameserver 8.8.4.4

Note that 192.168.0.1 is a gateway but most likely not a server address (which would be something like 192.168.0.100 or something); you need to find out what that address is. Pinging 192.168.0.1 is the gateway responding to you (so, yeah, you're getting to the gateway) but not the server (so, no, you're not going to get an SSH connection). It's address could be anything but 192.168.0.1.

Hope this helps some.

[EDIT]
Forgot -- if you know the name and address of the server, put that in your /etc/hosts file, won't hurt anything else, probably will help.
[/EDIT]

nicky77 06-01-2011 08:43 AM

Thanks @tronayne - I've added the name and address of the server to /etc/hosts, which currently doesn't make a difference. I tried putting the Google DNS servers in /etc/resolv.conf and could ping new.google.com fine. I should point out (and should have clarified this before now) that the server I can't connect to is a remote web server. I can ping the web server by name or IP, but can't make any connection to it. If i look at the server logs, there is no record of any refused connection from my IP (which is probably to be expected).

192.168.0.1 is the address of the netgear router we use in the this office and I am still being assigned the same IP as the other machines running Windows and OS X.

I'm going to look more into the differences between the iconfig output i'm getting and the output on the other machines. In the meantime, any suggestions most welcome!

tronayne 06-01-2011 09:00 AM

Quote:

Originally Posted by nicky77 (Post 4373080)
I should point out (and should have clarified this before now) that the server I can't connect to is a remote web server. I can ping the web server by name or IP, but can't make any connection to it. If i look at the server logs, there is no record of any refused connection from my IP (which is probably to be expected).

Are you sure that SSH is running on that server and, if so, at what port number? If it's not the default port number (22), you need to add the port being used to your connection attempt. Too, do you have to be specifically allowed on the server (or tunneled through its IPTABLES or similar)?

nicky77 06-01-2011 09:10 AM

Yes I can connect fine using SSH on any other machine in the office, just not my own. I've checked with the server admins and they can't see any reason why i shouldn't be able to connect. All very strange - quite possibly something glaringly obvious which I'll kick myself for, but I have no idea what that is right now.

tronayne 06-01-2011 09:49 AM

Um, the only other thing I can think of is the router -- is it passing port 22 (or whatever the actual port number is)? That typically is not enabled by default in the router setup.

nicky77 06-01-2011 10:27 AM

I'm just looking at the router config at the moment, i don't seem to have access to the port forwarding info on this unfortunately. Nothing in our internal networking and routing setup has changed at all, just our web server which is external. I get the timeout issue when i try to connect to it via SSH, FTP and HTTP, but these are all using the standard ports and can be accessed fine from any machine other than mine.

Checking iptables on my machine, I get the following, which is probably not all that useful but provides some more detail.

nicky@nicky-desktop:~/AptanaStudio3$ sudo iptables --list
[sudo] password for nicky:
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

nicky77 06-16-2011 05:30 AM

This may or may not be useful in trying to figure out what's going on here, but I've since had the same issue on a new machine which dual boots Windows 7 and a clean install of Ubuntu. On Windows, I can access the server by host or IP absolutely fine, but on Ubuntu I get the timeout problem. I also tried Linux Mint from the live CD and had the same issue there too. Very strange!


All times are GMT -5. The time now is 07:50 AM.