# bizarre networking problems

## prash

Hi

Although I'm not entirely new to Linux or Gentoo, I'm more of a user than a hacker/sys admin.  I've got what I think is quite a strange problem, which started when I did a system update (emerge -u system) of Gentoo (I think).

Basically it seems like my computer can't perform certain network functions.  For example I can't telnet or ftp to any machine, either on the local network or on the internet.  I pretty sure rsync is down as well because emerge --sync doesn't work anymore. 

It's almost as if the network connection is down. For example if I try to ftp to the blueyonder mirror site I get:

ftp: connect to address 194.117.143.70: Connection timed out

However, I'm able to ping the server without any problems:

PING 194.117.143.70 (194.117.143.70) 56(84) bytes of data.

64 bytes from 194.117.143.70: icmp_seq=1 ttl=58 time=25.1 ms

64 bytes from 194.117.143.70: icmp_seq=2 ttl=58 time=20.7 ms

64 bytes from 194.117.143.70: icmp_seq=3 ttl=58 time=21.0 ms

I can ftp and telnet to my box without any problems. Furthermore, vnc and samba work perfectly as well (both ways).  Therefore I know for a fact that there's nothing physically wrong with the actual network connection.

Not even sure where to start with this one.  Any help will be greatly appreciated.

Thanks

Prash

----------

## Logician

Hey.  Had a similar problem with my machine when I did a sync as well.  Are you using DHCP to assign yourself an IP?  If so, try setting a static IP, and rebooting.  This may fix your problem - it fixed mine, at least.

----------

## Chris W

Did you upgrade to gentoo-sources-2.6.12-r4 by any chance?

I did that upgrade on my firewall box and IP forward/connection tracking seems to be seriously broken.  The firewall machine can talk to the world no problems, but machines behind it suddenly stopped connecting out.  Revert the kernel and, hey presto, it all works again.

----------

## katsiki

Can you ftp to that second server using its IP address?

```
ftp 194.117.143.70
```

What are the results of,

```
cat /etc/resolv.conf
```

I'm still new at this, but the lines above are safe and easy to check.  Two more complex issues are:

After the upgrade, did you run etc-update?  See my reply in this thread.

Have you updated portage?  There was a new release of portage, which requires updating all your configuration files.  See this thread.

----------

## prash

Hi

Thanks for your replies.

I still haven't been able to solve my problem. I've put down some answers to your questions and hope it'll help.

 *Quote:*   

> Hey. Had a similar problem with my machine when I did a sync as well. Are you using DHCP to assign yourself an IP? If so, try setting a static IP, and rebooting. This may fix your problem - it fixed mine, at least.

 

I've always used a static IP and this hasn't changed as far as I know. I had a look at the output from ifconfig just to confirm this.

 *Quote:*   

> Did you upgrade to gentoo-sources-2.6.12-r4 by any chance?

 

I'm afraid I'm a bit of a dinosaur when it comes to my kernel. I'm still on 2.4.22-r7. I haven't updated the kernel for a while. Although it's possible that my current kernel is a bit old and a new feature on a system app. doesn't work with an old kernel and has therefore broken it.

 *Quote:*   

> Can you ftp to that second server using its IP address? 

 

Putting in an address by name or by IP address results in exactly the same outcome - unable to connect.

My resolv.conf is listed below

```
nameserver 62.30.112.39

nameserver 194.117.134.19

nameserver 62.30.0.39
```

I can connect to all the DNS servers below and I think that aspect of the system works properly.

 *Quote:*   

> After the upgrade, did you run etc-update? See my reply in this thread. 

 

etc-update believes that I have no files that need updating.

 *Quote:*   

> Have you updated portage?

 

My version of portage is up to date as far as I know, I've currently got version 2.0.51.19 on my system.

I hope the above info. is useful. One thing I did notice that could be the culprit is a change in the /etc/services file. My previous file had only one tcp entry for ftp and telnet, eg:

```
ftp        21/tcp

telnet    23/tcp
```

but the new file has two lines per entry, such as

```
ftp        21/tcp

ftp        21/udp

telnet     23/tcp

telnet     23/udp
```

Although removing these extra entries doesn't actually solve anything, my hunch is that the programs that actually use this file have changed in some way. All this is just pure conjecture, I wish I had something a little bit more concrete to go on.

Any more suggestions will be gratefully recieved.

Thanks

Prash

----------

## prash

Hi

I've made a little (I mean little) progress. All the network services work fine within the LAN, it's just connections to the internet that are problematic. Furthermore it seems that only TCP services are affected and not UDP. Hence I'm able to ping servers on the internet but can't connect to them via FTP, etc.

