+ Reply to Thread
Results 1 to 3 of 3

Thread: Routing two Subnets

  1. #1

    Routing two Subnets

    I have two subnets which I am interested in connecting. I’ve read from beginning to the Linux Networking HOWTO, a few guides here on nixCraft, many forums posts, but have so far succeeded only in confusing myself.

    Some basic network details:

    Subnet A:
    Network Range: 192.168.1.0/24
    Gateway 1A: 192.168.1.1/255.255.255.0
    Gateway Interfaces:
    br0: 192.168.1.1/255.255.255.0
    vlan1: 70.76.84.224/255.255.252.0
    LAN Domain: tec.lan
    Example Host 1A: perpetrator.tec.lan – 192.168.1.10/255.255.255.0
    Example Host 2A: rapine.tec.lan – 192.168.1.11/255.255.255/0

    Subnet B:
    Network Range: 192.168.2.0/24
    Gateway 1B: 192.168.2.1/255.255.255.0
    Gateway Interfaces:
    eth0: 192.168.1.145/255.255.255.0
    eth1: 192.168.2.1/255.255.255.0
    LAN Domain: tec.lan
    Example Host 1B: ubuntu-01.tec.lan – 192.168.2.10/255.255.255.0
    Example Host 2B: ubuntu-02.tec.lan – 192.168.2.11/255.255.255.0


    I am trying to think of any further relevant details, but that seems to be it to me. If I forgot anything, please tell me.

    Ok the question. WHAT do I type? (Explicitly!) And WHERE do I type it? In order to reach ubuntu-01.tec.lan, or ubuntu-02.tec.lan from perpetrator.tec.lan or rapine.tec.lan?

    Note: I’m interested in using actuall ROUTES. I can already achieve results similair to this with either a NAT firewall, or with VPN.. but that’s not what I am interested in.

    Thank you very much for your reads and help in advance! This seems like it should be a simple thing, but I am having incredible difficulty with this..

    From what I have found out so far, I should need something like the following:

    On Gateway 1B:
    Code:
    route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.2.1 dev eth1
    And on Gateway 1A:
    Code:
    route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.1.1 dev br0
    Any help would be appreciated!

  2. #2
      Associate hysterik
    Join Date
    Oct 2005
    Posts
    40
    You probably should add the results from the following two commands.

    cat /proc/sys/net/ipv4/ip_forward

    route -n

  3. #3
    Sorry for the delay on the reply, but I forgot to attend to my thread. I know I know, bad me!

    Just an update.. I have it all working perfectly now. The correct answer was:

    1. Tell the machines on Subnet B to use 192.168.2.1 as their gateway, and:

    2. On Gateway 1A, configure a static route telling packets trying to reach 192.168.2.0/24 to use 192.168.1.145 as their gateway.

    Code:
    route add -net 192.168.2.0/24 gw 192.168.1.145
    Thank you for your time.

+ Reply to Thread

Similar Threads

  1. Routing between subnets is always on by default. How to turn it off?
    By frostbolt in forum Linux – Hardware, Networking & Security
    Replies: 2
    Last Post: 03-21-2010, 09:07 AM
  2. dhcpd unable to serve multiple subnets
    By licause in forum Linux – Hardware, Networking & Security
    Replies: 10
    Last Post: 06-09-2009, 07:50 AM
  3. routing problem
    By ehdlim in forum Linux – Hardware, Networking & Security
    Replies: 1
    Last Post: 11-08-2005, 04:38 AM
  4. Routing protocols
    By friskydrifter in forum Linux – Hardware, Networking & Security
    Replies: 2
    Last Post: 06-25-2002, 11:39 PM
  5. routing question
    By in forum Linux – Hardware, Networking & Security
    Replies: 2
    Last Post: 05-29-2002, 10:08 PM

Bookmarks

Bookmarks

Posting Permissions

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