Dial-in server

nagaya

Member
Mar 18, 2007
12,671
194
0
guys!i found this script written by me a long time ago for my home made dial-in server;
this is like the same in SLT ...etc which allows users to be connected using dialup modems/.
this is very useful when there is no broadban connections everywhere.....

I wrote this in 2003 or 2004 for Mandrake Linux 9/10 and I used Intel/Conexant modems with proper drivers...
I don't know how this match for nowadays... dan handle with care :D

©Nagaya 2004 - Released as GPL 2.0

Begin of Script _______>

#/bin/bash
#su -
#mkdir /root/dialin
echo "Please enter your path to Mgetty rpm : "
read mgpath
echo "Mgetty source path is" $mgpath
rpm -Uvh $mgpath
echo "Please enter your modem port (without /dev) :"
read mdname
echo "We are going to use modem on /dev/"$mdname
echo "debug 2" > /etc/mgetty+sendfax/mgetty.config
echo "port "$mdname >> /etc/mgetty+sendfax/mgetty.config
echo "Please enter speed of your modem [or 57600 for 56K modems]"
read mdspd
echo -e debug 6"\n"data-only y"\n"speed $mdspd >> /etc/mgetty+sendfax/mgetty.config
echo "We are going to use AutoPPP"
echo "/AutoPPP/ - - /etc/ppp/ppplogin debug" > /etc/mgetty+sendfax/login.config
chmod 600 /etc/mgetty+sendfax/login.config
echo S2:2345:respawn:/sbin/mgetty $mdname -D /dev/$mdname >> /etc/inittab
init q
echo "Please enter your Hostname ,may be:";hostname
read hostn
echo "Please enter your IP ,may be:";hostname -i
read hostip
#hostname $hostn
#hostname $hostip
echo -e lock"\n"-detach"\n"crtscts"\n"asyncmap 0"\n"modem"\n"ms-dns $hostip"\n"debug 6"\n"ns.$hostn:ppp0.$hostn"\n"idle 180 > /etc/ppp/options
echo -e mesg n"\n"stty -echo"\n"/usr/sbin/pppd silent auth -chap +pap login > /etc/ppp/ppplogin
chmod 744 /etc/ppp/ppplogin
echo -e lock"\n"-detach"\n"crtscts"\n"asyncmap 0"\n"modem"\n"ms-dns $hostip"\n"debug 6"\n"ns.$hostn:ppp0.$hostn"\n"idle 180 > /etc/ppp/options.$mdname
echo "* * "\"\"" 172.16.4.1" >> /etc/ppp/pap-secrets
chmod u+s /usr/sbin/pppd
echo $hostip" "$hostn" ns."$hostn" www."$hostn" mail."$hostn >> /etc/hosts
echo "172.16.4.1 ppp0 user modem user."$hostn" ppp0."$hostn" modem."$hostn >> /etc/hosts
echo -e NETWORKING=yes"\n"FORWARD_IPV4=yes"\n"HOSTNAME=$hostn"\n"DOMAINNAME=$hostn > /etc/sysconfig/network
echo "Set up completed ! Have fun"
echo "User useradd & passwd to add new users"
 

nagaya

Member
Mar 18, 2007
12,671
194
0
Some LOGs prove this works perfectly.....
As I remeber the speed was about 33.6kbps at that time :)
ada kale kollo apita hina wena athi..... :D But it's so interesting to share files with friends

172.16.4.1 - - [23/Dec/2004:16:59:03 +0000] "GET / HTTP/1.1" 200 6577 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
172.16.4.1 - - [23/Dec/2004:16:59:11 +0000] "GET /icons/medbutton.png HTTP/1.1" 200 11186 "http://172.16.3.1/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
172.16.4.1 - - [23/Dec/2004:16:59:11 +0000] "GET /icons/apacheicon.gif HTTP/1.1" 200 1806 "http://172.16.3.1/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
172.16.4.1 - - [23/Dec/2004:16:59:13 +0000] "GET /icons/stamp.gif HTTP/1.1" 200 7603 "http://172.16.3.1/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
172.16.4.1 - - [23/Dec/2004:16:59:18 +0000] "GET /icons/logo.gif HTTP/1.1" 200 13720 "http://172.16.3.1/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
172.16.4.1 - - [23/Dec/2004:16:59:35 +0000] "GET / HTTP/1.1" 200 6577 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
172.16.4.1 - - [23/Dec/2004:16:59:36 +0000] "GET /icons/medbutton.png HTTP/1.1" 200 11186 "http://myhost.net" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
172.16.4.1 - - [23/Dec/2004:16:59:36 +0000] "GET /icons/apacheicon.gif HTTP/1.1" 200 1806 "http://myhost.net" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
172.16.4.1 - - [23/Dec/2004:16:59:38 +0000] "GET /icons/stamp.gif HTTP/1.1" 200 7603 "http://myhost.net" "Mozilla/4.0 (compatible; MSIE
 

nagaya

Member
Mar 18, 2007
12,671
194
0
upulcranga said:
he.......he......thnx !
ddnt get wot this is abt, bt thnx anywayz !
Check this !! http://en.wikipedia.org/wiki/Dial-up

and i forgot to say i gave internet access to one of my friends via my server :lol: :lol:
This also can be done with Win XP pro and even without telephone lines using null-telephone circuit(i tried with 1st circuit on this page and worked well http://www.jagshouse.com/modem.html ;PC eka gini gaththoth waga kiyanu nolabe... :P)
 

TDM

Well-known member
  • Jan 7, 2007
    2,347
    25
    48
    37
    Kandy
    ah...umaba ela wedakarayekene....(a good servant...:lol::lol:.lolzz..kiddin kk..)
    hodai hodai,,..>>> mamath thawa tika dawasakin gamata enter wennam ko.., :P:P:P:P
     

    nagaya

    Member
    Mar 18, 2007
    12,671
    194
    0
    ela ela...ip widiyata ganna one lan ips 10......;172...............;192;,,,,,,,,,,,,,, wage
    nathnam anikawa ekka conflicts enawane...........