route command

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

route command

steve (Bugzilla)-9
Hi,

It must have been too long ago since I built routers under BSD. I got three
subnets in a series below the internet connection and cannot add a proper
route between subnet 1 and 3.


The subnets are as follows:

{Internet}
        |
Subnet 1: 10.1.1
        |
Subnet 2: 192.168.1
        |
Subnet 3: 192.168.0

Router 1: int if = 10.1.1.1
Router 2: ext if = 10.1.1.2      int if = 192.168.1.254
Router 3: ext if = 192.168.1.253 int if = 192.168.0.254

On the second router I have these routes up:
(Note the H in 192.168.0.0 but I need a -net.)

Destination        Gateway            Flags    Refs      Use    Mtu  Interface
default              10.1.1.1          UGS         0     6014      -   xl0
10.1.1/24         link#2             UC          0        0      -   xl0
10.1.1.1           00:00:00:00:00:f1  UHLc        0        0      -   xl0
127/8              127.0.0.1          UGRS        0        0  33224   lo0
127.0.0.1          127.0.0.1          UH          0       30  33224   lo0
192.168.0.0        192.168.1.254      UGHS        0        0      -   dc0
192.168.1/24       link#1             UC          0        0      -   dc0
224/4              127.0.0.1          URS         0        0  33224   lo0

Sitting on the second router (above), I cannot get it to route to subnet
192.168.0. As you can see below.

route get 192.168.0.1
   route to: 192.168.0.1
destination: default
       mask: default
    gateway: 10.1.1.1
  interface: xl0
 if address: 10.1.1.2
      flags: <UP,GATEWAY,DONE,STATIC>
 recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu    
expire
       0         0         0         0         0         0         0         0

I've tried numerous route commands but it never results in routing it down to
198.168.0. My last routing commands looks like this:

route add 192.168.0 192.168.1.253
route add 192.168.0.254 192.168.1.253

What is the route command supposed to look like to route down to 192.168.0?

--

Steve

"They that would give up essential liberty for temporary safety
deserve neither liberty nor safety."
                                Benjamin Franklin

Reply | Threaded
Open this post in threaded view
|

Re: route command

steve (Bugzilla)-9
On Saturday 18 August 2007 22:19, steve wrote:

Hmm, I had added the route commands to rc.local and with each edit executed
sh netstart which of course does not read rc.local.

--

Steve Szmidt

"They that would give up essential liberty for temporary safety
deserve neither liberty nor safety."
                                Benjamin Franklin

Reply | Threaded
Open this post in threaded view
|

Re: route command

Darren S.
In reply to this post by steve (Bugzilla)-9
On 8/18/07, steve <[hidden email]> wrote:

> It must have been too long ago since I built routers under BSD. I got three
> subnets in a series below the internet connection and cannot add a proper
> route between subnet 1 and 3.
> I've tried numerous route commands but it never results in routing it down to
> 198.168.0. My last routing commands looks like this:
>
> route add 192.168.0 192.168.1.253
> route add 192.168.0.254 192.168.1.253
>
> What is the route command supposed to look like to route down to 192.168.0?

One way is with an explicit CIDR mask on the network:

# route add 192.168.0.0/24 10.0.1.1
add net 192.168.0.0/24: gateway 10.0.1.1
# route -n show | grep ^192
192.168.0/24       10.0.1.1           UGS         0        0      -   fxp0

DS

Reply | Threaded
Open this post in threaded view
|

Re: route command

Darren S.
In reply to this post by steve (Bugzilla)-9
On 8/18/07, steve szmidt <[hidden email]> wrote:
> On Saturday 18 August 2007 22:19, steve wrote:
>
> Hmm, I had added the route commands to rc.local and with each edit executed
> sh netstart which of course does not read rc.local.

See hostname.if(5), and particularly the description for
'!command-line' in that manual.

DS