LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-08-2009, 11:20 AM   #1
mattca
Member
 
Registered: Jan 2009
Distribution: Slackware 14.1
Posts: 333

Rep: Reputation: 56
Can't connect outside network


Hi, I have a server here running Mandriva 2009.1, and it can't see the outside world at all. I can connect to it from another computer on the same network via SSH, and it has been used as an NFS server for some time without issue, but those connections are all in-network as well. I'm trying to install an FTP server, and urpmi just hangs when I try. Then I tried pinging a few addresses and they all come back as "host not found". Here is some hopefully useful information:

Code:
[root@localhost matt]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:22:15:D9:04:83  
          inet addr:192.168.0.31  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::222:15ff:fed9:483/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4168469 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5359809 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:984702605 (939.0 MiB)  TX bytes:3214294446 (2.9 GiB)
          Interrupt:20 Base address:0x8000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:584 errors:0 dropped:0 overruns:0 frame:0
          TX packets:584 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:48964 (47.8 KiB)  TX bytes:48964 (47.8 KiB)
Code:
[root@localhost matt]# netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State      
tcp        0      0 192.168.0.31:ssh            192.168.0.160:57007         ESTABLISHED 
tcp        0      0 192.168.0.31:nfs            192.168.0.152:50240         ESTABLISHED 
tcp        0      0 192.168.0.31:nfs            192.168.0.167:51038         ESTABLISHED 
Active UNIX domain sockets (w/o servers)
Proto RefCnt Flags       Type       State         I-Node Path
unix  2      [ ]         DGRAM                    599    @/org/kernel/udev/udevd
unix  2      [ ]         DGRAM                    3967   @/org/freedesktop/hal/udev_event
unix  11     [ ]         DGRAM                    3823   /dev/log
unix  2      [ ]         DGRAM                    96085  
unix  3      [ ]         STREAM     CONNECTED     94768  
unix  3      [ ]         STREAM     CONNECTED     94767  
unix  2      [ ]         DGRAM                    90567  
unix  3      [ ]         STREAM     CONNECTED     8892   
unix  3      [ ]         STREAM     CONNECTED     8891   
unix  2      [ ]         DGRAM                    8792   
unix  2      [ ]         DGRAM                    8718   
unix  3      [ ]         STREAM     CONNECTED     8716   /var/run/dbus/system_bus_socket
unix  3      [ ]         STREAM     CONNECTED     8715   
unix  2      [ ]         DGRAM                    8709   
unix  2      [ ]         DGRAM                    8539   
unix  3      [ ]         STREAM     CONNECTED     8301   @/tmp/.X11-unix/X0
unix  3      [ ]         STREAM     CONNECTED     8300   
unix  2      [ ]         DGRAM                    8085   
unix  3      [ ]         STREAM     CONNECTED     7970   /var/run/dbus/system_bus_socket
unix  3      [ ]         STREAM     CONNECTED     7969   
unix  3      [ ]         STREAM     CONNECTED     7235   @/tmp/.X11-unix/X0
unix  3      [ ]         STREAM     CONNECTED     7234   
unix  3      [ ]         STREAM     CONNECTED     7197   @/tmp/.X11-unix/X0
unix  3      [ ]         STREAM     CONNECTED     7196   
unix  3      [ ]         STREAM     CONNECTED     7193   /var/run/dbus/system_bus_socket
unix  3      [ ]         STREAM     CONNECTED     7192   
unix  3      [ ]         STREAM     CONNECTED     4623   /var/run/acpid.socket
unix  3      [ ]         STREAM     CONNECTED     4622   
unix  2      [ ]         DGRAM                    4504   
unix  3      [ ]         STREAM     CONNECTED     4503   /var/run/acpid.socket
unix  3      [ ]         STREAM     CONNECTED     4502   
unix  3      [ ]         STREAM     CONNECTED     4497   @/var/run/hald/dbus-W40Aa77roC
unix  3      [ ]         STREAM     CONNECTED     4496   
unix  3      [ ]         STREAM     CONNECTED     4288   @/var/run/hald/dbus-W40Aa77roC
unix  3      [ ]         STREAM     CONNECTED     4287   
unix  3      [ ]         STREAM     CONNECTED     3962   @/var/run/hald/dbus-YvBRmJK8oK
unix  3      [ ]         STREAM     CONNECTED     3961   
unix  3      [ ]         STREAM     CONNECTED     3940   /var/run/dbus/system_bus_socket
unix  3      [ ]         STREAM     CONNECTED     3939   
unix  3      [ ]         STREAM     CONNECTED     3925   /var/run/dbus/system_bus_socket
unix  3      [ ]         STREAM     CONNECTED     3924   
unix  3      [ ]         STREAM     CONNECTED     3894   
unix  3      [ ]         STREAM     CONNECTED     3893   
unix  2      [ ]         DGRAM                    3862
Code:
[root@localhost matt]# iptables --list
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
I don't really know enough about netstat to know if that's the most helpful output, so please feel free to ask for something else. I also don't have direct control over the hardware or network config apart from the config on the box itself. This is a work server, and I don't do the hardware or networking, just the server itself.

Thanks for any help.

[edit: It may be important to know that the network guy assigned this server a static IP address, and I may not have set that up properly. I got it to respond from within the network, obviously, but this is the first time I've had to test connections to outside the network]

Last edited by mattca; 09-08-2009 at 11:39 AM.
 
Old 09-08-2009, 11:52 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,685

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by mattca View Post
Hi, I have a server here running Mandriva 2009.1, and it can't see the outside world at all. I can connect to it from another computer on the same network via SSH, and it has been used as an NFS server for some time without issue, but those connections are all in-network as well. I'm trying to install an FTP server, and urpmi just hangs when I try. Then I tried pinging a few addresses and they all come back as "host not found". Here is some hopefully useful information:

I don't really know enough about netstat to know if that's the most helpful output, so please feel free to ask for something else. I also don't have direct control over the hardware or network config apart from the config on the box itself. This is a work server, and I don't do the hardware or networking, just the server itself.

Thanks for any help.

[edit: It may be important to know that the network guy assigned this server a static IP address, and I may not have set that up properly. I got it to respond from within the network, obviously, but this is the first time I've had to test connections to outside the network]
You probably don't have a default gateway set, from the sound of it. If everything on the same network can reach it, but you can't get outside that one network, that's probably the case. The default gateway tells things where to go, if it can't be found locally. You should be able to get the address from your network guy (and he should have provided it when he gave you the static address, too).

As root:
Code:
route add default gw <ip address he gave you for default gw>
Also, make sure the netmask he gave you is correct, too, as that can cause funny things to happen as well. You can fix that with:
Code:
ifconfig <interface name> netmask <netmask you were given>
Read the man pages for the route and ifconfig commands, and get the info from your network guy.
 
Old 09-08-2009, 11:53 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Post the output of the /sbin/route command. Do you have a default gateway entry? Which ftp package did you try to install. The most commonly one used may be vsftp. You will want to lock down your server and use a firewall before forwarding the FTP port to your server.

Last edited by jschiwal; 09-08-2009 at 11:57 AM.
 
Old 09-08-2009, 11:59 AM   #4
mattca
Member
 
Registered: Jan 2009
Distribution: Slackware 14.1
Posts: 333

Original Poster
Rep: Reputation: 56
Thanks for the replies, that makes a lot of sense. I'll confirm the gateway and mask with the network guy.

From the route output I see the ip address 192.168.0.0 listed.. the ip for this machine is 192.168.0.31. Should those match, or is 192.168.0.0 for something else?

Thanks.

Code:
[root@localhost matt]# /sbin/route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     10     0        0 eth0
link-local      *               255.255.0.0     U     10     0        0 eth0
 
Old 09-08-2009, 01:48 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,685

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by mattca View Post
Thanks for the replies, that makes a lot of sense. I'll confirm the gateway and mask with the network guy.

From the route output I see the ip address 192.168.0.0 listed.. the ip for this machine is 192.168.0.31. Should those match, or is 192.168.0.0 for something else?

Thanks.

Code:
[root@localhost matt]# /sbin/route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     10     0        0 eth0
link-local      *               255.255.0.0     U     10     0        0 eth0
It's for something else, your local network route.

You are missing the default route. Should look something like this:
Code:
default         xx.xx.xx.xx    0.0.0.0         UG    0      0        0 wlan0
The "UG" flags are of note. "G" = Gateway. The man page on route will explain alot..
 
Old 09-08-2009, 01:52 PM   #6
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hello mattca,

the 192.168.0.0 is the networkadress of your own network.
You're missing a gateway, i.e. the ip-adress of the router.

Markus

Edit: TBOne was faster than me... the default route is the route for all traffic with a destination outside your own subnet. And this traffic must pass the gateway.

Last edited by markush; 09-08-2009 at 01:57 PM.
 
Old 09-08-2009, 02:40 PM   #7
mattca
Member
 
Registered: Jan 2009
Distribution: Slackware 14.1
Posts: 333

Original Poster
Rep: Reputation: 56
Thanks everyone, that was really helpful. Now I can ping google's ip address, but not google.com. I assume there is something wrong with the DNS setup, but I'm not sure where to start. Or do I just need to restart some services for the change to filter through?

Thanks for any advice.
 
Old 09-08-2009, 02:48 PM   #8
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hi again,

the problem with DNS is possibly related to the other problem. Since you don't use DHCP you'll have also to specify a DNS-server manually.

Markus
 
Old 09-08-2009, 05:43 PM   #9
mattca
Member
 
Registered: Jan 2009
Distribution: Slackware 14.1
Posts: 333

Original Poster
Rep: Reputation: 56
Thanks everyone, I got it working now. The nameserver was the last missing piece.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
want ubuntu 8.10 to connect to network on BOOT, but still have Network Manager work monkeyman2000 Ubuntu 0 02-13-2009 03:22 PM
Unable to connect to wifi network with network manager. Poss authorization issue openSauce Linux - Networking 14 12-13-2008 10:05 AM
network-manager in FC6 tries to connect to non-existent network notiones Fedora 3 12-22-2006 09:31 PM
Can't connect to network Nylex Linux - Networking 3 07-23-2004 04:54 AM
linux machine does not connect to the network in windows network Bzuco Linux - Networking 2 07-19-2004 04:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration