Find the answer to your Linux question:
Results 1 to 6 of 6
Hello there, I have to connect my private adres 10.0.0.2/26 to an external adres 192.168.1.253/16 I am not allowed to use Nat so i have to create a static routing ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2010
    Posts
    4

    Creating a static routing table


    Hello there,

    I have to connect my private adres 10.0.0.2/26 to an external adres 192.168.1.253/16
    I am not allowed to use Nat so i have to create a static routing table..But i dont really know how...:P

    Ive put a router between with 2 nic's:
    nic 1 : 192.168.121.4
    nic 2: 10.0.0.1

    ive seen on various sites that :
    #route add -net 10.0.0.0 netmask 255.255.255.192 gw 10.0.0.1 dev eth0
    and
    #route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.1.253 dev eth1

    should do the trick but it isnt working for me ... Ipforwarding is enabled.. Also when i use the sys/proc command..

    Can anyone tell me how to make the table?? Or give me a good link? Not to expert please am still learning Linux

    by the way I am using Opensuse 11.2
    Last edited by superblood; 11-29-2010 at 06:28 PM.

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,390
    Your router shouldnt need any manual routes, ipforwarding should be enough.

    There are three options:
    1) this router is the default gateway to both networks (unlikely, if I read your setup correctly)
    Then it should just work(tm)

    2) the router is not the default gw, all clients in both networks are dhcp enabled and/or their network settings are centrally controlled.
    Then all *clients* in 10.0.0.0/26 need this route given by dhcp:
    Code:
    route add -net 192.168.0.0 netmask 255.255.0.0 gw 10.0.0.1
    and likewise all clients in 192.168.0.0/16 need this route given by dhcp:
    Code:
    route add -net 10.0.0.0 netmask 255.255.255.192 gw 192.168.121.4
    3) the router is not the default gw. The default gateways of both networks point to your router for the mentioned networks.
    gw for 10.0.0.0/26
    Code:
    route add -net 192.168.0.0 netmask 255.255.0.0 gw 10.0.0.1
    gw for 192.168.0.0/16
    Code:
    route add -net 10.0.0.0 netmask 255.255.255.192 gw 192.168.121.4
    As 2) involves configuring all clients it is more errorprone. So 3) would be my advice.
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Nov 2010
    Posts
    4
    hmm tnx for the quick reply ill look into it

  4. #4
    Just Joined!
    Join Date
    Nov 2010
    Posts
    4
    by the way i cant change any settings from the ( server ) 192.168.1.253 so my router has to act as some sort of bridge...for the 10.0.0.0 network

  5. #5
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,390
    Sorry, then I got it wrong.
    I thought you were to connect two networks.
    So, only 192.168.1.253 shall be visible to the 10.0.0.0/26?

    Frankly, I do not understand the limitations.
    NAT may complicate things if 192.168.1.253 would need to open connections to 10.0.0.0/26, but other than that it seems a good solutions.

    Even without NAT: a route on 10.0.0.0/26's default gw plus a route on 192.168.1.253 should do it. But you say, that is also not doable?


    As it is just one machine, and your goal is to route all traffic anyhow (you didnt mention any restrictions) the easiest solution would be to
    - not use the router
    - and dual-home 192.168.1.253 by giving it an additional NIC and IP in 10.0.0.0/26.
    You must always face the curtain with a bow.

  6. #6
    Just Joined!
    Join Date
    Nov 2010
    Posts
    4
    As i said i cant change anything on the 192.168.1.253 machine.
    This machine acts as the gateway to the internet..

    The 10.0.0.1 computer ( i can also give it an 192.168.x.x ip) has to connect statticly through my router to the 192.168.1.253 machine..

    But when i try to ping the 192.168.1.253 machine i get timeouts(from my client)

    If i ping from my router it gets replys..

    I can ping all of my nic's on the router though..


    by the way
    Do i have to add routes at the clients aswell ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •