LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-15-2015, 08:04 AM   #1
sivakumarnatarajan
LQ Newbie
 
Registered: Jan 2015
Posts: 3

Rep: Reputation: Disabled
Connect Linux 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 Linux device to connect to both router A and router B and act as an intermediary between the two groups. The Linux 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 Linux 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.
 
Old 01-15-2015, 09:14 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,931

Rep: Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017
Quote:
Originally Posted by sivakumarnatarajan View Post
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 Linux device to connect to both router A and router B and act as an intermediary between the two groups. The Linux 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.
  1. How do I setup Linux 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?
What you're asking is VERY basic networking. One of the networks will be the default network (the 'default route'), the other just needs to be specified. So:
  1. If you have your wired ethernet on network 10.11.11.xx, and the default route is set to be 10.11.11.1, then your Linux system will 'see' and know about devices on that network. If that network doesn't 'know' about any other networks, the traffic stops there.

    So, you configure another route to the wifi network, using the wifi adapter, say at 10.12.12.xx. The man page on the ifconfig command will tell you the syntax to use, but it'll be something like:
    Code:
    ifconfig wlan0 10.12.12.0 netmask 255.xx.xx.xx
    So now your Linux system knows about the 10.11.11 and 10.12.12. networks, both on different adapters.
  2. You write your program to look at it. Sorry, but there's not much we can tell you, since you don't say HOW you want to 'identify' something, or even WHAT you want to identify. You only say 'message', which could be anything from network chat, email, web page, or some other packet.
  3. The same way you identify the 'message'....your program will handle this.
 
Old 01-15-2015, 11:47 AM   #3
sivakumarnatarajan
LQ Newbie
 
Registered: Jan 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks TBOne

Thanks TBOne. I am new to networking and have only a little working knowledge of Linux. But I am willing to learn and try whatever is necessary to make this work.

I have been working on this project for 6 months now and networking the devices as described in my original post is my next (required) step. So if you could give me pointers, I will work with them to achieve this.

I have just ordered a mini Linux computer to work with and it will be delivered to me by the end of this month. I can try your suggestions to step 1 once I get the device.

Regarding step 2 and 3, would I have to setup some server on the Linux device? I code in Python and Java, but I can learn anything else, if it will get the job done.

I still have to figure out how the devices in group A & B will communicate with the Linux device.

The devices in group A & B are tablets (iOS and Android). Group A are students and group B are teaching staff. The devices communicate with each other within the group but interface through the Linux device to interact with the other group.
 
Old 01-15-2015, 12:55 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,931

Rep: Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017Reputation: 8017
Quote:
Originally Posted by sivakumarnatarajan View Post
Thanks TBOne. I am new to networking and have only a little working knowledge of Linux. But I am willing to learn and try whatever is necessary to make this work.

I have been working on this project for 6 months now and networking the devices as described in my original post is my next (required) step. So if you could give me pointers, I will work with them to achieve this.
The man pages for the various Linux commands should always be your first stop. Type in "man ifconfig", and it will get you going, and describe what that command does, the various options, etc.
Quote:
I have just ordered a mini Linux computer to work with and it will be delivered to me by the end of this month. I can try your suggestions to step 1 once I get the device.
Well, step 1 is just plugging it in. If your network has DHCP enabled, the system will get an address, set the default route, and bring things up. Done. If you have to manually set an address, how you do that will depend on your version/distro of Linux, and how you have configured things.
Quote:
Regarding step 2 and 3, would I have to setup some server on the Linux device? I code in Python and Java, but I can learn anything else, if it will get the job done.
No, as I said, all you have to do is bring the interface up on the second network, and set a route TO that network using the ifconfig command.
Quote:
I still have to figure out how the devices in group A & B will communicate with the Linux device.

The devices in group A & B are tablets (iOS and Android). Group A are students and group B are teaching staff. The devices communicate with each other within the group but interface through the Linux device to interact with the other group.
Then the application that runs on the tablets is going to do things, and what you really need here is to just set up a simple router/switch. This is easily done with IP forwarding, and has been covered before:
http://www.linuxquestions.org/questi...router-831044/
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
manage two wireless networks simultaneously piramiday Linux - Wireless Networking 2 12-18-2013 01:10 PM
Use both networks simultaneously ppp0(usb device) and eth0 vikas027 Linux - Networking 3 05-02-2011 03:01 AM
[SOLVED] Available networks but no able to connect on Puppy Linux with Broadcom B4312 nicolasjengler Linux - Networking 4 04-23-2011 12:48 AM
[SOLVED] WICD - connect to 2 different networks simultaneously? ahmadj Slackware 2 07-16-2010 10:57 AM
[SOLVED] how to connect two networks using 2 NIC linux pc laginagesh Linux - Networking 12 06-16-2010 06:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration