LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Internet works on windows fine, but doesn't work in linux for some websites (https://www.linuxquestions.org/questions/linux-networking-3/internet-works-on-windows-fine-but-doesnt-work-in-linux-for-some-websites-862522/)

TimmyTurner 02-14-2011 12:27 AM

Internet works on windows fine, but doesn't work in linux for some websites
 
Hi all
Here I've an amazing and odd problem and I don't understand it!
I have Debian 6 and a Windows XP on my PC, and Debian sid and opensuse 11.3 and Windows 7 on my netbook.
Several days ago, I couldn't access some websites through linux anymore, but it works fine in windows and I tested in 2 devices (my PC and my netbook).
I found out that it is only about some websites! I mean some of them are accessible and some other are not!
It's really odd and strange.
I have a TP-Link TP-W8901G Wireless ADSL Modem Router and was set for PPPoE mode. I changed that to Bridge mode. This time all websites are accessible in linux but internet is very slow. I even tried using a D-Link DSL322T ADSL Modem, but I got same results.
It's really amazing because I can ping websites like google.com but I can't open them while modem works on PPPoE.
several same problems are reported since last week. Is ISP responsible for this problem? Because I really can't understand why things work fine in Windows but not in linux.
I'm sure about configurations. I tried a live disc and didn't work too

tronayne 02-14-2011 07:58 AM

That sounds an awful lot like a DNS server problem; take a look at /etc/resolv.conf and, if it's empty, add the following:
Code:

sudo vi /etc/resolv.conf
<insert these three lines>
search com
nameserver 8.8.8.8
nameserver 8.8.4.4
<save and exit>

Those are Google public DNS server addresses (see http://code.google.com/speed/public-dns/docs/using.html. You could instead use the DNS server addresses your ISP should have provided you; two is fine, three is maximum (on most systems), more than three is useless.

If /etc/resolv.conf was empty and you added the above, you should immediately see things go-fast.

If you're using DHCP on your servers, look for your "inet1.conf" (or similar name; I don't know what that is in Debian); it contains the settings for your network interface. Somewhere there will be a pattern something like this:
Code:

#HWADDR[4]="00:01:23:45:67:89"  # Overrule the card's hardware MAC address
#MTU[4]=""                      # The default MTU is 1500, but you might need
                                # 1360 when you use NAT'ed IPSec traffic.
DHCP_KEEPRESOLV[4]="yes"      # If you don't want /etc/resolv.conf overwritten
#DHCP_KEEPNTP[4]="yes"          # If you don't want ntp.conf overwritten
#DHCP_KEEPGW[4]="yes"          # If you don't want the DHCP server to change
                                # your default gateway

You probably do not want to un-comment any of the setting except DHCP_KEEPRESOLV (as shown above); un-commenting that will keep the DNS server setting in /etc/resolv.conf and won't allow DHCP to overwrite them. Leave the rest alone (unless you set them on purpose previously).

PPPoE is one method for connecting your modem to your ISP (and, your ISP should have told you what method to use) and really doesn't have much of anything to do with this sort of thing. If that's what your ISP said to use, that's what you use (and vice-versa if told some other method).

Windows, typically, is connected with DHCP and ISP-provided DNS server address(es) are force-fed to Windows upon connection. Your router is most likely running a DHCP server, thus "leasing" a connection to Windows and setting the DNS server address(es).

If you're using fixed-IP addressing for your servers, the above entries and DHCP_KEEPRESOLV will also "fix" much of the problem; you have to have DNS server addresses to be able to find things on the Internet. Many routers provide DNS services but they tend to... oh, time-out might be the best way to say it -- they'll work for some period of time and then cease to respond (don't know why, just know that it happens). Keeping DNS server entries in /etc/resolv.conf generally make life better.

Hope this helps some.

TimmyTurner 02-14-2011 11:39 AM

Greatest answer I've got in forums during my life. You're a god guy:)

syg00 02-14-2011 12:12 PM

In which case I hope you enhanced @tronayne reputation ... (click on "rep" under the name)

TimmyTurner 02-15-2011 04:08 AM

Dear tronayne, you explained your idea beautifully and it was so nice. But it couldn't solve the problem :'-(

TimmyTurner 02-15-2011 04:30 AM

In technotux forums I got this answer:
echo 0 > /proc/sys/net/ipv4/tcp_timestamps

And it works right now. But what was the problem?

tronayne 02-15-2011 04:57 AM

There is one (really goofy) thing I remember having to do every so often with an ADSL modem. Every once in a while things would get painfully slow (well, not as painful as dial-up, but slow). The solution was to turn off the modem (with its power switch) and unplug the power supply line from the modem jack for, oh, something like three minutes then plug the jack back in and turn it back on. That would make it reconnect, get a new IP address and buzz along fat, dumb and happy. This usually happened when there was a big rainstorm, windstorm or some sort of atmospheric thing that messed up the telephone lines one way or the other (and every once in a while just for the heck of it apparently; sunspots, moonspots, who knows spots). Maybe give that a shot -- disconnect the power from the modem(s) and let 'em sit for a few minutes. I seem to recall being told to actually pull the power plug from the modem, not just pull the transformer from the wall plug (again, who knows) and that was effective.

Maybe?

Hope this helps some.

tronayne 02-15-2011 05:10 AM

Quote:

Originally Posted by TimmyTurner (Post 4258900)
In technotux forums I got this answer:
echo 0 > /proc/sys/net/ipv4/tcp_timestamps

And it works right now. But what was the problem?

Well, there's one I've never heard of. Great.

Did a little searching around and found this http://www.saintcorporation.com/cgi-...ct_color=&tag=. One of the points in the article is
Quote:

The Problem

TCP timestamps are enabled on the remote host. This could allow a remote attacker to estimate the amount of time since the remote host was last booted.

Resolution

TCP timestamps are generally only useful for testing, and support for them should be disabled if not needed.

To disable TCP timestamps on Linux, add the following line to the /etc/sysctl.conf file:

net.ipv4.tcp_timestamps = 0
Dang. Learn something new every so often.

TimmyTurner 02-15-2011 10:22 AM

That was beautiful. But, can't it cause reducing security and disabling my privacy in Internet? (sorry for this silly question, I'm new in TCP/IP stuffs)

tronayne 02-15-2011 11:59 AM

Well, on my servers there is nothing in /proc/sys/net/ipv4/tcp_timestamps; it's just an empty file. Too, I do not have a /etc/sysctl.conf file. The above
Quote:

TCP timestamps are generally only useful for testing, and support for them should be disabled if not needed.
tells me that (1) I don't want it, (2) I don't need it, and (3) if I've got it I want to turn it off. I'd simply create /etc/sysctl.conf and add net.ipv4.tcp_timestamps = 0 to it (as suggested above) to enahnce security.

If that file already exists in /etc/sysctl.conf with an enabling entry (the zero would be a one), I'd change it zero.

Over the years there have been a few thing pop up (like testing turned on in basic utilities, leaving a "back door" open, that an administrator was supposed to know to turn off); I kind of think this may be one of those.

Hope this helps some.

TimothyEBaldwin 02-27-2011 10:45 AM

Quote:

TCP timestamps are generally only useful for testing, and support for them should be disabled if not needed.
That is simply false, as explained in RFC1323, which is cited by that website.


All times are GMT -5. The time now is 05:53 AM.