LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Dial-up internet connection unavailable if ethernet connected to LAN router (https://www.linuxquestions.org/questions/linux-newbie-8/dial-up-internet-connection-unavailable-if-ethernet-connected-to-lan-router-4175487905/)

LittleOldLady 12-13-2013 11:51 PM

Dial-up internet connection unavailable if ethernet connected to LAN router
 
I have Ubuntu 10.04 LTS installed on an elderly HP laptop and a dialup internet connection with Dodo Australia. I also have a DLink router (which expects the internet connection to be ADSL with an ADSL modem connected to iys "input" ethernet connection).
When I connect an ethernet cable to the router, the dial-up connection becomes dormant and unavailable. I suspect that what is happening is that the defaults on the network settings preferentially use an ethernet internet connection, which, of course, we do not have.
I have read lots about networking and setup needs, but I cannot find how to fix this.
What I really want to do is set up this laptop as the internet connection for the router. I do not know how.
I use wvdial to connect to the internet in a BASH shell. That was an exercise in itself, but that is working moderately reliably.
Can anyone tell me how to keep my dial-up connection active when I connect an ethernet cable to my computer, please?
Secondly, are there tricks and tips to allow my dial-up connection to provide internet to the router. Perhaps the laptop has to pretend to the router that it is a logged-in ADSL modem?
I am pretty comfortable with using BASH (my first computers only worked at command line level) but some of the networking terminology is still a mystery to me.
Thanks in anticipation of a solution!

jpollard 12-15-2013 11:47 PM

Very likely what is happening is that the default route is being switched to use the ethernet connection - which doesn't have internet access.

I'm not sure how the Ubuntu setup would control this.

To have the system relay the internet connection requires a system flag to be set: (file should be sysctl.conf) and the parameter is: net.ipv4.ip_forward = 1

Any other host connected to the router will have to have its default route set to the IP number of Ubuntu system. When connections to internet hosts are to be made, the initial connection from that host will go to the router, then to the Ubuntu host due to the default route on that host. The Ubuntu host has its default route set to go to the modem, and the net.ipv4.ip_forward flag will direct the network stack to forward the request out the default route. In addition, any reply coming back would be forwarded to the other host.

Now frequently this has to be combined with NAT (network address translation) as the internal router is using IP numbers that are designated to be "non-routable". The Ubuntu host should be able to be configured for this so that when the request for an outside connection arrives, the port that is assigned to it by the Ubuntu host is recorded in a table. The IP destination number for the internal host is replaced by public IP number given by the modem so that replys can be forwarded appropriately.

Sometimes the modem itself is a NAT router and that can also introduce some complexity. But one step at a time. Get the Ubuntu system working allowing connections to the internet AND connections to the hosts attached to the router. This is the biggest issue - after that, it is just configuration controls on how you want the NAT forwarding to be handled.

LittleOldLady 12-18-2013 08:40 PM

Without Gnome Network Manager
 
Thank you, we are making excellent progress.
One result of making the physical ethernet connection was that the Gnome Network Manager (network-manager) was removing the DNS nameserver data in /etc/resolv.conf and replacing it with a little comment which took credit for the change and redirected DNS to the router.
When I found out about this behaviour, I uninstalled network-manager and it no longer does that. Whether the Ubuntu setup does something else to make the ethernet preferential, I have not yet discovered.
A review of /etc/sysctl.conf revealed that it consisted entirely of comments, including the lines:

# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.ip_forward=1

So I have uncommented that line.

Plugging the laptop into the router now is not disconnecting my dial-up connection, which is brilliant. I am not certain whether the change to sysctl.conf was the solution (I think not) or the uninstallation of network-manager (I think this was the baddie). However, now that the major problem is resolved, only the minor one of how to relay the connection remains.
I shall follow the tutorials on how to manually establish an ethernet connection without network-manager and when I have sorted that out, will report my progress.

jpollard 12-19-2013 04:03 AM

I have always had trouble with NetworkManager.

My configuration uses a double NAT - The internet router is a NAT device going between the ISP and 192.168.1.x local network.

I then use NAT to forward connections between 192.168.0.x (my internal network) to the internet. The area that controls this is the firewall. The 192.168 networks are designated "non-routable" which prevents Linux from automatically forwarding such connections - thus the use of NAT, which will forward them.

Clumsy, but works.


All times are GMT -5. The time now is 12:10 AM.