LinuxQuestions.org
Help answer threads with 0 replies.
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 02-05-2011, 05:06 PM   #1
denis1314
LQ Newbie
 
Registered: Nov 2003
Location: Geneva
Distribution: suse
Posts: 17

Rep: Reputation: 1
coexistence of a LAN connection and a broadband mobile connection


Description

I have a LAN (2 PC !) wire connected and I use a Huawei e182e to join the internet (If you have problem to install the Huawei on Linux, don't install drivers proposed on forums or don't try to unlock it. It's not necessary, simply install a kernel > 2.6.34 and it will install itself as a perfect plug and play).

On the unconnected machine, the Internet is accessible normally from the broadband dongle, but the connection stops when I plug the LAN cable.

It's normal since the PC cannot use both network connections simultaneously without a previous configuration, and the question is precisely there !

Bridging could be a solution but mobile broadband uses ppp protocol that is not on the same layer as wired LAN. brctl refuses to add the key into the bridge configuration.

Vtun seems a better approach since it works more independently from the protocols, but it must be installed on both sides and the broadband dongles does not accept software installation in it.

Documentation from Huawei is quite inexistent.

Actually the story could be the same for a computer connected to a wired LAN and using a wireless dongle, but here bridging is feasible (not tested by me) because they work on the same layer.

I tried to deactivate LAN switching in the BIOS: no result
static address with gateway pointing on the other device (I tried everything) no result.


How to bridge a ppp dongle with a wired LAN ?
 
Old 02-07-2011, 06:02 AM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Try using IP tables' NAT capability. It works at a higher level than bridging and I think it will work with your ppp device. I know it works when I use my cell phone which uses a PPP connection. I use this technique to get a connection to a credit card processing machine via a cross-over cable when I am in remote locations with only cell-phone internet access.

The first step is to turn on ip-v4 forwarding. In your /etc/syscontrol, set net.ipv4.ip_forward = 1. Note, in Ubuntu (which is what your info is showing you are using) it is /etc/sysctl.conf.

Then you need to use IP tables to "bridge" the interfaces. This is called ip masquerading. Use the following command:
Code:
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
This assumes your interface is ppp0, check with ifconfig.

Finally, there are a couple of things you will need to do. First, make sure that you have a non-conflicting private LAN address for your LAN. By non-conflicting I mean one that is distinct from your ppp0 interface, which may use something like a 10.x.y.z address. You will need to set the gateway on the (second) PC to the IP address of your PC with the ppp0 interface. You will also need to setup the DNS servers on the second PC, which can be the ones of your provider.
 
1 members found this post helpful.
Old 02-07-2011, 08:23 AM   #3
denis1314
LQ Newbie
 
Registered: Nov 2003
Location: Geneva
Distribution: suse
Posts: 17

Original Poster
Rep: Reputation: 1
Thank you for your answer, but no change ! anyway, it certainly the correct direction.

My configuration is 2 PCs connected with a LAN through a hub. The internet connection comes from the ppp0 that is a broadband mobile connection plugged into an USB port.

Hypothesis 1
The dongle is not a router and gives addresses that are not part of the LAN. I imagine that this address must be converted first into a local address.

Hypothesis 2
It's simply not possible !!

I'm confused and must read more before taking your time. I'll be back soon !!

sincerely.
 
Old 02-07-2011, 11:07 AM   #4
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Just to clarify, the command for iptables goes on the PC with the dongle, not the client/LAN PC that you want to get access. Also, yes, the dongle should give addresses that are not part of the lan and these should be associated with your ppp0 interface. For example, if your dongle gives 10.0.0.1, you can use 192.168.0.2 for the wired connection eth0 of this PC as it is a different range. Then on the 2nd PC, the one that you connect via the hub, give it an address of 192.168.0.3 and set its default gateway to 192.168.0.2. On 192.168.0.2 run the IP tables command shown above and turn on ipv4 forwarding. Note, especially the iptables command, it is not persistent across reboots unless you have an iptables configuration. The ipv4forwarding may not be either (I can't recall, but I remember reading something about this). Make sure you can ping from 192.168.0.3 to 192.168.0.2 and from 192.168.0.2 to wherever else like google.com. With the bridging features then enable, you should be able to ping from 192.168.0.3 to the same address. Remember, though that 192.168.0.3 will require DNS servers that it can access to resolve hostnames or else it will appear to not work.
 
1 members found this post helpful.
Old 02-07-2011, 12:38 PM   #5
denis1314
LQ Newbie
 
Registered: Nov 2003
Location: Geneva
Distribution: suse
Posts: 17

Original Poster
Rep: Reputation: 1
I really appreciate your help.
I configured as explained and the machine 192.168.0.2 (the one with the dongle) stops pinging internet when I plug the LAN cable. Actually, I'm blocked on the very first step of the story.
 
Old 02-07-2011, 01:01 PM   #6
denis1314
LQ Newbie
 
Registered: Nov 2003
Location: Geneva
Distribution: suse
Posts: 17

Original Poster
Rep: Reputation: 1
On the PC with the dongle I configured the eth0 to be 192.168.1.2 netmask 255.255.255.0 but what must be the gateway ? on the second PC it's clear but for me it's the next step.
 
Old 02-07-2011, 02:50 PM   #7
denis1314
LQ Newbie
 
Registered: Nov 2003
Location: Geneva
Distribution: suse
Posts: 17

Original Poster
Rep: Reputation: 1
Wink Finally that works and this is how:

On the computer with the dongle:
===================================
I configured IP forwarding as explained:

in the file /etc/sysctl.conf uncomment the line

net.ipv4.ip_forward=1

I rebooted as proposed on another forum and next

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
iptables-save

NO REBOOT,

eth0 IPv4 settings

manual IP address 192.168.1.15 netmask 255.255.255.0 Gateway 0.0.0.0. DNS servers empty, search domains empty, no route defined

mobile broadband IPv4 settings

method automatic ppp
no route defined


Computer attached to the preceding one with a LAN wire
======================================================
eth0 IPv4 settings:
manual IP address 192.168.1.3 netmask 255.255.255.0 Gateway 192.168.1.15 DNS server: the one that appears on the dongle info box (preceding computer that has the dongle attached: right click on the network manager applet and select connection information) search domains empty, no route defined
No IP forwarding on this computer !

that's it
Many thanks to Noway2 that gave me the correct direction.
 
  


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
[SOLVED] Mint / Ubuntu mobile broadband connection problems Desdd57 Linux - Newbie 12 11-03-2010 03:17 PM
about the broadband lan connection hawaraj Linux - Newbie 3 08-08-2010 09:46 PM
Help Newbie struggling with Mobile Broadband Connection pinkskull Linux - Newbie 14 07-22-2009 11:56 AM
Net Connection (Mobile Broadband) Problem in Ubnutu 9.04 alamgir Linux - Newbie 5 06-24-2009 12:57 AM
cannot set up mobile broadband internet connection with huawei220 modem stoyaltsev Linux - Newbie 1 03-09-2009 07:02 PM

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

All times are GMT -5. The time now is 06:13 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