Connecting Linux static IP to linksys router

Posted on 2004-11-29
Medium Priority
Last Modified: 2010-08-05
have a machine formerly used on a corp lan via a linux firewall. I want to use it at home via my linksys box. I can't seem to get this box to connect to the internet via the linksys device.

The machine can ping the linksys box ( and the other XP box ( via DHCP) on the lan. The linux box has a static ip (

I have set the /etc/sysconfig/network gateway to

what else needs to be set?
Question by:ethereal11
  • 10
  • 8
LVL 17

Expert Comment

ID: 12699713
You need to add dns servers in /etc/resolv.conf  -
nameserver ip-of-isps-dns-server1
nameserver ip-of-isps-dns-server2

Author Comment

ID: 12699828
I set that to - the linksys ip.. not good enough?

there is some connection problem somewhere as I can't ping a known net ip address either.
EG I can ping 'cnn.com' from my xp box but not from the linux box.
LVL 38

Expert Comment

ID: 12700485

   Do "ipconfig /all" from your XP machine and write down the DNS servers.
Edit /etc/resolv.conf put the DNS servers' IPs in it. is not a DNS server.

Edit /etc/nsswitch.conf and modify the line:
hosts:  files dns      <== make sure you have "dns"

> set the /etc/sysconfig/network gateway to
You need to reboot to take effect.
Or login as root and run
route add default gw   <=== add default gateway manually
netstat -rn    <=== check the routing table

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database


Author Comment

ID: 12700743

1) added 2 'nameserver' entries to /etc/resolv.conf based on output from the XP machine
2) checked /etc/nsswitch - made sure that 'dns' and 'files' were in the 'hosts' line
3) set /etc/sysconfig/network 'gateway' to
4) when I typed 'route add default gw' I get SIOCADDRT: File exists
- because -
5) 'netstat -rn' shows that is already the default gateway.
Its the 3rd line:         UG   0  0           0 eth0

I tried 'dig yahoo.com' and got 'timed out: no servers could be reached'.

Attempts to ping outside of the local lan don't work. Pings within the LAN do work as does pinging the linksys box.

LVL 38

Expert Comment

ID: 12700779
Could you provide the output of
"ipconfig /all" from XP box
"netstat -rn" "cat /etc/hosts" and "cat /etc/resolv.conf" from Linux box?


Author Comment

ID: 12700961
C:\Documents and Settings\default>ipconfig /all

Windows IP Configuration

        Host Name . . . . . . . . . . . . : bad-kitty4
        Primary Dns Suffix  . . . . . . . :
        Node Type . . . . . . . . . . . . : Unknown
        IP Routing Enabled. . . . . . . . : No
        WINS Proxy Enabled. . . . . . . . : No
        DNS Suffix Search List. . . . . . : comcast.net

Ethernet adapter Local Area Connection:

        Connection-specific DNS Suffix  . : comcast.net
        Description . . . . . . . . . . . : 3Com 3C920 Integrated Fast Ethernet
Controller (3C905C-TX Compatible)
        Physical Address. . . . . . . . . : 00-B0-D0-F8-5B-AD
        Dhcp Enabled. . . . . . . . . . . : Yes
        Autoconfiguration Enabled . . . . : Yes
        IP Address. . . . . . . . . . . . :
        Subnet Mask . . . . . . . . . . . :
        Default Gateway . . . . . . . . . :
        DHCP Server . . . . . . . . . . . :
        DNS Servers . . . . . . . . . . . :
        Lease Obtained. . . . . . . . . . : Monday, November 29, 2004 6:47:15 AM

        Lease Expires . . . . . . . . . . : Wednesday, December 01, 2004 6:47:15

[root (bad-kitty8)  /etc]# netstat -rn
Kernel IP routing table

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface   U         0 0          0 eth0       U         0 0          0 lo         UG        0 0          0 eth0

[root (bad-kitty8)  /etc]# cat /etc/hosts               localhost           bad-kitty8
[root (bad-kitty8)  /etc]# cat /etc/resolv.conf

LVL 38

Expert Comment

ID: 12701008
So can you "ping"?
Do you have any firewall setting on your Linux box?
Do "iptables -L" and post the result here?
Which Linux you have? RedHat/Fedora or SuSE?


Author Comment

ID: 12701210
I can ping I tried this earlier with an address from CNN.com and got nothing. V cool. That means that packets are moving back and forth. Now its just a DNS issue.

I still can't 'dig yahoo.com'.

No firewall settings on this box.

[root (bad-kitty8)  /etc]# iptables -L
bash: iptables: command not found

LVL 38

Expert Comment

ID: 12701270
For DNS client, there are 2 files involved.

Could you provide
1. post the /etc/nsswitch.conf
2. nslookup www.yahoo.com
3. Which Linux

> [root (bad-kitty8)  /etc]# iptables -L
> bash: iptables: command not found
That means you can find the iptables commands (/sbin/iptables).


Author Comment

ID: 12701294
passwd:     files nisplus nis
shadow:     files nisplus nis
group:      files nisplus nis

#hosts:     db files nisplus nis dns
hosts:      files nisplus nis dns

bootparams: nisplus [NOTFOUND=return] files

ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files

netgroup:   nisplus

publickey:  nisplus

automount:  files nisplus
aliases:    files nisplus

[root (bad-kitty8)  /etc]# nslookup yahoo.com
;; connection timed out; no servers could be reached

No 'iptables' under /sbin.

Im running Mandrake v9.1.


Author Comment

ID: 12701304
BTW: I upped the points to 250. Thanks for sticking with me here.
LVL 38

Expert Comment

ID: 12701330
> hosts:      files nisplus nis dns
Do you have NIS+ or NIS server in you rnetwork?
Could you change to
hosts:   files dns nis nisplus
And try dig or nslookup.


Author Comment

ID: 12701392
I changed the line to

hosts: files dns

tried 'dig yahoo.com' - unsuccesful.
LVL 38

Expert Comment

ID: 12701447
Please do
grep 53 /etc/services
and post result. Make sure you have (add them if not)
domain          53/tcp
domain          53/udp

Besides, please do
nslookup (enter)
> server (enter)
> exit


Author Comment

ID: 12701479
[root (bad-kitty8)  /home/jony]# cd /etc
[root (bad-kitty8)  /etc]# grep 53 /etc/services
# The Dynamic and/or Private Ports are those from 49152 through 65535
domain          53/tcp                          # name-domain server
domain          53/udp
gdomap          538/tcp                         # GNUstep distributed objects
gdomap          538/udp                         # GNUstep distributed objects
iiop            535/tcp
iiop            535/udp
courier         530/tcp         rpc
conference      531/tcp         chat
netnews         532/tcp
netwall         533/udp                         # -for emergency broadcasts
cfengine        5308/tcp                        # CFengine
cfengine        5308/udp                        # CFengine
knetd           2053/tcp                        # Kerberos de-multiplexor
rndc            953/tcp                         # rndc control sockets (BIND 9)
rndc            953/udp                         # rndc control sockets (BIND 9)
noclog          5354/tcp                        # noclogd with TCP (nocol)
noclog          5354/udp                        # noclogd with UDP (nocol)
hostmon         5355/tcp                        # hostmon uses TCP (nocol)
hostmon         5355/udp                        # hostmon uses TCP (nocol)
[root (bad-kitty8)  /etc]# nslookup
Note:  nslookup is deprecated and may be removed from future releases.
Consider using the `dig' or `host' programs instead.  Run nslookup with
the `-sil[ent]' option to prevent this message from appearing.
> server
Default server:
;; connection timed out; no servers could be reached

FWIW: this system was part of a small office network recently. It worked fine when running through a linux firewall and DNS server(on different machines).
LVL 38

Expert Comment

ID: 12701580
> Address:
> ;; connection timed out; no servers could be reached
You can ping but you can not querry DNS from through UDP port 53.
So it sounds to me is firewall issue (block UDP 53).
You might want to check your system/network setting for firewall (since it's not use iptables).
The following is a reference:


Author Comment

ID: 12702064
Doesn't seem like it could be a firewall issue. There isn't one running on this machine. It used to work fine when routing to the net via a separate box.
LVL 38

Accepted Solution

wesly_chen earned 1000 total points
ID: 12702104
Could you please provide the following results:
ifconfig -a
ping    (one of IP for www.yahoo.com)


Author Comment

ID: 12702308
Problem solved. I added more DNS entries from my cable provider. I think the ones listed in the modem aren't answering... so this is a problem on the other end!


You get the points for sticking with this.

Thanks for your perseverance!

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question