?
Solved

Connecting Linux static IP to linksys router

Posted on 2004-11-29
19
Medium Priority
?
328 Views
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 (192.168.1.1) and the other XP box (192.168.1.100 via DHCP) on the lan. The linux box has a static ip (192.168.1.102).

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

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

Expert Comment

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

Author Comment

by:ethereal11
ID: 12699828
I set that to 192.168.1.1 - 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.
0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 12700485
Hi,

   Do "ipconfig /all" from your XP machine and write down the DNS servers.
Edit /etc/resolv.conf put the DNS servers' IPs in it. 192.168.1.1 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 192.168.1.1
You need to reboot to take effect.
Or login as root and run
route add default gw 192.168.1.1   <=== add default gateway manually
and
netstat -rn    <=== check the routing table

Wesly
0
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

by:ethereal11
ID: 12700743
ok:

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 192.168.1.1
4) when I typed 'route add default gw 192.168.1.1' I get SIOCADDRT: File exists
- because -
5) 'netstat -rn' shows that 192.168.1.1 is already the default gateway.
Its the 3rd line:
0.0.0.0           192.168.1.1          0.0.0.0        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.

Thoughts?
0
 
LVL 38

Expert Comment

by:wesly_chen
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?

Wesly
0
 

Author Comment

by:ethereal11
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. . . . . . . . . . . . : 192.168.1.100
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.1.1
        DHCP Server . . . . . . . . . . . : 192.168.1.1
        DNS Servers . . . . . . . . . . . : 24.0.48.33
                                            24.0.48.34
                                            204.127.198.4
        Lease Obtained. . . . . . . . . . : Monday, November 29, 2004 6:47:15 AM

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

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

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 eth0

[root (bad-kitty8)  /etc]# cat /etc/hosts
127.0.0.1               localhost
192.168.1.102           bad-kitty8
[root (bad-kitty8)  /etc]# cat /etc/resolv.conf
nameserver 24.0.48.33
nameserver 24.0.48.34

0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 12701008
So can you "ping 24.0.48.33"?
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?

Wesly
0
 

Author Comment

by:ethereal11
ID: 12701210
I can ping 24.0.48.33. 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

0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 12701270
For DNS client, there are 2 files involved.
/etc/resolv.conf
/etc/nsswitch.conf

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).

Wesly
0
 

Author Comment

by:ethereal11
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.


0
 

Author Comment

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

Expert Comment

by:wesly_chen
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.

Wesly
0
 

Author Comment

by:ethereal11
ID: 12701392
I changed the line to

hosts: files dns

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

Expert Comment

by:wesly_chen
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 24.0.48.33 (enter)
www.yahoo.com
> exit

Wesly
0
 

Author Comment

by:ethereal11
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 24.0.48.33
Default server: 24.0.48.33
Address: 24.0.48.33#53
www.yahoo.com
;; 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).
0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 12701580
> Address: 24.0.48.33#53
www.yahoo.com
> ;; connection timed out; no servers could be reached
You can ping 24.0.48.33 but you can not querry DNS from 24.0.48.33 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:
http://doc.mandrakelinux.com/MandrakeLinux/91/en/Starter.html/tinyfirewall.html

Wesly
0
 

Author Comment

by:ethereal11
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.
0
 
LVL 38

Accepted Solution

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

Wesly
0
 

Author Comment

by:ethereal11
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!

Bleah.

You get the points for sticking with this.

Thanks for your perseverance!
0

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