None of the setting on the router have been changed and I'm inclined to think that it's a problem with my linux box.  My hunch is that the last system update has somehow made my machine think it has to use ipv6 protocols, the router won't be able to understand this and hence the problem. Not sure how to go about enabling/disabling ipv6 but I'm going to have a look on the web.

Thanks

Prash

----------

## katsiki

I'm still new to Gentoo.  I would have expected there would have been no changes to /etc/services, unless you would run etc-update and accept the changes it proposes.  Since this configuration file has changed unexpectedly, maybe others have also changed.  Try some basic diagnostics,

```
/sbin/lspci

/sbin/lsmod

cat /etc/modules.autoload.d/kernel-2.4

/sbin/ifconfig -a

/sbin/route -n

cat /etc/hosts

/sbin/netstat -an

cat /etc/networks

```

----------

## katsiki

Also check,

```
cat /etc/conf.d/net
```

Which version of baselayout are you using?

----------

## prash

Thanks katsiki for the info. I'm using baselayout versioni 1.11.12-r4.

Regarding the config files, I was aware of the changes to /etc/services and did ok them because I didn't think it would cause any problems.

I've had a look a the files you've specified but I haven't seen anything that looks odd.  This is most probably because I don't know enough to be able to spot something that is in fact not quite right.  Do you have an idea as to what I need to look for?

Thanks

Prash

----------

## katsiki

Can you send the output of,

```
/sbin/route -n

/bin/netstat -an
```

Are you running ipchains or iptables?

----------

## prash

Hi

Sorry for the delay.

The output for route -n is:

```
Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo

0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
```

and the output for netstat -an is:

```
Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address           Foreign Address         State      

tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      

tcp        0      0 0.0.0.0:5901            0.0.0.0:*               LISTEN      

tcp        0      0 0.0.0.0:5902            0.0.0.0:*               LISTEN      

tcp        0      0 0.0.0.0:5903            0.0.0.0:*               LISTEN      

tcp        0      0 0.0.0.0:6000            0.0.0.0:*               LISTEN      

tcp        0      0 0.0.0.0:5904            0.0.0.0:*               LISTEN      

tcp        0      0 0.0.0.0:6001            0.0.0.0:*               LISTEN      

tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      

tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      

tcp        0      0 0.0.0.0:23              0.0.0.0:*               LISTEN      

tcp        0      0 0.0.0.0:631             0.0.0.0:*               LISTEN      

tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      

tcp        0      0 192.168.0.11:5902       192.168.0.10:1100       ESTABLISHED 

tcp        0     32 192.168.0.11:6001       192.168.0.11:50175      ESTABLISHED 

tcp        0      0 192.168.0.11:6001       192.168.0.11:50174      ESTABLISHED 

tcp        0     32 192.168.0.11:6001       192.168.0.11:50173      ESTABLISHED 

tcp        0      0 192.168.0.11:6001       192.168.0.11:50172      ESTABLISHED 

tcp        0      0 192.168.0.11:6001       192.168.0.11:50171      ESTABLISHED 

tcp        0      0 192.168.0.11:6001       192.168.0.11:50168      ESTABLISHED 

tcp        0      0 192.168.0.11:50173      192.168.0.11:6001       ESTABLISHED

tcp        0      0 192.168.0.11:50172      192.168.0.11:6001       ESTABLISHED 

tcp        0      0 192.168.0.11:50175      192.168.0.11:6001       ESTABLISHED 

tcp        0      0 192.168.0.11:50174      192.168.0.11:6001       ESTABLISHED 

tcp      224      0 192.168.0.11:50168      192.168.0.11:6001       ESTABLISHED 

tcp       32      0 192.168.0.11:50171      192.168.0.11:6001       ESTABLISHED 

tcp        0      0 :::32769                :::*                    LISTEN      

tcp        0      0 :::6000                 :::*                    LISTEN      

udp        0      0 192.168.0.11:137        0.0.0.0:*                           

udp        0      0 0.0.0.0:137             0.0.0.0:*                           

udp        0      0 192.168.0.11:138        0.0.0.0:*                           

udp        0      0 0.0.0.0:138             0.0.0.0:*                           

udp        0      0 0.0.0.0:32803           0.0.0.0:*                           

udp        0      0 0.0.0.0:631             0.0.0.0:*                           

udp        0      0 :::177                  :::*                                

Active UNIX domain sockets (servers and established)

Proto RefCnt Flags       Type       State         I-Node Path

unix  2      [ ACC ]     STREAM     LISTENING     350073 /tmp/.X11-unix/X1

unix  2      [ ACC ]     STREAM     LISTENING     14806  /tmp/.X11-unix/X0

unix  2      [ ACC ]     STREAM     LISTENING     11788  /dev/log

unix  3      [ ]         STREAM     CONNECTED     14834  /tmp/.X11-unix/X0

unix  3      [ ]         STREAM     CONNECTED     14833  

unix  3      [ ]         STREAM     CONNECTED     14829  /tmp/.X11-unix/X0

unix  3      [ ]         STREAM     CONNECTED     14808  

unix  3      [ ]         STREAM     CONNECTED     14204  /dev/log

unix  3      [ ]         STREAM     CONNECTED     14203  

unix  3      [ ]         STREAM     CONNECTED     13678  /dev/log

unix  3      [ ]         STREAM     CONNECTED     13677  

```

