First I wanted to say this is not another how to setup your dialup connection to the ISP.:mrgreen:
This doesn't pretend to be a complete howto but I've seen quiet a few posts on this topic in Ubuntu forums unanswered, and it took me a long time to figure it out myself. I'm not an expert on this but it worked for me and hopefully will work for you or at least will get you started. For those who interested in setting up a callback server this is the first step, you will have to edit some more config files, but you will have to do this first. Links to more info and credits are at the end.

Part I . The short version:D on how to get remote access to your Ubuntu box via modem. Install mgetty

Code:

sudo apt-get install mgetty

Add a line at the end of file /etc/inittab

Code:

S0:2345:respawn:/sbin/mgetty ttyS0

If your modem is on COM1.
Initialize init by typing

Code:

sudo init q

Now from Win you can use HyperTerminal to connect to your Ubuntu box with your user name/pass.

Assumptions: drivers for your modems already installed and modem is at ttyS0. I have an external modem attached to COM1 - ttyS0, COM2 will be ttyS1. I didn't have X installed so I was using nano to edit conf files, you can use gedit if you have X installed or any other editor. Make sure your are familiar with the interface of the editor before you start modifying files. Make sure you create backups of the files before you modify them. You will need to use sudo or login as root for most of the tasks. If you don't know how to configure your dial up on your client look for a dial up howto or Ubuntu docs. I also assume that you already have your local nework including routers properly configured and have an access to the Internet from your Ubuntu server.

Part II.a - Dial in configuration

1. If not already installed use synaptic or apt-get to install ppp and mgetty packages. ppp should be already installed by default so

Code:

sudo apt-get install mgetty

2. Create a group ppp by adding a line in file /etc/group

Code:

ppp:x:1001:

3. Create a new user "pppuser" or whatever you will use for your dial in connection and assign a password by using

In my case the ms-dns entry had an ip of my router, if you using Linksys router it's 192.168.1.1 by default unless you changed it.

10. Create a file /etc/ppp/options.ttyS0 for the modem on ttyS0 and add following in there

Code:

192.168.1.3:192.168.1.201
noauth

Where first address is the address of your server for ppp connection which I think, should be different from your eth ip. The second address is the address that will be assigned to the client when connection is established. It will probably make life easier, unless you know what you doing, if all those addresses on the same subnet as your other computers on the network. (ip starts with the same 192.168.1.x numbers)
You can substitute

Code:

noauth

for a

Code:

debug

line, this way it will log some info about you connection in a syslog.

11. Edit file /etc/ppp/pap-secrets
find a line after

Code:

# Every regular user can use PPP and has to use passwords from /etc/passwd

It should look something like that

Code:

* hostname "" *

substitute hostnatname with * so it looks like that

Code:

* * "" *

If you don't do that pap will not authenticate you and you'll be immediately disconnected.

Now you're able to connect using dial-up connection from you laptop or a remote office into your Ubuntu server and use ssh or putty if you're using Win.

Part II.b - Accessing internet from a remote client

I'm sure there other or better solutions to that, but that was easy enough and it worked for me.

Code:

sudo apt-get install ipmasq

Done. ipmasq automatically senses all your interfaces and initializes IP Masquerade forwarding/firewalling and allows you to connect to the rest of your network and the Internet.

Thanks for the HOWTO Alex, I wanted to add a couple of remarks here since I had an awful time getting mgetty to work correctly for me, eventually compiling mgetty on Slackware before I figured out what wasnít working. Maybe itís modem-specific (I am using a Multitech MT5600ZDX), but my modem would never pick up correctly. The mgetty log files showed the modem returning NO CARRIER instead of the CONNECT string, mgetty would then bail and respawn, here is an excerpt from the log file (/var/log/mgetty/mg_ttyS0.log):

Long story short, what I finally figured out is that mgetty isnít sending the correct init string to the modem, so it apparently doesnít know that it is supposed to CONNECT when the phone rings. The problem init line (highlighted in blue) contains only ďATĒ; to get the modem to pick up I had to make mgetty send ďATS0=0Q0&D3&C1Ē instead. The default value for this string is hardcoded at compile-time, but we can use the init-chat parameter in /etc/mgetty/mgetty.config to specify the entire init sequence. I replaced the contents of mgetty.config with the following:

