# network connection doesn't work

## sidonius

during instalation my network card (realtek rtl-8169) was detect as eth1 device and network connection work without any problem 

but after reboot eth1 wasn't found and network card is detect as eth0 device 

I set appropriate network parametres in 

```
/etc/conf.d/net for eth0 
```

and try it start 

```
/etc/init.d/net.eth0 start 
```

but it still doesn't work

----------

## tomasm

Are you using DHCP? Is r8193 a module of built in? What does 

```
dmesg | grep eth
```

 say?

----------

## eldad

and also helpful for debugging this:

```
lspci
```

(provided by sys-apps/pciutils)

and

```
ifconfig -a
```

----------

## sidonius

```
dmesg | grep eth
```

display 

forcedeth.c: Reverse Engineered nForce ethernet driver. Version 0.48.

eth0: Identified chip type is 'RTL8169s/8100s' .

eth0: RTL8169 at 0xffffc20000016400, 00:0a:e4:a6:44:ea, IRQ 185

r8169: eth0: link up

r8169: eth0: link up

eth0: no IPv6 routers present

I use static IP

----------

## tomasm

Forgive me if I'm wrong on this one:

Does 

```
$ ifconfig eth0 up

$ ifconfig eth0 IP_ADDR DEST_ADDR
```

work? (The commands may be in the wrong order, I'm not at a terminal right now.)

----------

## sidonius

```
ifconfig eth0 IP_ADDR DEST_ADDR
```

display

IP_ADDR: Host name lookup failure

----------

## tomasm

Sory, I ment to say replace IP_ADDR and DEST_ADDR with your IP address and the IP address of the machine you are trying to connect to, respectively.

----------

## sidonius

I try it ones more with IPs and it display no message but when I then try to ping that IP a reach it without any problem but another are still unreachable

----------

## tomasm

How do you connect to the internet?

----------

## sidonius

My notebook is conected to router via cable and it'c conected to network via WiFi

----------

## tomasm

So you are connected to your router and can ping it, but you cannot ping other IP's, like www.google.com?

What does it say when you do 

```
/etc/init.d/net.eth0 start
```

 and what is in 

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

?

----------

## sidonius

```
/etc/init.d/net.eth0 start
```

display

starting eth0

Loading network modules for eth0

modules: iptunnel ifconfig dhcpcd apipa

ifconfig provides interface

dhcpcd provides dhcp

bringing up eth0

MY_IP

all is ok except the last one whera are two red screamer

in

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

I use 

```
config_eth0=( " MY_IP netmask NET_MASK" )

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

----------

## jmbsvicetto

Hi.

So you can reach your gateway. Look at the output of the following.

```
# ping -c 5 forums.gentoo.org

# ping -c 5 140.211.166.170
```

If the first ping fails and the second succeds, you need to look at /etc/resolv.conf and make sure that you list your nameservers.

If the second fails try doing the following:

```
# traceroute 140.211.166.170
```

It should show you where the routing problem lies.

----------

## sidonius

```
# ping -c 5 forums.gentoo.org 
```

unknown host forums.gentoo.org

```
# ping -c 5 140.211.166.170
```

Network is unreachable

```
# traceroute 140.211.166.170
```

-bach: traceroute: command not found

in /etc/resolv.conf I have set right nameservers

----------

## jmbsvicetto

You need to emerge traceroute to be able to run it.

```
-bash: traceroute: command not found 
```

This error message means that you cannot route packets to the forums.gentoo.org site. Please post the output of ifconfig -a and netstat -nr.

----------

## sidonius

```
ifconfig -a 
```

eth0     Link encap: Ethernet       HWaddr 00:00:B4:AC:5B:84

           inet addr: MY_IP     Bcast:BC_IP         Mask: M_IP

           inet6 addr: IP    Scope:Global 

           inet6 addr: IP    Scope:Link

           UP BROADCAST RUNNIG MULTICAST    MTU:1500   Metric:1

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

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

           collisions:0    txquelen:1000

           RX bytes:181521 (177.2 Kb)  TX bytes:2062 (2.0 Kb)

           Interrupt:185 Base address:0x6400

eth0     Link encap: Local Loopback

           inet addr: 127.0.0.1   Mask: 255.0.0.0

           inet6 addr: IP    Scope:Host

           UP LOOPBACK RUNNIG    MTU:16436   Metric:1

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

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

           collisions:0    txquelen:0

           RX bytes:2136 (2.0 Kb)  TX bytes:2136 (2.0 Kb)

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    txquelen:0

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

           Interrupt:185 Base address:0x6400

```
netstat -nr
```

Kernel IP routing table

Destination       

147.32.0.0                                                          

127.0.0.0                                                            

Gateway 

0.0.0.0  

127.0.0.1

Genmask

 255.255.0.0    

 255.0.0.0 

Flags 

 U   

  UG   

MSS Window  

0  0  

  0  0 

irtt Iface

 0 eth0

0  lo

----------

## jmbsvicetto

You're missing the default route. Do the following

```
# route add default gw <gw-addr>
```

PS - Please post your code segments within [code] and [/code] tags.

----------

## sidonius

```
# route add default gw <gw-addr>
```

add new line to Kernel IP routing table  with gw

but the connection still don't work

----------

## jmbsvicetto

Are you trying to connect your system to your home network or to an office network? Does it use private addresses, 10.X.Y.Z, 172.16-31.Y.Z, 192.168.Y.Z, or does it use public addresses? If you're using private addresses, please post the exact addresses so that we can understand what you're talking about - in the worst case, you can later change your network address.

Please post the output of the following (enclosed in the code tags):

```
# dmesg | grep -i net

# grep -i net /usr/src/linux/.config

# lsmod

# ifconfig -a
```

Do you have a single nic? If not, make sure that you are connecting the cable to the nic you're trying to use, or if things don't work, connect the cable in the other jack.

----------

## sidonius

```
# dmesg | grep -i net 
```

display

```
NET: REGISTERED PROTOCOL FAMILY 16

NET: REGISTERED PROTOCOL FAMILY 23

NET: REGISTERED PROTOCOL FAMILY 31

Intel(R) PRO/1000 Network Driver - version 6.1.16-k2

e100: Intel(R) PRO/1000 Network Driver, 3.4.14-k4-NAPI

forcedeth.c: Reverse Engineered nForce ethernet driver. Version

r8169 Gigabit Ethernet driver 2.2LK loaded

netconsole: not configured, aborting

NET: REGISTERED PROTOCOL FAMILY 2

NET: REGISTERED PROTOCOL FAMILY 1

NET: REGISTERED PROTOCOL FAMILY 10

NET: REGISTERED PROTOCOL FAMILY 17
```

```
# grep -i net /usr/src/linux/.config 
```

display

```
# Networking

CONFIG_NET=y

# Networking options

# CONFIG_NET_KEY is not set

CONFIG_NET=y

# CONFIG_NET_IPIP is not set

# CONFIG_NET_IPGRE is not set

# CONFIG_NET_AH is not set

# CONFIG_NET_ESP is not set

# CONFIG_NET_IPCOMP is not set

# CONFIG_NET_TUNNEL is not set

CONFIG_NET_DIAG=y

CONFIG_NET_TCP_DIAG=y

# CONFIG_NET_AH is not set

# CONFIG_NET_ESP is not set

# CONFIG_NET_IPCOMP is not set

# CONFIG_NET_TUNNEL is not set

# CONFIG_NETFILTER is not set

# CONFIG_DECNET is not set

# CONFIG_NET_DIVERT is not set

# CONFIG_ECONET is not set

# CONFIG_NET_SCHED is not set

# Network testing

# CONFIG_NET_PTKGEN is not set

# Network device support

CONFIG_NETDEVICES=y

# CONFIG_NET_SB1000 is not set

# ARCnet devices

# CONFIG_ARCNET is not set

# Ethernet (10 or 100Mbit)

CONFIG_NET_ETHERNET=y

CONFIG_NET_VENDOR_3COM=y

# Tulip family network device support

# CONFIG_NET_TULIP is not set

CONFIG_NET_PCI=y

# CONFIG_PCNET32 is not set

# Ethernet (1000Mbit)

# Ethernet (10000Mbit)

# CONFIG_NET_RADIO is not set

# CONFIG_NET_FC is not set

CONFIG_NETCONSOLE=y

CONFIG_NETPOLL=y

# CONFIG_NETPOLL_RX is not set

# CONFIG_NETPOLL_TRAP is not set

CONFIG_NET_POLL_CONTROLLER=y

# USB Network Adapters

# CONFIG_USB_USBNET is not set

# Network File Systems
```

```
# lsmod 
```

display

```

Module Size Used by

```

```
# ifconfig -a
```

display

```
eth0 Link encap: Ethernet HWaddr 00:00:B4:AC:5B:84

inet addr: 147.32.121.198 Bcast:147.32.121.255 Mask: 147.32.121.1

inet6 addr: 2001:710:2:b1:20a:e4ff:feab:4ea/64 Scope:Global

inet6 addr: fe00:20a>e4ff:feab44ea/64 Scope:Link

UP BROADCAST RUNNIG MULTICAST MTU:1500 Metric:1

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

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

collisions:0 txquelen:1000

RX bytes:86965 (84.9 Kb) TX bytes:220 (220.0 b)

Interrupt:185 Base address:0x6400

eth0 Link encap: Local Loopback

inet addr: 127.0.0.1 Mask: 255.0.0.0

inet6 addr: ::1/120 Scope:Host

UP LOOPBACK RUNNIG MTU:16436 Metric:1

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

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

collisions:0 txquelen:0

RX bytes:336 (336.0 b) TX bytes:336 (336.0 b)

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 txquelen:0

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

Interrupt:185 Base address:0x6400

```

----------

## jmbsvicetto

You never posted the output of lspci. Also, did you emerge traceroute? Post the output of the following:

```
# netstat -nr

# traceroute 140.211.166.170
```

----------

## sidonius

```
# netstat -nr 
```

display

```
Kernel IP routing table

Destination

147.32.121.0

127.0.0.0

0.0.0.0

Gateway

0.0.0.0

127.0.0.1

147.32.121.1

Genmask

255.255.0.0

255.0.0.0

0.0.0.0

Flags

U

UG

UG

MSS Window

0 0

0 0

0 0

irtt Iface

0 eth0

0 lo

0 eth0
```

```
# traceroute 140.211.166.170
```

display

```
-bash: traceroute: command not found
```

----------

## jmbsvicetto

So it seems that 147.32.121.1 should be your router. Try the following:

```
# ping -c 5 147.32.121.1
```

Then emerge traceroute and try to ping the forums:

```

# emerge -av1 traceroute

# ping -c 5 140.211.166.170
```

Also check if you enabled the support for Intel and nForce nics.

```
# grep -i e100 /usr/src/linux/.config

# grep -i forcedeth /usr/src/linux/.config
```

Finally, please post the output of lspci. You may need to emerge pciutils.

```
# emerge -av1 pciutils

# lspci
```

----------

## sidonius

If I want to ping 147.32.121.1 I must use

```
ifconfig eth0 147.32.121.198 147.32.121.1
```

other way it doesn't work

I have problem with emerge due I can't connect to servers since I can't reach my GW.

----------

## jmbsvicetto

Can you connect to the Internet when you boot with the live-cd? If so, look at the output of ifconfig -a and netstat -nr under the live-cd.

If you can only reach the gateway address after using that ifconfig command, then you have a problem with the nic, the driver or the cable. After you configure eth0 with the correct values, try to ping a few hosts and then look at the output of ifconfig -a. If the RX and TX counters are at 0, you need to look at the nic driver.

----------

## sidonius

I download all filles from the network during instalation. But I have problem I moved my computer from that network (but also there the network connection after reboot stop working) and here I have problem that I need change the hwaddres but

```
ifconfig eth0 hw ether
```

doesn't work from livecd so I can't try if it works from cd

the hw addres look also quite strange due it have for about 20 numbers and not only 12 as normal

----------

