Results 1 to 3 of 3

Thread: Routing two Subnets

Hybrid View

  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
    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.

Similar Threads

  1. Problem with subnets.
    By stimburg in forum Linux - Hardware, Networking & Security
    Replies: 0
    Last Post: 03-08-2013, 02:50 AM
  2. Cannot connect two subnets
    By lloowen in forum Linux - Hardware, Networking & Security
    Replies: 0
    Last Post: 05-15-2012, 08:58 PM
  3. 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, 08:07 AM
  4. dhcpd unable to serve multiple subnets
    By licause in forum Linux - Hardware, Networking & Security
    Replies: 10
    Last Post: 06-09-2009, 06:50 AM
  5. Routing protocols
    By friskydrifter in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 06-25-2002, 10:39 PM

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
  •