LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Network very slow if static ip settings but fine with DHCP (https://www.linuxquestions.org/questions/linux-networking-3/network-very-slow-if-static-ip-settings-but-fine-with-dhcp-785051/)

im1crazyassmofo 01-27-2010 07:49 AM

Network very slow if static ip settings but fine with DHCP
 
I've been using slackware for many years. I think I started with Slack 8. I know how to configure the network, I've had this same POS Dell computer for a few years now but the other day I tried to go to a different distro (first mistake) everything worked fine but it was not for me. Once you go slack you never go back! Anyway I had slack on here prior to the change and it all worked fine. I'm running slack 13 and all of a sudden my network is slow as balls! I set it up as I always have so I did some research and tried a few things, nothing worked. So i enabled DHCP and its fine now.. I have a dell xps 420. onboard intel nic. worked fine when i first installed slack 13. Anyone have any clue what to do? I would like my static IP on this machine.

tronayne 01-27-2010 08:29 AM

Well, you didn't mention what you're using for an internet connection -- got a router, doing dial-up, connected directly to the NIC?

But this kinda sounds like maybe you haven't got DNS server entries in /etc/resolv.conf?

I've been using fixed-IP forever (and have no intent to ever switch); I have a DSL modem connected to a Linsys 4-port router and all my systems are fixed-IP. They all have entries in /etc/hosts of this form:
Code:

# For loopbacking.
127.0.0.1              localhost
192.168.1.10            fubar.com fubar
192.168.1.15            InkJet
192.168.1.20            snafu.com snafu
192.168.1.30            pita.com pita

They all talk to the world and to each other with zero problems (and they all send print jobs to "InkJet" with CUPS).
Here's the relevant entries from /etc/rc.d/rc.inet1.conf (the examples at the bottom are all commented-out so they're not in this list):
Code:

# Config information for eth0:
IPADDR[0]="192.168.1.10"     
NETMASK[0]="255.255.255.0"   
USE_DHCP[0]=""               
DHCP_HOSTNAME[0]=""         

# Config information for eth1:
IPADDR[1]=""                 
NETMASK[1]=""               
USE_DHCP[1]=""               
DHCP_HOSTNAME[1]=""         

# Config information for eth2:
IPADDR[2]=""                 
NETMASK[2]=""               
USE_DHCP[2]=""               
DHCP_HOSTNAME[2]=""         

# Config information for eth3:
IPADDR[3]=""                 
NETMASK[3]=""               
USE_DHCP[3]=""               
DHCP_HOSTNAME[3]=""         

# Default gateway IP address:
GATEWAY="192.168.1.1"       

# Change this to "yes" for debugging output to stdout.  Unfortunately,
# /sbin/hotplug seems to disable stdout so you'll only see debugging output
# when rc.inet1 is called directly.                                       
DEBUG_ETH_UP="no"

Hope this helps some.

im1crazyassmofo 01-28-2010 08:00 AM

I checked those two files and everything is OK. I'm using a cable modem hooked up to a Linksys wireless router. This machine is wired though. I've been trying to fix this for awhile. Today DHCP was not working. It was very slow so now I'm really confused.

/dev/me 01-28-2010 09:09 AM

I saw the same symptoms once, which turned out to be a DNS related issue. Is there a difference in DNS between static and DHCP?

tronayne 01-28-2010 11:28 AM

Well, a difference is that static IP doesn't wipe out /etc/resolv.conf. You have to prevent that with DHCP by removing the comment-out # in /etc/inent1.conf on the line
Quote:

#DHCP_KEEPRESOLV[4]="yes" # If you dont want /etc/resolv.conf overwritten
Otherwise, if you ever start up DHCP, your /etc/resov.conf will be wiped out.

You know, another thing might be if you're using the router as a DNS server; they sorta-kinda will for a while then they tend to not want to work any more. My ISP provides two DNS server addresses (that I keep in /etc/resolv.conf); if yours does not, I would highly recommend that you find at least two open DNS servers and stick 'em in /etc/resolv.conf (and do the DHCP thing above). Someplace like http://www.dnsserverlist.org provides a list and you want to ping 'em to find two that are electrically close to you. You want to use two in case one of them is not available every so often. For example, two arbitrarily picked from the list would look like this in /etc/resolv.conf:
Code:

search com
nameserver 64.81.79.2
nameserver 69.111.95.106

The above is what you'll get if you define a nameserver address when running netconfig.

im1crazyassmofo 01-29-2010 06:55 AM

Seems to be working now... I did the first step there a few days ago, and the second step I also did but before but I must have been using a slow dns server. dnsserverlist.org worked great! I put their recommended servers in and walla!

Thanks alot for the help.

catkin 01-29-2010 07:05 AM

Quote:

Originally Posted by im1crazyassmofo (Post 3844763)
dnsserverlist.org worked great! I put their recommended servers in and walla!

Your ISP's DNS servers should (TM) be faster than third party's DNS servers because they are closer in network terms.

You could modify the script in this LQ post to measure the response time of whichever DNS servers you use (including your ISP's).

If your ISP's DNS servers are erratic, you could use dnsmsq; it can be configured to use many DNS servers; at start up it tests the response time of them all; log inspection shows it then switches servers dynamically, presumably to use the current fastest.


All times are GMT -5. The time now is 10:38 AM.