Results 1 to 2 of 2

Thread: Connect to two networks simultaneously

  1. #1
    Join Date
    Jan 2015
    Beans
    1

    Connect to two networks simultaneously

    I want to connect to two networks simultaneously using the Ethernet and in-built WiFi or to two WiFi networks by installing an additional WiFi adapter.


    My requirement: I have two sets of devices (Group A and group B) that need to communicate with each other but not directly. There is no internet at the location. Group A devices are connected to WiFi router A and group B devices to WiFi router B (It is necessary that they should not be connected to the same router). I want the Ubuntu device to connect to both router A and router B and act as an intermediary between the two groups. The Ubuntu device should receive messages from Group A (through router A), process the information and send notification of the result to Group B (through router B) and vice versa.


    Questions:


    1. How do I setup Ubuntu to connect to two networks simultaneously?
    2. How do I identify which network a message is from and handle that message accordingly?
    3. How do I specify the target network for my notification and send it to that network?



    Thanks.

  2. #2
    Join Date
    Dec 2007
    Beans
    562

    Re: Connect to two networks simultaneously

    I assume the Ubuntu box has dual NICs. You can make Ubuntu into a router:

    1. Disable the routing functions on the wifi routers and use them as access points only.
    2. enable IP forwarding in Ubuntu by uncommenting the following line in /etc/sysctl.conf
    #net.ipv4.ip_forward=1
    3. add nat masquerading to iptables by passing the command:
    iptables -A POSTROUTING -t nat -j MASQUERADE
    4. set up routing tables for the clients

    If you want, you can also set up DHCP service on Ubuntu which services both networks, also DNS or whatever other network service you need.

Tags for this Thread

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
  •