View previous topic :: View next topic |
Author |
Message |
taskara Advocate
Joined: 10 Apr 2002 Posts: 3763 Location: Australia
|
Posted: Tue Sep 23, 2003 4:04 am Post subject: Making a Dial In Server MiniHowTo |
|
|
Making a Dial In Server MiniHowTo
With thanks to PowerFactor and VanDan
and this howto by Josh Gentry
This is a guide to help you create a dial in server, so that someone can remotely dial your server via a phone line and connect to your network.
This guide does NOT cover network or internet setup, nor does it cover internet connection sharing or firewalls.
Firstly you need the normal network support in your kernel, as well as TCP/IP protocol.
So, from /usr/src/linux, run
make menuconfig
Under Network Device Support, compile in PPP, PPP support for async serial ports, PPP support for sync tty ports, PPP Deflate compression, SLIP (serial line) support, CSLIP compressed headers, Keepalive and linefill
[img:a98d47720a]http://www.smartclan.com/images/pppkernel.jpg[/img:a98d47720a]
Code: | make dep clean bzImage modules modules install
mount /boot
mv arch/i386/boot/bzImage /boot/bzImage-ppp |
add a new entry into grub or lilo for bzImage-ppp
reboot into your new kernel.
Once you are in your new kernel, emerge the following:
As root, run
Press Ctrl + C to kill it, and WAIT.
You should see lots of gobbledegook all over the screen.
[img:a98d47720a]http://www.smartclan.com/images/pppd.jpg[/img:a98d47720a]
This shows that you have PPP support built into your system.
Now we have to configure mgetty.
Mgetty is the program that will sit and wait for incoming calls, and then answer them and tell PPP to start the connection.
There are 4 main files you have to configure. We are going to use /etc/password to authenticate users. All linux users to dial up, but restrict those we dont want by not adding them to the ppp group.
Edit login.config
Code: | nano -w /etc/mgetty+sendfax/login.config |
Under AutoPPP section add the following
Code: | /AutoPPP/ - - /usr/sbin/pppd file /etc/ppp/options.server |
This tells mgetty to automatically start PPP when a connection is made, and to use the options specified in /etc/ppp/options.server
Now we create that file:
Code: | nano w /etc/ppp/options.server |
This is the entry I have in there:
Code: | debug
asyncmap 0
modem
crtscts
lock
require-pap
refuse-chap
login
proxyarp
ms-dns 192.231.203.132
ms-dns 192.231.203.3
192.168.0.10:192.168.0.20 |
Copy all of the above, changing the ms-dns settings to that of your ISP, and the ip addresses at the bottom.
The ip addresses there are firstly, the address of the server, and then the ip address you will give the dialing in pc. In my case the server is 192.168.0.10, and the dial in machine will be 192.168.0.20.
Now we edit inittab and tell it to start mgetty
Code: | nano w /etc/inittab |
and add the following line at the bottom
Code: | S2:2345:respawn:/usr/sbin/mgetty ttyS0 -D /dev/ttyS0 |
This tells your system to keep mgetty running, and to expect data calls.
Next we need to tell ppp who can authenticate.
This is done through a few steps, the first being an entry in pap-secrets
Code: | nano -w /etc/ppp/pap-secrets |
add the following entry:
This says that anyone can authenticate, from any server. Is this a security risk you ask? Well no its not because we will restrict who can actually start ppp in a moment.
Now you need to create a group called ppp.
Now we change the ownership of pppd to the ppp group.
Code: | chgrp ppp /usr/sbin/pppd |
Also we change the permissions so that users can execute it:
Code: | chmod 4550 /usr/sbin/pppd |
now check the permissions
Code: | ls l /usr/sbin/pppd |
they should look like this:
Code: | -rwsr-x--- 1 root ppp 249636 Sep 11 22:30 /usr/sbin/pppd |
Assuming you have a user already on your system, you need to add him/her to the ppp group.
Code: | usermod -G ppp [username] |
Dont forget to add all the other groups your user may be a member of like wheel, audio, cdrom, and games, etc. so it may look something like this:
Code: | usermod -G ppp,wheel,audio,games,cdrom [username] |
You will need to do this for every user you want to be able to dial in and it is the ONLY thing you need to do to enable users to dial in.
If you are dialing into a server, and NOT a router, then you will need to turn on packet forwarding.
Code: | echo 1 > /proc/sys/net/ipv4/ip_forward |
Add this to local.start so that it is turned on every reboot.
Code: | nano -w /etc/conf.d/local.start |
Quote: | # /etc/conf.d/local.start:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/local.start,v 1.4 200$
# This is a good place to load any misc.
# programs on startup ( 1>&2 )
echo 1 > /proc/sys/net/ipv4/ip_forward
|
save and exit.
Obviously, connect your modem, and reboot your machine.
Windows setup:
Make a new dial up connection.
The phone number is your home / office number that the modem is connected to.
Your username is your normal linux login name, with your linux password.
I like to specify is the IP address, and dns settings but this should not be necessary.
If you do want to, then under protocols, choose TCP/IP and enter in the ip address and dns servers you specified above in options.server.
Dial up and see if you can connect!
I think thats everything. This is what worked for me anyway.
Have fun !
Chris _________________ Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer! |
|
Back to top |
|
|
devon l33t
Joined: 23 Jun 2003 Posts: 943
|
Posted: Tue Sep 23, 2003 7:23 am Post subject: |
|
|
Not that I don't appreciate your hard work, but shouldn't this be in Documentation, Tips & Tricks. |
|
Back to top |
|
|
taskara Advocate
Joined: 10 Apr 2002 Posts: 3763 Location: Australia
|
Posted: Tue Sep 23, 2003 12:56 pm Post subject: |
|
|
thanks, but I dunno if it's good enough.
still, an admin will move it is he/she thinks it's appropriate to.
ta _________________ Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer! |
|
Back to top |
|
|
grudge Tux's lil' helper
Joined: 26 Oct 2002 Posts: 77 Location: South Africa
|
Posted: Mon Oct 06, 2003 2:32 pm Post subject: ADSL & Dial In Server |
|
|
Thanks man, it worked perfect for me. Just what I was looking for. I have one problem now. I have rp-ppoe also running for my adsl connection, but after setting up the dialup it kinda screwed that. The dialup works fine and it looks like it sets the dialed in connections to ppp0, which makes sense. Is there a way to run the dialup server and the adsl-connection on the same pc ? if so, how ? |
|
Back to top |
|
|
taskara Advocate
Joined: 10 Apr 2002 Posts: 3763 Location: Australia
|
Posted: Mon Oct 06, 2003 11:01 pm Post subject: |
|
|
Hey - I haven't done it on the same machine, however I assume it is possible by changing your pppoe connection to ppp1 instead of ppp0.
this is easy enough to do during the adsl-setup configuration.
let me know how you go!
Cheers _________________ Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer! |
|
Back to top |
|
|
grudge Tux's lil' helper
Joined: 26 Oct 2002 Posts: 77 Location: South Africa
|
Posted: Tue Oct 07, 2003 7:14 am Post subject: |
|
|
nope, no such luck. I had a look at the adsl-setup and the only connection related option you can specify is the eth0. I also had a look at any other rp-pppoe config files I could find and nothing. Any ideas ? |
|
Back to top |
|
|
gwydion Apprentice
Joined: 26 Nov 2002 Posts: 151 Location: Michigan, USA
|
Posted: Tue Oct 07, 2003 11:34 am Post subject: |
|
|
This sounds really cool, and I think I'll implement it when I put Gentoo back on my server...
Also, this definitely belongs in Documentation, Tips & Tricks. _________________ Linux User #223670 |
|
Back to top |
|
|
taskara Advocate
Joined: 10 Apr 2002 Posts: 3763 Location: Australia
|
Posted: Tue Oct 07, 2003 10:57 pm Post subject: |
|
|
grudge wrote: | nope, no such luck. I had a look at the adsl-setup and the only connection related option you can specify is the eth0. I also had a look at any other rp-pppoe config files I could find and nothing. Any ideas ? |
hmmm I thought it was at the beginning?
adsl-setup and it asks for a name for the connection? and the default is (ppp0)?
it has to have a name, cause it needs to know what to dial. it is definately ppp0, as you mentioned.
so how to change?
I don't use it so I'm not sure.. but I thought it was like the first option...
hmmm... _________________ Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer! |
|
Back to top |
|
|
PowerFactor Veteran
Joined: 30 Jan 2003 Posts: 1693 Location: out of it
|
Posted: Tue Oct 07, 2003 11:28 pm Post subject: |
|
|
grudge: One question. Do you already have nat setup on that machine? I'm pretty sure you would need nat rather than proxyarp since your machine is directly connected to the internet.
And thanks for the mention taskara. |
|
Back to top |
|
|
taskara Advocate
Joined: 10 Apr 2002 Posts: 3763 Location: Australia
|
Posted: Wed Oct 08, 2003 1:29 am Post subject: |
|
|
PowerFactor wrote: | And thanks for the mention taskara. |
LOL not at all! my pleasure _________________ Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer! |
|
Back to top |
|
|
zephyr1256 Apprentice
Joined: 10 Mar 2003 Posts: 170 Location: Kingsport, TN
|
Posted: Tue Dec 16, 2003 8:46 pm Post subject: |
|
|
Good work, I can't wait to try this out. Doing this has been one of my projects to do over Christmas break since I got a Powerbook for Christmas(Santa came early ) and I'd like to have some free dialup internet for when I'm places I don't have ethernet or WLAN access. I've done bits and pieces of the setup but since much of the documentation seems pretty old, and I haven't been able to test it, its good to hear an detailed approach that worked for a fellow Gentooer.
One question: if the modem is on the one and only phone line, will it pick up on voice calls(ie, does -D make it treat all calls as data calls, or does it not answer non-data calls)? That wouldn't be good, because I'd imagine whoever was calling would hear some static. I see that mgetty has an option to only pickup after a number of rings(-n option), I guess I could put it in the inittab line along with -D, just have to make sure my dialup settings on my Pbook don't cause it to give up if it doesn't answer quickly enough. _________________ The Congress shall have power...To promote the progress of science and useful arts, by securing for limited times to authors and inventors the exclusive right to their respective writings and discoveries; --U.S. Constitution. Article 1, Section 8. |
|
Back to top |
|
|
taskara Advocate
Joined: 10 Apr 2002 Posts: 3763 Location: Australia
|
Posted: Tue Dec 16, 2003 9:18 pm Post subject: |
|
|
zephyr1256 wrote: | Good work, I can't wait to try this out. Doing this has been one of my projects to do over Christmas break since I got a Powerbook for Christmas(Santa came early ) and I'd like to have some free dialup internet for when I'm places I don't have ethernet or WLAN access. I've done bits and pieces of the setup but since much of the documentation seems pretty old, and I haven't been able to test it, its good to hear an detailed approach that worked for a fellow Gentooer.
One question: if the modem is on the one and only phone line, will it pick up on voice calls(ie, does -D make it treat all calls as data calls, or does it not answer non-data calls)? That wouldn't be good, because I'd imagine whoever was calling would hear some static. I see that mgetty has an option to only pickup after a number of rings(-n option), I guess I could put it in the inittab line along with -D, just have to make sure my dialup settings on my Pbook don't cause it to give up if it doesn't answer quickly enough. |
I'm not 100% sure, I never had the need, but I will try it out later.
this may be of interest to you
https://forums.gentoo.org/viewtopic.php?p=711930#711930
Kind regards _________________ Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer! |
|
Back to top |
|
|
tiny Tux's lil' helper
Joined: 02 Dec 2003 Posts: 102 Location: Slovenia
|
Posted: Thu Oct 14, 2004 10:26 am Post subject: |
|
|
I made a simple dial in server without the ppp. Only mgetty and login.
I can't find any options for idle time. I would like to set up some options, so server would disconnect when there is no data on line for longer then idle time. I couldnt find any option on client side in minicom either.
Any suggestions?
T. |
|
Back to top |
|
|
Chrisw01 n00b
Joined: 22 Feb 2004 Posts: 1
|
Posted: Sat Nov 06, 2004 3:28 am Post subject: |
|
|
Okay, 1st of, lemme say great howto, I have refered it to numerous people.
2nd, has anyone else experienced the problem of this breaking with the emerge of ppp-2.4.2-r7? I allow family to share my connection and as of tonight, it quit working all together, I finally got it to start working again after hours of pulling my hair out by changing require-pap to refuse-pap this will now allow me to dial back in and share the connection otherwise I get a username and or password is invalid error.
Any light on this subject please, let me know, IT USED TO WORK FLAWLESSLY! |
|
Back to top |
|
|
dkaplowitz Guru
Joined: 22 Nov 2003 Posts: 596 Location: Philadelphia, PA
|
Posted: Sat Nov 06, 2004 3:33 am Post subject: |
|
|
Looks like a fine guide. I have an old USRobo 56K ext. that I (thankfully!) haven't used in at least 2 years...and I plan to find a use for it. Maybe I'll follow your instructions and set up a dial in VPN.
O/T, but is anyone using their *nix box for a phone answering/fax machine? I'd be curious to know how viable an alternative it is to the standard answering machine. _________________ http://dkap.info |
|
Back to top |
|
|
randomuser14 n00b
Joined: 30 Sep 2004 Posts: 1
|
Posted: Tue Nov 30, 2004 2:05 am Post subject: |
|
|
Has anyone been able to get wvdial to work with the above setup? I can't get wvdial to authenticate only with ppp (mgetty thinks I want /bin/login instead of /usr/sbin/pppd)?
I have even tried using (in wvdial) "Stupid Mode = 1", but it doesn't seem to help... If anyone can post their client ppp options file (eg /etc/ppp/options.ttyS0) I could verify if mine should be working or not |
|
Back to top |
|
|
tag n00b
Joined: 06 Mar 2003 Posts: 55
|
Posted: Sat Dec 24, 2005 11:10 am Post subject: |
|
|
Hi,
I have tried this howto and many others to get mgetty ->AutoPPP to work on a gentoo box.
I am dialing from a windowsXP box to the gentoo box.
I have the following installed:
emerge -vp ppp mgetty
These are the packages that I would merge, in order:
Calculating dependencies ...done!
[ebuild R ] net-dialup/ppp-2.4.2-r15 -activefilter -atm -dhcp* -ipv6 -mppe-mppc +pam -radius 0 kB
[ebuild R ] net-dialup/mgetty-1.1.30-r2 -doc 0 kB
l /usr/sbin/pppd
-r-sr-x--- 1 root ppp 231756 Dec 24 10:43 /usr/sbin/pppd*
the mgetty logfile has this:
12/24 13:04:41 yS0 select returned 1
12/24 13:04:41 yS0 checking lockfiles, locking the line
12/24 13:04:41 yS0 makelock(ttyS0) called
12/24 13:04:41 yS0 do_makelock: lock='/var/lock/LCK..ttyS0'
12/24 13:04:41 yS0 lock made
12/24 13:04:41 yS0 wfr: waiting for ``RING''
12/24 13:04:41 yS0 got: [0d][0a]RING[0d]
12/24 13:04:41 yS0 CND: RING
12/24 13:04:41 yS0 wfr: rc=0, drn=0
12/24 13:04:41 yS0 CND: check no: 'none'
12/24 13:04:41 yS0 send: ATA[0d]
12/24 13:04:41 yS0 waiting for ``CONNECT''
12/24 13:04:41 yS0 got: ATA[0d]
12/24 13:04:41 yS0 CND: OKATA[0d][0a]+FDM[0d]
12/24 13:04:56 yS0 CND: +FDM[0a][0d][0a]CONNECT ** found **
12/24 13:04:57 yS0 send:
12/24 13:04:57 yS0 waiting for ``_''
12/24 13:04:57 yS0 got: 24000/ARQ/V34/LAPM/V42BIS[0d]
12/24 13:04:57 yS0 CND: CONNECT 24000/ARQ/V34/LAPM/V42BIS
12/24 13:04:57 yS0 CND: found: 24000/ARQ/V34/LAPM/V42BIS[0a] ** found **
12/24 13:04:57 yS0 waiting for line to clear (VTIME), read:
12/24 13:04:57 yS0 looking for utmp entry... (my PID: 27335)
12/24 13:04:57 yS0 utmp + wtmp entry made
12/24 13:04:58 yS0 tio_set_flow_control( HARD )
12/24 13:04:58 yS0 print welcome banner (/etc/issue)
12/24 13:04:58 yS0 getlogname (AUTO_PPP), read:[0d]
12/24 13:05:52 yS0 input finished with '\r', setting ICRNL ONLCR
12/24 13:05:52 yS0 tio_set_flow_control( HARD )
12/24 13:05:52 yS0 print welcome banner (/etc/issue)
12/24 13:05:52 yS0 getlogname (AUTO_PPP), read:[0a]
12/24 13:05:52 yS0 tio_set_flow_control( HARD )
12/24 13:05:52 yS0 print welcome banner (/etc/issue)
12/24 13:05:52 yS0 getlogname (AUTO_PPP), read:NO CARRIER[0d]
12/24 13:05:52 ##### failed dev=ttyS0, pid=27335, got modem error 'NO CARRIER'
PPP is compiled into the kernel and the config files are as you said in the howto - identically
I never even get to start pppd ... it never gets there ?
Any ideas welcome - Thanks |
|
Back to top |
|
|
tag n00b
Joined: 06 Mar 2003 Posts: 55
|
Posted: Tue Jan 24, 2006 6:05 am Post subject: |
|
|
bump...
any ideas ? anyone ?? |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|