I'm pretty sure I've got neither ipchains or iptables installed.

Thanks

Prash

----------

## katsiki

Is your computer configured for static IP address, 192.168.0.0?  This is an invalid host address for a 192.168.0.0/24 network.  Valid host addresses are of the form, 192.168.0.n, where n is 1, 2, 3, ..., or 254.  What is the output of,

```
ifconfig -a

cat /etc/hosts

cat /etc/conf.d/net

```

Can you ftp to the WAN from your other machine?

----------

## prash

The IP address of my gentoo machine is 192.168.0.11. The output of ifconfig -a is:

```
eth0      Link encap:Ethernet  HWaddr 00:50:BA:2A:44:4B  

          inet addr:192.168.0.11  Bcast:192.168.0.255  Mask:255.255.255.0

          inet6 addr: fe80::250:baff:fe2a:444b/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:589468 errors:0 dropped:0 overruns:0 frame:0

          TX packets:389946 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:100 

          RX bytes:134478837 (128.2 Mb)  TX bytes:37991279 (36.2 Mb)

          Interrupt:5 Base address:0xe000 

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:783280 errors:0 dropped:0 overruns:0 frame:0

          TX packets:783280 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:274799238 (262.0 Mb)  TX bytes:274799238 (262.0 Mb)

sit0      Link encap:IPv6-in-IPv4  

          NOARP  MTU:1480  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

```

cat /etc/hosts

```
127.0.0.1       localhost

192.168.0.11    rambha.home     rambha

192.168.0.10    urvashi.home    urvashi

# IPV6 versions of localhost and co

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

ff02::3 ip6-allhosts

```

cat /etc/conf.d/net

```
# /etc/conf.d/net:

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

# Global config file for net.* rc-scripts

# This is basically the ifconfig argument without the ifconfig $iface

#

iface_eth0="192.168.0.11 broadcast 192.168.0.255 netmask 255.255.255.0"

#iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"

# For DHCP set iface_eth? to "dhcp"

# For passing options to dhcpcd use dhcpcd_eth?

#

#iface_eth0="dhcp"

#dhcpcd_eth0="..."

# For adding aliases to a interface

#

#alias_eth0="192.168.0.3 192.168.0.4"

# NB:  The next is only used for aliases.

#

# To add a custom netmask/broadcast address to created aliases,

# uncomment and change accordingly.  Leave commented to assign

# defaults for that interface.

#

#broadcast_eth0="192.168.0.255 192.168.0.255"

#netmask_eth0="255.255.255.0 255.255.255.0"

# For setting the default gateway

#

gateway="eth0/192.168.0.1"

```

I have no problems FTPing the WAN from any other machine on the LAN.  Can you see anything in the listings that looks odd?

Thanks

Prash

----------

## katsiki

I'm beginning to agree it could be problems with ipv6.  I had built my system with global USE -ipv6.

----------

## katsiki

I wonder what would happen if you configure a spare PC to connect to the Linux box directly using a cross-over cable.

----------

## katsiki

Also, I wonder what would happen if you brought down all your network services (in the correct order), and then started /etc/init.d/net.eth0 separately?

----------

## katsiki

I think you need to change your baselayout files to the new modular format.  Also, the /etc/conf.d/net has a new syntax.  For example,

```
config_eth0=( "192.168.0.11 netmask 255.255.255.0" )

routes_eth0=( "default gw 192.168.0.1" )
```

See the updated 2005.0 Handbook, Gentoo Network Configuration section, Getting Started.Last edited by katsiki on Sat Jul 23, 2005 9:08 pm; edited 1 time in total

----------

## prash

Thanks for all your hepp katsiki.

I'll try out your recommendations and see what happens. I've been a bit busy recently but hopefully I should be able to put in a session tomorrow to try and resolve this. I'll post the results here which will hopefully be good.

Prash

----------

