Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Dec 2003 08:39:27 +0200
From:      Ion-Mihai Tetcu <itetcu@apropo.ro>
To:        Valerian Galeru <valerian_ro@yahoo.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: routed
Message-ID:  <20031216083927.5436950c.itetcu@apropo.ro>
In-Reply-To: <20031216003320.71432.qmail@web12505.mail.yahoo.com>
References:  <20031216003320.71432.qmail@web12505.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 15 Dec 2003 16:33:20 -0800 (PST)
Valerian Galeru <valerian_ro@yahoo.com> wrote:

> I want to understand about these routing tables.... I
> run route flush (to remove all routes, gateways...).
> Yes, all the routes are deleted(i try a web browser
> and  i get an error), but when i run netstat -r, i
> dont see that. When i want to get again the routing
> table, i run routed (probably this is what i need for
> regetting the routing table) and when i try a web page
> on the web browser, it shows me the same eror as in
> the case of the deleted routing table. Probably i did
> something wrong... 

Dou you have a default geteway in your rc.conf ?

> Thank you very much or support

Contrar to popular belive routed(8) is not necesary when running a
standalone computer or event a simple gateway. I've spent half a day
arging with a fren on that, just to dicover to our both amusament the
cables where plugged each in the other nic ;)

Try disable the routed_enable line in /etc/rc.conf or change it to "NO",
reboot and you should have netwotk connnection, provided that you have a
defaultrouter="xxx.xxx.xxx.xxx" in the above file.

Routed(8) use RIP - Route Information Protocol, an interior gateway
protocol, which is suitable to use on small networks, which it uses to
get routing table from neghbour routers in order to build up a routing
table.

When you flush the routes you delete the defaul route seted in rc.conf
so your system does not know where to send packets for network other
that those directly connected.

Example:

Normal operation, without routed (I don't paste ipv6):
it>/home/itetcu# netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            192.168.0.1        UGSc        5        0    rl0
127.0.0.1          127.0.0.1          UH          0        4    lo0
192.168.0          link#1             UC          1        0    rl0
192.168.0.1        00:e0:4c:55:c3:13  UHLW        6       56    rl0


it>/home/itetcu# route flush
it>/home/itetcu# netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
127.0.0.1          127.0.0.1          UH          0        4    lo0
192.168.0          link#1             UC          1        0    rl0
192.168.0.1        00:e0:4c:55:c3:13  UHLW        0      190    rl0   1030


The deaflault route has gonw away, the directly connected networks are still present.

it>/home/itetcu# ping www.freebsd.org
PING www.freebsd.org (216.136.204.117): 56 data bytes
ping: sendto: No route to host
ping: sendto: No route to host
^C

Note that www.freebsd.org resolves on 216.136.204.177 becouse I have a
name server on 192.168.0.1 which is on a directly connected network:

it>/home/itetcu# route get 192.168.0.1
   route to: 192.168.0.1
destination: 192.168.0.1
  interface: rl0
      flags: <UP,HOST,DONE,LLINFO,WASCLONED>
 recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire
       0         0         0         0         0         0      1500       820

Now if I add back the default route with:

it>/home/itetcu# route add default 192.168.0.1 0.0.0.0
add net default: gateway 192.168.0.1
it>/home/itetcu# netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            192.168.0.1        UGSc        0        0    rl0
127.0.0.1          127.0.0.1          UH          0        4    lo0
192.168.0          link#1             UC          1        0    rl0
192.168.0.1        00:e0:4c:55:c3:13  UHLW        1      222    rl0    935

I get my freebsd connection back:
it>/home/itetcu# ping www.freebsd.org
PING www.freebsd.org (216.136.204.117): 56 data bytes
64 bytes from 216.136.204.117: icmp_seq=0 ttl=50 time=242.811 ms
^C

All this time:
it>/home/itetcu# ps axw | grep routed
returns nada.

Reference, besides the man pages:
http://www.onlamp.com/pub/a/bsd/2000/08/23/FreeBSD_Basics.html
and the rest networking articles from there.

-- 
IOnut
Unregistered ;) FreeBSD user



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031216083927.5436950c.itetcu>