data-only YES
init-chat "" \dATQ0V1H0 OK ATS0=0Q0&D3&C1 OK

When I restarted mgetty and dialed in the modem picked up immediately and connected, bringing me straight to a login prompt.

I hope this helps other people who are banging their heads on the wall.

April 4th, 2007

Nerdcentric

Re: HOWTO dialin PPP server, RAS server

First, thanks to both of the posters above, this information helped a lot!

I did run into a problem with Ubuntu 6.10:

Quote:

4. Add a line to the file /etc/inittab
Code:
S0:2345:respawn:/sbin/mgetty ttyS0

This step threw me since Ubuntu 6.10 no longers has an inittab. Instead of this step I had to do the following:

1. Add a file named mgetty to /etc/event.d with:

Code:

start on runlevel-2
start on runlevel-3
start on runlevel-4
start on runlevel-5

stop on shutdown

respawn /sbin/mgetty ttyS0

Once I added that file, I rebooted my machine and the PPP server worked flawlessly. So I hope this helps someone! :biggrin:

April 17th, 2007

styelz

Re: HOWTO dialin PPP server, RAS server

Be carefull if using PPPOE for ADSL with the above settings.

Setting "-detach" in the /etc/ppp/options causes the pppoe_on_boot to stop the boot process.
I resolved this by placing all the options suggested above into the /etc/ppp/options.ttyS0 file instead.

I have feisty fawn and used the HOWTO dialin PPP server, RAS server.
I an not having any luck initializing the modem. I am using an external modem: BEST DATA 56K on a test sever. I followed all the suggestions in the HOWTO dialin PPP server,but, when I try to dialin from a laptop with a cell phone, the modem dose not pickup. Does anyone have any suggestions?

Thanks,

virtgrav

P.S.
The modem is on ttyS1. When I try the KPPP, it initializes the modem and dials out.

December 1st, 2007

bigdaddyweed

Re: HOWTO dialin PPP server, RAS server

Quote:

Part II.b - Accessing internet from a remote client

I'm sure there other or better solutions to that, but that was easy enough and it worked for me.

Code:
sudo apt-get install ipmasqDone. ipmasq automatically senses all your interfaces and initializes IP Masquerade forwarding/firewalling and allows you to connect to the rest of your network and the Internet.

I didn't have to do any more configurations for that.

I have "upgrade'd" & "update'd" my linux 6.06 server box, allowed all repositories. But i still get and error when i do "sudo apt-get install ipmasq"

Everything has worked for my up to this point so i am not sure what is going on.

Any Help??

December 12th, 2007

al108

Re: HOWTO dialin PPP server, RAS server

Quote:

Originally Posted by virtgrav

I have feisty fawn and used the HOWTO dialin PPP server, RAS server.
I an not having any luck initializing the modem. I am using an external modem: BEST DATA 56K on a test sever. I followed all the suggestions in the HOWTO dialin PPP server,but, when I try to dialin from a laptop with a cell phone, the modem dose not pickup. Does anyone have any suggestions?

Thanks,

virtgrav

P.S.
The modem is on ttyS1. When I try the KPPP, it initializes the modem and dials out.

I haven't been using this configuration for a while now, but I do remember a lot of little things could make a difference. Also some modems could require additional configuration commands. Try resetting your modem to factory settings first, look at different AT commands that might enable your modem to answer. It wouldn't matter if it doesn't pick up whether you dial from a laptop with a cellphone or any other phone. I used external US Robotics and it worked fine out of the box.

December 12th, 2007

al108

Re: HOWTO dialin PPP server, RAS server

Quote:

Originally Posted by bigdaddyweed

I have "upgrade'd" & "update'd" my linux 6.06 server box, allowed all repositories. But i still get and error when i do "sudo apt-get install ipmasq"

Everything has worked for my up to this point so i am not sure what is going on.

Any Help??

Perhaps you can post your error.

February 5th, 2008

jalla2000

Cell phone as dial-in modem

Should it be possible to use my cell-phone connected to my server at /dev/ttyUSB0 as the answering internet-sharing modem? That would be very interesting since in norway there are cell-phone subscriptions that allow free calls between selectable numbers. I currently have my Nokia 7250i connected to my ubuntu server (DKU-5 cable). What do you guys think about this?