View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 10 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject: Modem connection
PostPosted: Mon Jan 01, 2007 11:34 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,

I ran into a need for dialup as that was all that was available for internet connection. To run the mythfilldatabase once in awhile here is one way of doing the task.

Keeping in mind that when you use the modem on a KM box to connect to the internet it is an unprotected machine. This is not good as after a while some lesser than nice person is going to discover you and make a game of "breaking in" or you end up in the google database forever.

First you currently need to
# apt-get install pppconfig
then run it armed with your isp information
# pppconfig
if you don't get it right the first time, simply re-run the app and edit things until the connection is happy :)

That install pppconfig is a rub... :( without internet.. however you can copy the deb over with a floppy or memory stick, rsync it from another computer, carry the computer to someones house that has an internet setup. But you need pppconfig.

Also, you may need to link your com port to the modem,
# ln -s /dev/ttySx /dev/modem
Use
# pon (isp-name-of-your-file) to dial and
# poff to hang up. I like pon & poff, clean and simple.

One of the got ya parts is the gateway when there is an ethernet card on board. Assuming since we are going throught the dialup in the first place, that it would be nice to be able to use that connection on another machine and also with your internal lan for working with in your KM box. The trick is on the KM box is remove the gateway.
# route del default
Now when you dial into your isp it will properly pickup the needed gateway and you can have full internet access. On your other machines, set the KM box as your gateway. Now when you are dialed in, you have a path to the internet.

Because of the bad people out there, there is a need to try and protect your system. I have gleened bits and pieces from the forum and as I find the entries again, will credit those fine folks. Here are some of the things I have done.
I run this script, to me it is a no thought process but to simply lockout two very sensitive areas even if it is only for a few minutes connection, although could be hours:
nano ssh-lock.sh
#!/bin/sh
#
echo "DenyUsers mythtv" >> /etc/ssh/sshd_config
echo "DenyUsers root" >> /etc/ssh/sshd_config
/etc/init.d/ssh reload


Run once as root.

If you need to ssh into your machine, simply log in with the account you created at install and then su -

The second thing I did was make an iptables to help filter.. I am sure there is someone out in KM forum land that can improve on this but it is a start. Note the ip and change the octets as needed for your system. This needs to be reloaded on boot so I add it to the bottom of bootmisc.sh
echo "sh /home/mythtv/tables.sh" >>/etc/init.d/bootmisc.sh
nano tables.sh
#!/bin/sh
#
/sbin/iptables -F
echo "1" > /proc/sys/net/ipv4/ip_forward

iptables -A INPUT -p icmp -j DROP
iptables -A INPUT -s 198.168.5.0 -p tcp --destination-port ssh -j ACCEPT

iptables -A OUTPUT -p tcp --destination-port telnet -j REJECT


/sbin/iptables -A FORWARD -s 192.168.5.0/24 -p tcp -j ACCEPT
/sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE


nano call-isp.sh
#!/bin/sh
#
cd /home/mythtv
echo "Starting Dialup........" >/home/mythtv/td.txt
route del default
pon (isp-name-of-your-file)
date >>/home/mythtv/fill.txt
#setserial /dev/ttyS2 irq 7
sleep 30
/sbin/route -n >>/home/mythtv/fill.txt
/sbin/ifconfig |grep P-t-P: >>/home/mythtv/fill.txt
ntpdate -u north-america.pool.ntp.org
mythfilldatabase
#lynx mysettopbox.tv
poff
echo "Returning to normal... as of:" >>/home/mythtv/fill.txt
tail /var/log/messages|grep Sent >>/home/mythtv/fill.txt
echo "Done"


You can watch what happens with:
$ tail -f /home/mythtv/fill.txt

The MASQUERADE addition allows your internal lan machines to use the KM box as a gateway to the internet while you are connected :)

Once all is ready, as root you should be able to sh /home/mythtv/call-isp.sh and obtain the zap2it guide information and if you put it in to the root crontab, have it do it when you are not using the phone :)
Oh, also you can change the web port to 8080 or something to hide you mythweb from prying eyes. nano /etc/apache/httpd.conf
Maybe this will open some ideas to make things even better.
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 05, 2007 10:29 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,

