Routing Linux 192.168.10.x network to Dlink router on 192.168.1.x network

Discussion in 'Linux Networking' started by q4n, Aug 5, 2006.

  1. q4n

    q4n Guest

    8/5/2006, 1:23AM


    Thanks for taking the time to shine some light!

    I have a Linux Redhat 7.2 box on a 192.168.10.x network and I have
    clients that need to connect also connected to the same Dlink router
    which is at

    All my boxes are physically plugged into the D-link router so they are
    all on the same physical network.

    I heard that if all machines are on the same router, then all one has
    to do is add the odd man out network to the routing page, which I did:

    Enable : Yes
    Destination IP
    Netmask :
    Gateway :
    Interface :LAN
    Metric : 1

    My router is on
    Linux box is on
    clients on

    I don't want to be sloppy and change the subnet mask to

    Shouldn't this work? But my Linux box at can't ping my
    D-link router at

    I could probably do a "route add" command on the Linux box to be able
    to ping the D-link, but shouldn't the router, since it's on the same
    physical network, see the ping from anything on it's network?
    should drop it from a different subnet...I know....but since I added
    the route in the D-link routing table, shouldn't it not only see it but
    route it and/or respond to it?

    I can ping the D-link from my boxes on the 192.168.1.x

    I don't want to have to add "route print" statements on all my boxes. I
    thought this is what routers were for...connecting different subnets?

    Thanks for your input!


    The "Route Guy"
    q4n, Aug 5, 2006
    1. Advertisements

  2. That would mean that packets for are to be sent to which probably isn't what you want.

    If your 192.168.1.x and 192.168.10.x are on the same subnet, and there
    aren't any othe 192.168.y.x on different subnets, then setting the
    subnet mask to is what you need to to.

    But why doesn't your Linux box have a 192.168.1.x address anyway? Why
    don't you just let your router assign its IP address like everybody else's?

    Robert Harris, Aug 5, 2006
    1. Advertisements

  3. q4n

    q4n Guest

    Hi Robert,

    Thanks for the reply!

    The reason I don't let DHCP do it's dirty deeds is that most of my
    boxes are servers or other test clients whose addresses I need to stay

    So, opening up my subnet mask is one solution, but in situations where
    widening the subnetmask is not desired, shouldn't my router be able to
    "route" from one subnet to the other?

    I want my to be able to send packets through
    (The D-link router) to get to and other 192.168.1.x

    Can't I get the D-link to route this way without just opening my subnet

    And does this mean I have to open the subnet mask on all clients and
    servers? The reason I ask is that, again, I've read that the router
    should be able to handle all of this without changing the clients as
    long as they are all plugged into the same router, because the router
    gets all the packets, but makes decisions about which to route based on
    it's own configured routing table.

    I thought I modified the routing table sufficiently with my
    entry...but apparently not.

    Any direction on how to get the router to route without widening the
    subnet mask is appreciated!



    q4n, Aug 5, 2006
  4. q4n

    q4n Guest

    Hi Route Guy, this is Route Guy:

    I got it to work, not by sloppily widening the subnet, but by adding
    the route the correct way on the D-link router. After I RTFM, whose
    directions are below, I changed the route from this:
    Enable : Yes
    Destination IP
    Netmask :
    Gateway :
    Interface :LAN
    Metric : 1

    to this:

    Enable : Yes
    Destination IP (specifies entire 10.x network)
    Netmask : (left same)
    Gateway : (0's indicate all clients plugged into one/same
    Interface :LAN
    Metric : 1 (indicates there are no hops other than to d-link router)

    192.168.1.x and talk to each other now like it was high
    tea time at the All England Ladies Tea Club.

    Thanks for your input!



    Adds a new route to the IP routing table or edits an existing route.
    Specifies whether the entry will be enabled or disabled.
    The IP address or network that the packets will be attempting to access
    Note: with a Netmask of means traffic will be
    routed to the entire 192.168.1.x network.
    Used to specify which portion of the Destination IP signifies the
    trying to be accessed and which part signifies the host that the
    packets will
    be routed to
    Note: is used to signify only the host that was entered
    the Destination IP field.
    Specifies the next hop to be taken if this route is used. A gateway of
    implies there is no next hop, and the IP address matched is directly
    to the router on the interface specified: LAN or WAN.
    Specifies the interface, LAN or WAN, that the IP packet must use to
    out of the router when this route is used.
    The amount of hops it will take to reach the Destination IP or network.
    hop is considered to be traffic passing through a router from one
    network to
    another. If there is only one router between your network and the
    network, then the Metric value would be 1.
    q4n, Aug 5, 2006
  5. q4n

    Unruh Guest

    It does. From the Wan to the Lan side of the box.

    ?? The problem is that you need to tell your system how to get to
    route add -host eth0
    on each of the machines might work.
    route add -network netmask gw eth0
    should do it.

    Unruh, Aug 5, 2006
  6. Look: packets from one host on the subnet to another don't need to be
    processed by the router. You can get your router to redirect packets on
    the subnet if you want but that just means that each packet causes the
    router to generate an extra one for no good reason.

    If you keep the (IP address & netmask) the same for every member of a
    subnet, then you can add other subnets to your network and use simple
    routing decisions around it. If you don't, you will reach a situation
    where each host has to know how to reach every other host individually.

    If you want some IP addresses to be fixed (for servers), you can tell
    your router about them and get the router to assign fixed IP addresses
    to them for their given MAC addresses. That way the router, assuming it
    is the nameserver on the network, knows the hostname of all the hosts
    and the hosts can address one another by name without messing around
    with hosts files.
    Robert Harris, Aug 5, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.