# How to set up Router

## MrGreen

Hi

I would like to set up my Router (Via LAN eth0) I have a realtek 8169 LAN on board.

What is the minimum I need to set it up i.e. drivers IP's etc ?

Are there any commands I can use to test my network?

I have the IP for my router so that is no problem...it is currenly running under windows...

I would like to get it going so I can emerge sync   :Cool: 

Mr.G.

----------

## bmichaelsen

1) Install the driver in the kernel ...

    (propably has already been done - to check look for a /dev/eth0 - if you have one the driver is installed)

2) 

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

```
iface_eth0="192.168.1.97 broadcast 192.168.1.255 netmask 255.255.255.0"
```

     Set your IP here.

```
gateway="eth0/192.168.1.1"
```

     Set your routers IP here.

3) 

```
rc-update add net.eth0 default

rc default
```

Greetz, Björn

----------

## MrGreen

Hi There,

   I have looked in /dev/eth0 and there is nothing .In kernel drivers my 8169 is not listed . Any idea where to look now?

D.T.

----------

## bmichaelsen

```
Networking device support --> 10 or 100 MBit -->  RealTek RTL-8139 PCI Fast Ethernet Adapter support 
```

EDIT:

That the driver for the old Realteks ... Your driver should be in the 1000 MBit section (google is suggesting that ... however, I cant find the option there in the gentoo-sources-kernel .... strange ...

see for example here: http://seclists.org/lists/linux-kernel/2003/Jan/0060.html

hmmm, it seems to be in the vanilla-sources from 2.4.21 pre and up!

Maybe it isnt in the gentoo-sources, because they are still 2.4.20-based.

http://tonnikala.net/2002/50/linux2421pre1.php

----------

## MrGreen

My Realtek 8169 is onboard mobo does this make any difference?

----------

## bmichaelsen

no.

----------

## MrGreen

I have downloaded driver from Realtek (Red Hat ) .I have got to make it but I will have a go.I did have the network running under Mandrake 9.2 ( As it detected it itself) .

 I think until network is set up I can do very little to the system.

Maybe I should think about a PCI card that is supported by Gentoo say CNET 10/100 ?

These cards are not that expensive and it would save a lot of time

I took a look at your site though very insteresting ...

Mr G.

----------

## bmichaelsen

And how about using vanilla-sources?

The driver should be included in the latest version ..

 *Quote:*   

> I took a look at your site though very insteresting ... 

 

Thanks. However, somethings missing - Oh, right, content  :Wink: 

----------

## MrGreen

Hi,

  forgive me but what are vanilla sources ?  :Embarassed: 

Mr G.

 P.S. I am thinking of a web site myself ...(How to get started with Gentoo!)

----------

## ikaro

vanilla er the "pure sources" that the kernel hackers release, as a base for other kernel sources.

then you can get something like ck-sources wich are the vanilla sources + improvement patches.

and so are many more .

----------

## jaska

Vanilla sources just means the latest "stable" kernel source from kernel.org. 

Linux kernel 2.4.22 as it is right now.

----------

## bmichaelsen

see also

http://www.gentoo.org/doc/en/gentoo-kernel.xml

and Chapter 16 of the Install guide

----------

## MrGreen

I am using Gentoo-sources as per instructions ....I have got the 8169 file in and dmesg sees the chipset...all I have to do (hopefully) is follow your original instructions in this post ..to get ping working (fingers crossed)..or I going out to buy Suse   :Laughing: 

Mr.G.

----------

## MrGreen

I have managed to get 8169 working...

I can ping 192.168.7.1 and get a response

but ping www.google.com says unknown host

what do I do now ?

Mr G.

----------

## bmichaelsen

you need a nameserver set in /etc/resolv.conf   :Question: 

----------

## MrGreen

A nameserver such as ...... ?

----------

## shakti

 *MrGreen wrote:*   

> A nameserver such as ...... ?

 

this is something you should ask your IP or clone from windows or from your router. nameserver = DNS

```
nano -w /etc/resolv.conf
```

nameserver 1.2.3.4

nameserver 1.2.3.5

----------

## MrGreen

Hi All

Have nameserver 192.168.7.1  .... ping www.google.com nothing till Ctrl-C then back to prompt....

I need to see a what a typical conf.d/net ,hosts , resolv.conf looks like 

What should go in iface-eth0=" ?

Mr G.

----------

## bmichaelsen

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

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

# Global config file for net.* rc-scripts

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

#

iface_eth0="YOURIP broadcast 192.168.1.255 netmask 255.255.255.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/ROUTERIP"
```

```

# /etc/hosts:  This file describes a number of hostname-to-address

#              mappings for the TCP/IP subsystem.  It is mostly

#              used at boot time, when no name servers are running.

#              On small systems, this file can be used instead of a

#              "named" name server.  Just add the names, addresses

#              and any aliases to this file...

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

#

127.0.0.1       localhost

YOURIP          YOURHOSTNAME

# 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
```

/etc/resolv.conf

```
domain YOURDOMAIN

nameserver ROUTERIP

nameserver DNSNAMESERVERIP

nameserver DNSNAMESERVERIP
```

----------

## MrGreen

Hi 

Thank you for your posting../etc/hosts/ contains things I have not come accross should this concern me?

I assume from looking at resolv.conf DNSNAMESERVER refers to my ISP's address

Mr G.

----------

## bmichaelsen

 *Quote:*   

> Thank you for your posting../etc/hosts/ contains things I have not come accross should this concern me? 

 

No. This:

```
# 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
```

got there by etc-update and only matters with IP6 anyway.

 *Quote:*   

> I assume from looking at resolv.conf DNSNAMESERVER refers to my ISP's address 

 

The nameserver of the ISP. You should find the nameservers IP somewhere in your ISPs docs. However, your router likely knows the IPs of the Domain NameServer. You may find it somewhere in the webinterface of the router.

IF the router knows about the DNS it should be enough to set

```
nameserver ROUTERIP 
```

where ROUTERIP is the (local) IP of the router ...

----------

## MrGreen

Hi 

I have now managed to get router going (setting DNS relay helped!)

I edited files again

ping 192.168.7.1 O.k.

ping -c 3 www.google.co.uk .....O.k.

emerge alsa off it went

Thank so much for your time & patience

Can I now finally use emerge sync ?

Mr.G.

----------

## bmichaelsen

 *Quote:*   

> Can I now finally use emerge sync ? 

 

Yes, you should be able to sync. Try it!

----------

