linuxbox as router - Networking

This is a discussion on linuxbox as router - Networking ; I think I've got most of this put together quite nicely but there is one critical part I don't know what to do about, the networks can't communicate with each other. I have one normal pc with linux on (kubuntu ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: linuxbox as router

  1. linuxbox as router

    I think I've got most of this put together quite nicely but there is
    one critical part I don't know what to do about, the networks can't
    communicate with each other.

    I have one normal pc with linux on (kubuntu 6.10, fresh install) and it
    has one ethernet port on the motherboard (eth2) which is connected to a
    cable modem that does not require any authentication. in this box I
    have 2 pci ethernet cards, one is connected to a wireless access point
    (eth0) that does not require any authentication and the other is
    connected to a wired switch (eth1).

    on eth2 I get a global ip (83.249.178.41/19), on eth0 I've set
    192.168.1.1/24 and on eth1 I've set 192.168.2.1/24. I've installed
    dhcp3-server and set it to listen on eth0 and eth1. I've created the
    two subnets and all wireless gets 192.168.1.11-100/24 and all wired
    gets 192.168.2.11-100/24 and the default gateways 192.168.1.1 and
    192.168.2.1 respectively. everybody also gets the broadcast address
    192.168.255.255 and the 2 dns servers from my isp as well as the 2 dns
    servers of opendns.
    all connected computers run windows xp home or pro.

    the linuxbox can ping the internet, 192.168.1.* and 192.168.2.* and all
    connected computers can ping all of the 3 linuxbox ip addresses and
    everybody in their network but no one in the other network and no one
    on the internet.

    so now I need some help on what to do so that both networks can
    communicate with each other and the internet.


  2. Re: linuxbox as router


    xix xeaon wrote:
    > I think I've got most of this put together quite nicely but there is
    > one critical part I don't know what to do about, the networks can't
    > communicate with each other.
    >
    > I have one normal pc with linux on (kubuntu 6.10, fresh install) and it
    > has one ethernet port on the motherboard (eth2) which is connected to a
    > cable modem that does not require any authentication. in this box I
    > have 2 pci ethernet cards, one is connected to a wireless access point
    > (eth0) that does not require any authentication and the other is
    > connected to a wired switch (eth1).
    >
    > on eth2 I get a global ip (83.249.178.41/19), on eth0 I've set
    > 192.168.1.1/24 and on eth1 I've set 192.168.2.1/24. I've installed
    > dhcp3-server and set it to listen on eth0 and eth1. I've created the
    > two subnets and all wireless gets 192.168.1.11-100/24 and all wired
    > gets 192.168.2.11-100/24 and the default gateways 192.168.1.1 and
    > 192.168.2.1 respectively. everybody also gets the broadcast address
    > 192.168.255.255 and the 2 dns servers from my isp as well as the 2 dns
    > servers of opendns.
    > all connected computers run windows xp home or pro.
    >
    > the linuxbox can ping the internet, 192.168.1.* and 192.168.2.* and all
    > connected computers can ping all of the 3 linuxbox ip addresses and
    > everybody in their network but no one in the other network and no one
    > on the internet.
    >
    > so now I need some help on what to do so that both networks can
    > communicate with each other and the internet.


    Short answer:

    ip_forward and iptables. If you only wanted to go from 192.168 OUT to
    the Internet, then you could also do this with a squid-proxy (if you're
    only looking to get out with HTTP).

    ip_forward (use /etc/sysctl.conf and set to "1) makes the Linux box
    route. Ubuntu doesn't offer anything via Search so I can't verify a
    command for ya.

    iptables will do the NAT, start here:
    http://www.netfilter.org/documentati...NAT-HOWTO.html,
    specifically, look into masquerading.

    This site looks like a good intro:
    http://www.gophernet.org/articles/iptables/

    -Gary


  3. Re: linuxbox as router

    On Fri, 05 Jan 2007 10:57:12 -0800, xix xeaon wrote:

    > the linuxbox can ping the internet, 192.168.1.* and 192.168.2.* and all
    > connected computers can ping all of the 3 linuxbox ip addresses and
    > everybody in their network but no one in the other network and no one on
    > the internet.
    >
    > so now I need some help on what to do so that both networks can
    > communicate with each other and the internet.


    Running the following commands should achieve what you need, namely
    load the iptable_nat module, masquerade your eth2 interface via NAT, and
    enable IP forwarding.

    sudo modprobe iptable_nat
    sudo iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE
    sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward

    More details at
    https://help.ubuntu.com/community/In...nectionSharing


    > everybody also gets the broadcast address 192.168.255.255


    They shouldn't. There should be a broadcast address for each subnet:
    192.168.1.0/24 broadcast address 192.168.1.255
    192.168.2.0/24 broadcast address 192.168.2.255



    --


    --
    Posted via a free Usenet account from http://www.teranews.com


+ Reply to Thread