One more item, when you run the netcardconfig, set for manual and fill in everything including your isp dns addresses. LEAVE the gateway blank or you won't be able to clear the route default and it will not properly start the pppd.

Any one besides me use dial up?
Thanks
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 12, 2007 1:35 pm 
Offline
Joined: Sun Mar 11, 2007 3:08 am
Posts: 18
Hi Mike,

noooow. Well. Thanks to your help I am a little farther on my quest configuring a mythtv-system.

My most pressing problem right now (a have a list that would go across the Atlantic) is, that I just don´t know

how to set up an old fashioned dial up internet connection with a 56k-modem.

I am even lacking the fantasy for google-search-words.

Do you have an easier way than the above (most impressing!) codes? Something like a small gui-based utility?

Thanks in Advance,

red


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 12, 2007 4:15 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,

It really isn't that tricky to make work however trying to tell an imaginary person takes a writing skill that I have yet to aquire and probably never will. :)

I would suggest trying to make the scripts as posted and then we can review them to be right for you. It does work as I have two boxes that make 4 calls per day and sets the clock at the same time.

There isn't a gui per se, however the pppconfig (as root) gives a decent dialog box to work in and the rest is easy from the command line. You can do an
# apt-get install gedit
to have a friendly text editer to make the scripts. Use an xterm as mythtv user to launch it and root run the script when finished.
$ gedit &
should work every time.

Mike


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 17, 2007 7:22 am 
Offline
Joined: Sun Mar 11, 2007 3:08 am
Posts: 18
Hi tjc,

I downloaded the .debs for pppconfig and gedit, but was not able to install either.

When I tried

Code:
dpkg -i ....deb


I got dependency problems. After downloading the dependend packages and trying to install them I got even more depency problems and so on.

pppconfig depends on ppp depends on libpcap, which I do not find on debian.org or elsewhere.

Don´t I need gnome to run gedit? I work with the R5E50 standard config, which seems to be Xorg. Do you know any other editors? They don´t have to be small, but good.

Thanks, Red[/code]
Code:
Code:


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 17, 2007 8:53 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,

Did you do as root, an apt-get update first ? Then the apt-get install pppconfig & apt-get install gedit ? You may have pulled the wrong debs for the kernel version so is always best to work with apt-get.

gedit you must run as user mythtv because it has control of the xserver screen.
pppconfig you must run as root.

Mike


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 18, 2007 12:58 pm 
Offline
Joined: Sun Mar 11, 2007 3:08 am
Posts: 18
Thanks again for the advice. After successfully installing the packages I

encountered new problems: I noticed that my @#!%-PC does not have an onboard analog modem!

Call me stupid, I deserve it!

Now I am trying to use my UMTS-capable XP Notebook as gateway. XP as Linux-slave. Nice thought.

Red


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 18, 2007 2:02 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,

Just pick up a used external modem. A quick request from a junk / pawn / computer shop will probably render something usable for an affordable cost.

I use what ever is available from 14.4 to 56k with out a problem :)

Mike


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 18, 2007 2:08 pm 
Offline
Joined: Sun Mar 11, 2007 3:08 am
Posts: 18
If I weren´t afraid of the dark, I would step down to my cellar. There is a WAF-Zero collection of old hardware with probably some old modems.

They really work? Are modems that standardized?

Red


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 18, 2007 5:58 pm 
Offline
Joined: Sun Jun 12, 2005 10:55 pm
Posts: 3161
Location: Warwick, RI
Hi,

In the way back machine, Radio Shack had a 300baud modem, used a manual on/off line button :) Well that modem will still work with most modern modems if they slow down to that speed.

Zoom, USRobots, there are a bunch that will work. Only the leased line units may give you some gas.

You can use gtkterm to check it out as it talks to the com ports.(apt-get install gtkterm) It is almost as good as ol' dos bananacom for testing modems.

Mike

If you have an isa slot, an old internal can be used (need jumpers to set port/irq) , kill printer in cmos and use setserial to map irq 7 to it. Works fine.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu