LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Thread Tools
Old 03-14-2004, 05:55 PM   #1
vbraca
LQ Newbie
 
Registered: Aug 2003
Location: Serbia
Distribution: SuSE
Posts: 29
Thanked: 0
SuSE 9.0: Internet connection sharing


[Log in to get rid of this advertisement]
Hi,

I have problems setting up /srv/www/cgi-bin/internet.html script to share my internet connection in a home network.
I can access it from both machines but nor the list of providers nor the status of smpppd service appears.

I've setup smpppd and smpppd-c conf files but still when I press connect - nothing happens ?

Even tried to edit file mannualy and to add interface and provider myself - still nothing - any ideas ?
vbraca is offline     Reply With Quote
Old 03-14-2004, 10:41 PM   #2
rootyard
Member
 
Registered: Aug 2003
Posts: 167
Thanked: 0
Have you considered using iptables for routing instead of the suse configuration?
rootyard is offline     Reply With Quote
Old 03-15-2004, 03:11 AM   #3
vbraca
LQ Newbie
 
Registered: Aug 2003
Location: Serbia
Distribution: SuSE
Posts: 29
Thanked: 0

Original Poster
Iptables/Firewall settings are O.K. - if I connect mannualy both machines can access Internet through gateway Linux machine.

I'm looking for a solution how to set smpppd-web package to allow my wife to control connection from her WinXP box.
vbraca is offline     Reply With Quote
Old 03-15-2004, 04:30 PM   #4
vbraca
LQ Newbie
 
Registered: Aug 2003
Location: Serbia
Distribution: SuSE
Posts: 29
Thanked: 0

Original Poster
Done !!!

Script was meant for specific machne setup though distiributed as part of official SuSE distirbution.

If anyone needs help with this one feel free to contact me anytime.

Regards,
vbraca is offline     Reply With Quote
Old 03-15-2004, 06:55 PM   #5
rootyard
Member
 
Registered: Aug 2003
Posts: 167
Thanked: 0
Is there anyway you can post a short description of how you solved the problem? This would be greatly appreciated and extremely helpful!
rootyard is offline     Reply With Quote
Old 03-16-2004, 12:49 PM   #6
vbraca
LQ Newbie
 
Registered: Aug 2003
Location: Serbia
Distribution: SuSE
Posts: 29
Thanked: 0

Original Poster
Here is adapted script for my configuration. Everything works execpt for selecting providers/ISP so I guess someone else could help with this one. So far my provider is selected as default one in /etc/sysconfig/network/ifcfg-ppp0

For /etc/smppd.conf add lines:

open-inet-socket=yes
host-range="x.x.x.x x.x.x.x."
#leave empty for no authentication
password=


Also language selection has been striped from script since I use English/Serbian only.

#!/bin/sh
# /srv/www/internet.html
# Internet Connection Script / HTML Frontend
# Authors: Christian Steinruecken <cstein@suse.de>
# Arvin Schnell <arvin@suse.de>
# Christopher Hofmann <cwh@suse.de>
# Adrian Schroeter <adrian@suse.de>
#

VERSION="0.45"

url="internet.html"
imgdir="/images/smpppd"
# interface is directly referenced
cint_cmd="/usr/sbin/cinternet-wwwrun --interface-name=ppp0"


wait=60
cmd=""
# lang="english"
# notice that result of cint_cmd is changed since SuSE 7.3

conn_status=`${cint_cmd} --status | grep "status: " | cut -b 9-`

case "$conn_status" in
disconnected) wait=60 ;;
lurking) wait=30 ;;
connecting) wait=5 ;;
connected) wait=30 ;;
disconnecting) wait=5 ;;
*) wait=60 ;;
esac

while [ -n "$1" ]; do
case "$1" in
"con") # CONNECT CMD
${cint_cmd} --start
wait=1
cmd=""
;;
"dis") # DISCONNECT CMD
${cint_cmd} --stop
wait=1
cmd=""
;;
"sel") # SELECT: DISPLAY ISP BOX
wait=60
cmd="sel"
;;
"act") # SELECT ISP CMD
${cint_cmd} --provider-number "$2"
shift
cmd=""
shift
;;
# "lang")# CHOOSE LANGUAGE
# lang="$2"
# shift
# ;;
esac
shift
done

# LANGUAGE definitions

STR_DIS="Disconnected"
STR_LURING="Lurking"
STR_CONING="Connecting"
STR_CON="Connected"
STR_DISING="Disconnecting"
STR_ERR="Error"

STR_CONNECT="Connect"
STR_DISCONNECT="Disconnect"

STR_STATUS="Status"
STR_RETURN="Return"

STR_CISP="Current provider:"
STR_SEL_ISP="Select provider"
STR_ASEL_ISP="Select a provider:"
STR_NO_ISP="No provider selected"

STR_HEADLINE="Internet Dialup Connection"
STR_SERVER="Server"

# END of language definition


getproviders() {
n="0"
while read line; do
set -- $line
num="$1"
n=`expr $n + 1`
shift
prov=$*
case "$num" in
0) echo "<tr><td bgcolor=\"#ffffde\">[ <a href=\"$url?act+${n}\">$prov</a> ]</td></tr>" ;;
1) echo "<tr><td bgcolor=\"#d0d0d0\">[ <a href=\"$url?act+${n}\">$prov</a> (*) ]</td></tr>" ;;
esac
done
}


get_current_provider() {
found=""
while read line; do
set -- $line
num="$1"
shift
prov=$*
if [ "$num" = "1" ]; then
echo "$prov"
found=1;
fi
done
if [ -z "$found" ]; then
echo "<i>$STR_NO_ISP</i>"
fi
}


ISP_box() {
cat <<-EOF
<table bgcolor="#aFaF8E" border=0 cellpadding=3 cellspacing=0>
<tr>
<td>
<table bgcolor="#FFFFDE" border=0 cellpadding=4 cellspacing=0>
<tr>
<td>
<b>$STR_ASEL_ISP</b>
</td>
</tr>
EOF

${cint_cmd} --provider-list | getproviders

cat <<-EOF
</table>
</td></tr>
</table>

EOF
}


page_start() {
cat <<-EOF
Content-type: text/html; charset=UTF-8
Refresh: $wait; URL=$url

<!--------------------------------------------- page start ------------------------------------------>
<html>
<head>
<title>SuSE Linux Connectivity Server - $STR_HEADLINE</title>
<meta http-equiv="expires" content="0">
<meta name="Author" content="Christian Steinrücken <cstein@suse.de>">
<meta name="Author" content="Christopher Hofmann <cwh@suse.de">
<meta name="Version" content="$Version">
<meta name="charset" content="iso-8859-1">
<link rel=stylesheet type="text/css" href="/slcs.css">
<!--<link rel="SHORTCUT ICON" href="/favicon.ico">-->
</head>
<body bgcolor="#FFFFFF" marginwidth="0" marginheight="0">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr bgcolor="#FFFFFF">
<td valign="top" width="1%"><img src="/images/logo-new-l.gif" alt=""></td>
<td valign="top">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td valign="top">
<img src="/images/logo-new-r.gif" alt=""><nobr><BR><img src="/images/space.gif" alt="" width="1" height="4"><BR>
<font size="+3">SuSE Linux Connectivity Server</font><BR>
$STR_HEADLINE<br><br></nobr>
</td>
</tr>
<tr>
<td>
<font size="-1">
<a href="http://`hostname -f`/">Main Page</a>
| <a href="http://internet/">Internet Connection</a>
| <a href="http://password/">Change Password</a>
| <a href="http://`hostname -f`/susehelp/">Help</a>
</font>
</td>
</tr>
</table>
<hr noshade>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td valign="top" align="left" width="1%" bgcolor="#FFFFFF"><img src="/images/space.gif" alt="" width="2" height="1" border="0"></td>
<td valign="top" width="1%" bgcolor="#FFFFFF">
<img src="/images/space.gif" alt="" width="120" height="5" border="0"><br>
<!--
<table bgcolor="#adad89" border="0" cellpadding="2" cellspacing="0">
<tr>
<td>
<table bgcolor="#fdfdc8" border="0" cellpadding="3" cellspacing="0">
<tr>
<td><font size="-1">
<img src="/images/space.gif" width="110" height="1"><br>
[MENU]
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
-->
</td>
<td valign="top" align="left">
<CENTER>
<font size=\"+2\"><b>$STR_SERVER: `hostname -f`</b></font><br><br>

EOF
}


page_end() {
cat <<-EOF

<!--------------------------------------------footer -------------------------------------------->
</CENTER>
<br>
<hr noshade>

<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td align="right">&copy;2001 <a href="http://www.suse.com">SuSE Linux AG</a></td>
</tr>
</table>

</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

EOF
}

connection_status() {
case "$conn_status" in
disconnected) echo -n "<font color=\"#1DD624\"><b>$STR_DIS</b></font>" ;;
lurking) echo -n "<font color=\"#E55C0D\"><b>$STR_LURING</b></font>" ;;
connecting) echo -n "<font color=\"#E55C0D\"><b>$STR_CONING</b></font>" ;;
connected) echo -n "<font color=\"#F02020\"><b>$STR_CON</b></font>" ;;
disconnecting) echo -n "<font color=\"#E55C0D\"><b>$STR_DISING</b></font>" ;;
*) echo -n "<font color=\"#A0A0FF\"><b>$STR_ERR</b></font>" ;;
esac
}

dialbox() {
cat <<-EOF
<table bgcolor="#aFaF8E" border="0" cellpadding="3" cellspacing="0">
<tr>
<td>
<table bgcolor="#FFFFDE" border="0" cellpadding="3" cellspacing="0">
<tr>
<td colspan="2" align="center">$STR_CISP<b>
EOF

${cint_cmd} --provider-list | get_current_provider

echo "<br>$STR_STATUS"
connection_status

cat <<-EOF
</b></td></tr>
<tr>
<td align="center"><a href="$url?con"><img src="/images/connect_creating.png" border="0"></a><br>
[&nbsp;<a href="$url?con">$STR_CONNECT</a>&nbsp;]</td>
<td align="center"><a href="$url?dis"><img src="/images/connect_no.png" border="0"></a><br>
[&nbsp;<a href="$url?dis">$STR_DISCONNECT</a>&nbsp;]</td>
</tr>
</table>
</td>
</tr>
</table>

EOF
}

#
# here comes the main page
#

page_start

case "$cmd" in
sel) ISP_box
echo "<br>[ <a href=\"$url\">$STR_RETURN</a> ]" ;;
*) dialbox
getproviders
echo "<br>[ <a href=\"$urlsel\">$STR_SEL_ISP</a> ]" ;;
esac

page_end
vbraca is offline     Reply With Quote
Old 03-17-2004, 10:04 AM   #7
rootyard
Member
 
Registered: Aug 2003
Posts: 167
Thanked: 0
Thank You!
rootyard is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
internet connection sharing with suse 9.2 kkolo Linux - Networking 4 06-19-2005 08:24 PM
SUSE 8.2 Internet connection sharing Genjix Linux - Networking 1 01-09-2004 10:11 AM
Suse 8.0 Internet Connection Sharing ? cmisip Linux - General 0 11-04-2002 07:05 PM
internet connection sharing with SuSE 8.1 marsonist Linux - Networking 4 10-30-2002 01:06 PM
Internet Connection Sharing SuSE 8.0 Tezdread Linux - Networking 2 09-01-2002 06:39 AM


All times are GMT -5. The time now is 05:19 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration