קוד: |
#21/5/2007 #this script is open-source made by Carmit-levi for ubuntu users: # assume dhclient # assume pppd installed # assume no pptp program installed # assume buildin cdc_ether module in kernel and else usb ethernet support # #________________________________________________ if [ -e "$HOME/Desktop/CableScript_Installation_Directory" ] then echo "Please 1. locate installation directory at your desktop" echo " $HOME/Desktop" fi #___________________________________________________________________________ installation_directory=$HOME/Desktop/CableScript_Installation_Directory ISPinfo=$installation_directory/ISPinfo echo "index ISP_name VPN_PPTP VPN_L2TP 2ADSL_User_extentions" > $ISPinfo echo "1 netvision cable.netvision.net.il cable.netvision.net.il @INetvision @017" >> $ISPinfo echo "2 Internet_Zahav pns.inter.net.il lns.inter.net.il @IInzahav @015" >> $ISPinfo echo "3 Bezeq_BenLeumi matav.bezeqint.net matav.bezeqint @IBezint @014" >> $ISPinfo echo "4 Barak013 pns.barak.net.il cable.barak.net.il @IBarak none" >> $ISPinfo echo "5 kavey_zahav012 cablepns.012.net.il cablelns.012.net.il @IKzahav none" >> $ISPinfo echo "6 actcom pns4.actcom.net.il lns4.actcom.net.il @IActcom none" >> $ISPinfo #___________________________________________________ echo "Choose the number which assosiated with your ISP." echo "[ 1 by default ...]" more +2 $ISPinfo | awk {'print $1 "\t" $2'} read whichISP # input checking if [ -n "$whichISP" ] then echo "You insert $whichISP" echo "Input checking..." whichISP=$(echo $whichISP | grep '^[0-9]\{1,2\}$' | grep '^[1-9]') if [ -n "$whichISP" ] then maxISP=$(cat $ISPinfo | tail -n 1 | awk {'print $1'}) if [[ "$maxISP" < "$whichISP" ]] then echo "Wrong value - greater then $maxISP. Use default" whichISP="1" more +2 $ISPinfo | head -n $whichISP | tail -n 1 | awk {'print $1 "\t" $2'} else echo "You choose:" more +2 $ISPinfo | head -n $whichISP | tail -n 1 | awk {'print $1 "\t" $2'} fi else echo "You insert Incorrect value. Use default value" whichISP="1" more +2 $ISPinfo | head -n $whichISP | tail -n 1 | awk {'print $1 "\t" $2'} fi else echo "No input. Use default:" whichISP="1" more +2 $ISPinfo | head -n $whichISP | tail -n 1 | awk {'print $1 "\t" $2'} fi #_________________________________________________________________________ M_HOST=$(cat ISPinfo | grep "^$whichISP " | awk {'print $3'}) echo "ISP host is: $M_HOST" #_____ok____________________________________________________________________ echo "Checking which Ethernet Card is available..." ethNUM="0" GWnum=$(route | grep "UG " | grep eth | cat -n | tail -n 1 | awk {'print $1'}) #howmany gateways echo "find $GWnum gateways" if [ -z "$GWnum" ] then GWnum="0" echo "Gateway is missing" exit 1 #can add code to find gw fi echo "still $GWnum gateways" while [ "$GWnum" != "0" ] do M_GW=$(route | grep "UG " | grep eth | head -n $GWnum | tail -n 1 | awk {'print $2'}) echo "tested gateway ip is $M_GW" M_ETH=$(route | grep $M_GW | awk {'print $8'}) echo "on ethernet card: $M_ETH" sudo ifconfig $M_ETH down sudo ifconfig $M_ETH up sleep 20 echo "ex: route add -host $M_HOST gw $M_GW dev $M_ETH" echo sudo route add -host $M_HOST gw $M_GW dev $M_ETH route if [ "$?" == "0" ] then break elif [ "$GWnum" == "1" ] then echo "exiting no available gw" exit 1 else ((GWnum=$GWnum-1)) echo echo "gateway index is: $GWnum" fi done route | grep UGH | grep $M_ETH sleep 10 if [ -z $M_GW ] then echo "Can't find available gateway ip to connect the host" sleep 5 exit 1 fi #_____________________________________________________________________________________ sudo ifconfig M_ETH down sudo ifconfig M_ETH up #___________________________________________________________________ #PPTP installation echo "*******************************" echo " Checking if you have pptp " echo "*******************************" which pptp if [ "$?" != "0" ] then cd $installation_directory tar xvfz pptp-1.7.1.tar.gz cd pptp-1.7.1 make sudo make install # install pptp in /usr/sbin/pptp else echo "[OK] you already have an pptp progrem" fi #_______________________________________________________________ echo "*************************" echo " User name & Password" echo "*************************" theanswer="n" while [ "$theanswer" == "n" ] do echo "Type your username" read myUsername # username checking [ -z "$myUsername" ] && echo "Exit script due to empty username" && exit 1 echo "Type your password" read myPassword [ -z "$myPassword" ] && echo "Exit script due to empty password" && exit 1 echo echo " Connection details:" echo " ==========================" echo " * Username is: $myUsername" echo " * Password is: $myPassword" echo echo "Is it Correct? [y/n] yes by default" read theanswer checktheans=$(echo $theanswer | grep '[y,Y]\{1\}[e,E]\{0,1\}[s,S]\{0,1\}') if [ -z "$checktheans" ] then checktheans=$(echo $theanswer | grep '[N,n]\{1\}[o,O]\{0,1\}') if [ -z "$checktheans" ] then theanswer="y" else theanswer="n" fi else theanswer="y" fi done #___________________________________________________________________ sudo chmod 666 /etc/ppp/pap-secrets sudo chmod 666 /etc/ppp/chap-secrets echo "\"$myUsername\" * \"$myPassword\"" >> /etc/ppp/pap-secrets echo "\"$myUsername\" * \"$myPassword\"" >> /etc/ppp/chap-secrets sudo chmod 600 /etc/ppp/pap-secrets sudo chmod 600 /etc/ppp/pap-secrets #____________________________________________________________________ CFName="$installation_directory/ConnectMe.con" echo "M_USER=$myUsername" > $CFName echo "M_HOST=$M_HOST" >> $CFName echo "M_ETH=$M_ETH" >> $CFName cat $installation_directory/connect_me_part2 >> $CFName cp $installation_directory/Connect_the_Internet.desktop $HOME/Desktop/ sudo chmod 755 $HOME/Desktop/Connect_the_Internet.desktop sudo chmod 755 $CFName sudo cp $CFName /usr/sbin echo "you can run from teminal type $CFName" echo "and I also created link from desktop" |
קוד: |
[Desktop Entry] Version=1.0 Encoding=UTF-8 Name=Connect_the_Internet Type=Application Terminal=false Name[he_IL]=Connect_the_Internet Exec=gnome-terminal --sync --disable-crash-dialog -e ConnectMe.con Comment[he_IL]=Internet connection Comment=Internet connection Icon=/usr/share/pixmaps/gnome-talk.png GenericName[he_IL]= |
קוד: |
# 9/5/2007 sudo style PPPD_OPTIONS="mru 1500 mtu 1500 defaultroute usepeerdns" M_GW=$(route | grep eth0 | grep 'UG ' | awk {'print $2'} | head -n 1) if [ -z $M_GW ]; then echo "cant fing $M_ETH gateway"; exit 1; fi echo "my IFACE getway is: $M_GW" sudo route add -host $M_HOST gw $M_GW dev $M_ETH # if [ "$?" != "0" ]; then echo; echo "Check your Modem and Cables"; exit 1; fi M_HOST_IP=$(route | grep $M_ETH | grep UGH | awk {'print $1'} | head -n 1) echo "my host ip is: $M_HOST_IP" sudo pptp $M_HOST_IP user $M_USER --debug $PPPD_OPTIONS sleep 10 M_PPTP_HOST=$(ifconfig | grep P-t-P | head -n 1 | awk {'print $3'} | cut -d ":" -f 2) # if [ -z $M_PPTP_HOST ]; then echo "Check your username and password or check your account with your Internet service provider"; exit 1; fi echo "my ptp host ip is: $M_PPTP_HOST" sudo route add default gw $M_PPTP_HOST sudo route del default gw $M_GW route echo "WARN ATTENTION: DONT PRESS ENTER!!" echo "pressing enter will close this window and also the connection" echo "press only when you wanna disconnect" read somevar echo "disconnectig..." sudo ifconfig $M_ETH down sudo ifconfig $M_ETH up sleep 5 |
leo212 : |
צר לי לאכזב אתכם, אבל ניתן להתחבר באובונטו לכבלים בצורה הרבה יותר "טבעית".
1. הורדה והתקנת החבילות הבאות: (ניתן להוריד במחשב אחר שמחובר לאינטרנט ולהתקין באובונטו ללא חיבור לאינטרנט) pptp-linux network-manager-pptp כתובות להורדה של הגרסאות העדכניות נכון להיום:http://launchpadlibrarian.net/6716221/pptp-linux_1.7.0-2ubuntu2_i386.deb http://launchpadlibrarian.net/6718639/pptp-linux_1.7.0-2ubuntu2_ia64.deb http://launchpadlibrarian.net/4629745/network-manager-pptp_0.6.3%2Bcvs20060819-0ubuntu2_i386.deb http://launchpadlibrarian.net/4631331/network-manager-pptp_0.6.3%2Bcvs20060819-0ubuntu2_ia64.deb הגרסה העדכנית ביותר נמצאת ב: https://launchpad.net/ubuntu/feisty 2. לחיצה עם מקש עכבר שמאלי על הIcon של הConnection (שתי מחשבים) ובחירת VPN Connection -> Configure VPN. 3. לחיצה על Add. 4. לחיצה על Forward, בחירת "PPTP Tunnel" מהרשימה ולחיצה שוב על Forward. 5. בשדה Connection Name יש לכתוב שם ידידותי לחיבור האינטרנט (למשל 012) 6. בשדה Gateway יש לרשום את כתובת הספק - במקרה שלי cablepns.012.net.il. 7. לעבור לטאב "Compression and Encryption" ולנקות את כל תיבות הסימון. 8. לעבור לטאב "PPP Options" ולסמן את Use Peer DNS. 9. להזין MTU 1416 ו-MRU 1460. 10. להזין lcp-echo-failure 3 ו- lcp-echo-interval 20. זהו, פחות או יותר. ללחוץ על Forward ואז Apply. והvpn יופיע לכם ברשימה. כדי להתחבר לVPN צריך ללחוץ על הIcon של הConnection ולבחור VPN Connection, יופיע השם של הVPN שיצרתם - אם תלחצו עליו זה יתחיל להתחבר. (לאחר הזנת שם משתמש וסיסמא כמובן) בהצלחה! |
כרמית לוי : | ||
אני אגיד לך למה א. החיבור שאני כתבתי הרבה יותר פשות ב. מה שכתבתי לוקח פחות זמן ג. הגירסה של ה pptp-linux היא 1.7.0 בהצעה שלך ולא 1.7.1 כמו בהצעה שלי שמכיל תיקוני באגים מהגירסה הקודמת ועוד אפשרויות שכדאי שיהיו ד. משתמשים מתחילים עדיין לא מכירים את מנהל החבילות של אבונטו וזה לדעתי לדרוש מהם יותר מידי... ולך עכשיו תסביר למשתמש מתחיל מה זה VPN כולה רצה להתחבר לאינטרנט ה. למה הערכים של mru ו mtu צריכים להיות 1460 כמו אלה שבבזק? בכבלים עדיף 1500. ו. בסקריפט שלי אתה לא צריך לכתוב כל הזמן שם משתמש וסיסמא של האינטרנט ולזכור כל מה שצריך זה לכתוב את זה פעם אחת ומכאן והלאה הסקריפט יחבר אותך והסיסמא היחידה שאתה כותב זה הסיסמא של הסודו משתמש לינוקס שלך... אז למרות שאולי זה "לא טבעי" תגיד חוץ מזה מה היתרון בהצעה שלך על פני ההצעה שלי? |
כרמית לוי : | ||
אני אגיד לך למה א. החיבור שאני כתבתי הרבה יותר פשות ב. מה שכתבתי לוקח פחות זמן ג. הגירסה של ה pptp-linux היא 1.7.0 בהצעה שלך ולא 1.7.1 כמו בהצעה שלי שמכיל תיקוני באגים מהגירסה הקודמת ועוד אפשרויות שכדאי שיהיו ד. משתמשים מתחילים עדיין לא מכירים את מנהל החבילות של אבונטו וזה לדעתי לדרוש מהם יותר מידי... ולך עכשיו תסביר למשתמש מתחיל מה זה VPN כולה רצה להתחבר לאינטרנט ה. למה הערכים של mru ו mtu צריכים להיות 1460 כמו אלה שבבזק? בכבלים עדיף 1500. ו. בסקריפט שלי אתה לא צריך לכתוב כל הזמן שם משתמש וסיסמא של האינטרנט ולזכור כל מה שצריך זה לכתוב את זה פעם אחת ומכאן והלאה הסקריפט יחבר אותך והסיסמא היחידה שאתה כותב זה הסיסמא של הסודו משתמש לינוקס שלך... אז למרות שאולי זה "לא טבעי" תגיד חוץ מזה מה היתרון בהצעה שלך על פני ההצעה שלי? |
leo212 : |
צר לי לאכזב אתכם, אבל ניתן להתחבר באובונטו לכבלים בצורה הרבה יותר "טבעית".
1. הורדה והתקנת החבילות הבאות: (ניתן להוריד במחשב אחר שמחובר לאינטרנט ולהתקין באובונטו ללא חיבור לאינטרנט) pptp-linux network-manager-pptp כתובות להורדה של הגרסאות העדכניות נכון להיום:http://launchpadlibrarian.net/6716221/pptp-linux_1.7.0-2ubuntu2_i386.deb http://launchpadlibrarian.net/6718639/pptp-linux_1.7.0-2ubuntu2_ia64.deb http://launchpadlibrarian.net/4629745/network-manager-pptp_0.6.3%2Bcvs20060819-0ubuntu2_i386.deb http://launchpadlibrarian.net/4631331/network-manager-pptp_0.6.3%2Bcvs20060819-0ubuntu2_ia64.deb הגרסה העדכנית ביותר נמצאת ב: https://launchpad.net/ubuntu/feisty 2. לחיצה עם מקש עכבר שמאלי על הIcon של הConnection (שתי מחשבים) ובחירת VPN Connection -> Configure VPN. 3. לחיצה על Add. 4. לחיצה על Forward, בחירת "PPTP Tunnel" מהרשימה ולחיצה שוב על Forward. 5. בשדה Connection Name יש לכתוב שם ידידותי לחיבור האינטרנט (למשל 012) 6. בשדה Gateway יש לרשום את כתובת הספק - במקרה שלי cablepns.012.net.il. 7. לעבור לטאב "Compression and Encryption" ולנקות את כל תיבות הסימון. 8. לעבור לטאב "PPP Options" ולסמן את Use Peer DNS. 9. להזין MTU 1416 ו-MRU 1460. 10. להזין lcp-echo-failure 3 ו- lcp-echo-interval 20. זהו, פחות או יותר. ללחוץ על Forward ואז Apply. והvpn יופיע לכם ברשימה. כדי להתחבר לVPN צריך ללחוץ על הIcon של הConnection ולבחור VPN Connection, יופיע השם של הVPN שיצרתם - אם תלחצו עליו זה יתחיל להתחבר. (לאחר הזנת שם משתמש וסיסמא כמובן) בהצלחה! |
Anonymous : |
מה שצריך זה ממשק גרפי קל ופשוט להתחברות לאינטרנט. כל עוד ההתחברות לאינטרנט בלינוקס תהיה כרוכה בהקשת מיליון פקודות שונות ומשונות כל עוד זה יהיה קריעת ים סוף כל עוד זה יהיה כל כך מייגע, מסובך ומפרך אנשים יישארו בוינדוס. רוצים שאנשים יעברו ללינוקס? תנו להם התחברות קלילה ופשוטה ללא סיבוכים בלי להוציא להם את הנשמה. |
Anonymous : |
אפשרות נוספת היא לכתוב סקריפט ש:
1. מתקין את pptp וnetwork-manager-pptp. 2. יוצר vpn עם ההגדרות שרשמתי. 3. מתחבר באמצעות הvpn. כך נוכל להנות גם מהתקנה אוטומטית לחלוטין, וגם מהיתרונות שכתבתי קודם. |
ציטוט: |
כמה נקודות
לגבי קוד האשף: הוא אמור לכלול גם את ADSL לצורך כך צריך את pppoeconf לחיבור מודם דרך כרטיס רשת |
ציטוט: |
. משתמשים מתחילים גם לא יודעים מה זה terminal, איך פותחים tar.gz. עדיף כבר להרגיל אותם לpackage manager, למרות שבמקרה זה לא צריך package manager כי אפשר פשוט ללחוץ על קבצי הdeb ואז הubuntu מתקין אותם. שנה אינדיקציה בפינה של המסך שהconnection מחובר. (יש סמל של מנעול ליד הסמל של המחשבים וזה מציין שהvpn מחובר) |
ציטוט: |
כמובן שצריך להתחיל לטפל באירועים עצמם, אבל בשביל זה אני צריכה לשאול אותך כמה שאלות יותר מעמיקות. יש לך מסנג'ר/ג'יטוק/אייסיקיו/אימייל שאפשר ליצור איתך קשר שם? |
Anonymous : |
אפשרות נוספת היא לכתוב סקריפט ש:
1. מתקין את pptp וnetwork-manager-pptp. 2. יוצר vpn עם ההגדרות שרשמתי. 3. מתחבר באמצעות הvpn. כך נוכל להנות גם מהתקנה אוטומטית לחלוטין, וגם מהיתרונות שכתבתי קודם. |
ציטוט: |
כמה נקודות
לגבי קוד האשף: הוא אמור לכלול גם את ADSL לצורך כך צריך את pppoeconf לחיבור מודם דרך כרטיס רשת |
ציטוט: |
. משתמשים מתחילים גם לא יודעים מה זה terminal, איך פותחים tar.gz. עדיף כבר להרגיל אותם לpackage manager, למרות שבמקרה זה לא צריך package manager כי אפשר פשוט ללחוץ על קבצי הdeb ואז הubuntu מתקין אותם. שנה אינדיקציה בפינה של המסך שהconnection מחובר. (יש סמל של מנעול ליד הסמל של המחשבים וזה מציין שהvpn מחובר) |
ציטוט: |
כמובן שצריך להתחיל לטפל באירועים עצמם, אבל בשביל זה אני צריכה לשאול אותך כמה שאלות יותר מעמיקות. יש לך מסנג'ר/ג'יטוק/אייסיקיו/אימייל שאפשר ליצור איתך קשר שם? |
משתמש : |
כל כך הרבה אנשים כותבים שחסר להם חייגן. באה כרמית, התקינה לה אובנטו, טרחה, כתבה, בדקה וביקשה קצת עזרה.
ישר קופצים עליה, יש משהו טוב יותר. אם זה כזה טוב, למה לא כתבתם בעצמכם סקריפט? למה אתם יושבים בחושך ומחכים שמישהו יעשה משהו ואז קופצים עליו ועושים "בהההההההההההֱ!!!". כרמית נימקה מדוע הסקריפט שלה טוב. קובץ קטון, עצמאי, שאפשר להפיץ בקלות לכל מי שרוצה. שאולי גם יהיה, יום אחד, אי"ה חלק מההפצה. לקחה יוזמה, עשתה, טרחה, והביאה לקהילה, וישר צריכה להיכנס לעמדת התגוננות. במקום לדון על הממשק, צריכה להתגונן על העבודה שלה. ומול מי? מול מישהו שלא עשה דבר. דיבורים לא חסר, מעשים צריך. |
Anonymous : | ||
ממש לא קופצים עליה - להיפך - העבודה שלה מבורכת. אבל פשוט כדאי להיצמד לסביבה הטבעית של Ubuntu ולעבוד עם הכלים שהוא מספק כדי שזה יראה ויתנהג בצורה הטובה ביותר. למשל הGUI - צריך להיות כתוב בGTK2 אם רוצים שזה ירוץ בסביבת GNOME בצורה טבעית ובQT אם רוצים שזה ירוץ תחת KDE. אני לא הייתי רוצה לראות חייגן ורוד אצלי במחשב, הייתי רוצה לראות אותו עם העיצוב והכפתורים של הTheme שלי. בייחוד אם רוצים שזה יהיה חלק מההפצה באחד הימים... דבר נוסף - חשוב מאוד שתהיה אפשרות בGUI לבצע Disconnect וConnect כי לפעמים האינטרנט מפסיק להגיב מבלי שהConnection מתנתק ואז צריך לבצע Disconnect & Connect כדי להתחבר שוב. לא הייתי רוצה לפתוח terminal בשביל זה. |
Anonymous : |
ממש לא קופצים עליה - להיפך - העבודה שלה מבורכת. אבל פשוט כדאי להיצמד לסביבה הטבעית של Ubuntu ולעבוד עם הכלים שהוא מספק כדי שזה יראה ויתנהג בצורה הטובה ביותר. למשל הGUI - צריך להיות כתוב בGTK2 אם רוצים שזה ירוץ בסביבת GNOME בצורה טבעית ובQT אם רוצים שזה ירוץ תחת KDE. אני לא הייתי רוצה לראות חייגן ורוד אצלי במחשב, הייתי רוצה לראות אותו עם העיצוב והכפתורים של הTheme שלי. בייחוד אם רוצים שזה יהיה חלק מההפצה באחד הימים... |
ציטוט: |
והאגו שלי הוא נשי ולא גברי כי ברגע שאני אספיק ללמוד לפתח ממשק גראפי בפייתון (כי זו אולי הכוונה ואולי בגלל זה זה מומר לפייתון מבש) לפניכם הגברים תהיו בטוחים בזה
שאני אוסיף תמונה של פרפרים ופרחים ואולי גם ברבי ופינגיינית במקום פיגוין זכר אז כדאי לכם מאוד להשיג אותי לפני שאני אספיק ללמוד את זה וכמובן גם ליישם. |
קוד: |
# 28/6/2007 sudo style PPPD_OPTIONS="mru 1500 mtu 1500 defaultroute replacedefaultroute usepeerdns" M_GW=$(netstat -nr | grep eth0 | grep 'UG ' | awk {'print $2'} | head -n 1) if [ -z $M_GW ]; then echo "cant fing $M_ETH gateway"; read somevar; exit 1; fi echo "my IFACE getway is: $M_GW" sudo route add -host $M_HOST gw $M_GW dev $M_ETH sudo pptp $M_HOST_IP user $M_USER --debug $PPPD_OPTIONS sleep 7 M_PPTP_HOST=$(netstat -nr | grep ppp | grep UH | awk {'print $1'}) echo "my ptp host ip is: $M_PPTP_HOST" route #NONBOOT echo "WARN ATTENTION: DONT CLOSE THE TERMINAL UNLESS U WANNA DISCONNECT!!" sleep 3 |
קוד: |
import os
os.system("ls -l") |
כרמית לוי : |
תודה אני אשנה קצת את הממשק באמת שיציג את הכתובת IP זה רעיון טוב
טוב הנה הפינגוינית תוצרת ישראל אני ציירתי כי הפינגוינים שמקושרים בלי רשיון חופשי לשימוש אז אני לא רוצה להסתבך עם שטויות אז עשיתי משהו תוצרת בית מקוה שתאהבו מי שמעניין אותו איך עשיתי אז ציירתי על נייר סרקתי וצבעתי בגימפ אני לא גראפיקאית או משהו כזה... מקוה שתאהבו [ |
yaniv : |
למה צריך "שם התחברות" ?
כדי להפוך את זה למשהו פשוט ככול האפשר כדי להוריד את האפשרות להגדיר מספר חיבורים (שם התחבורות) כך שיהיה ניתן להגדיר רק חיבור אחד כמו כן כדי להוריד את פרוטוקול התחברות, זה נתון טכני שהחייגן אמור להתמודד ולא המשתמש הפשוט ip=כתובת Ip מה לגבי זכור סיסמה ? |
Anonymous : |
היי כרמית,
האמת שהתחלתי כבר לפני שנה פרוייקט של חייגן לכל הפצות הלינוקס עם ממשק GUI (העיצוב הראשוני היה שלי אבל הוא היה צריך להראות טוב יותר במוצר הסופי). הבעיה שנתקעתי עם החייגן היא חוסר רצון של ספקיות האינטרנט השונות לשתף פעולה עם הנושא (יוזרים וסיסמאות, להושיב מולי מישהו שיבדוק מה קורה בצד השרת במקרה כשל בהתחברות, וכדומה), אז לצערי נשבר לי מזה - כי מוצר פחות ממושלם (יתכן עם באגים אבל מושלם מבחינת זה שנבדק ונמצא שמיש לכל אחד) לא רציתי לשחרר.... http://linux-israel.net/wiz האשף היה אמור לזהות בעצמו אם קיימת תקשורת, לזהות את ההתקן USB/ETH וליצור חייגן שכמו בווינדוס בעת חיבור יופיע ב Information Area על מנת שיהיה אפשר בלחיצת כפתור גם להתנתק.... אם את רוצה אני יכול לשלוח לך את הקוד בפייטון בו נכתב החייגן הלא מושלם הזה ותראי מה את יכולה לעשות עם זה... לילה טוב, מיקי ברזילי לינוקס ישראל נט http://linux-israel.net |
yp : |
קודם כל הכבוד
אני דוקא בעד שם התחברות ובבקשה לאפשר כתיבה של ספק האינטרנט או ה IP שלו כי לפחות בסקריפט לעיל ,הספק שלי לא מוזכר ורק זה חסר למשתמש מתחיל לחפש איזה כרמית ודרך אגב הציור מדליק! אולי כדאי לחשוב בעתיד לא להשתמש בדגל המדינה ולהסיף תמיכה בשפות מתוך כבוד למדינות הסמוכות שיש בינהם שימוש ב PPTP תארי לך בחור בסוריה אמא שלו תופסת את הדגל במחשב תוך 3 דקות עושים ממנו קציצה |
קוד: |
pptp barka_ip user my_user_name --debug password my_password |
קוד: |
(none of the availible password would let it use an IP address) |
קוד: |
lock noauth nobsdcomp nodeflate debug require-mppe-128 lcp-echo-failure 30 lcp-echo-interval 20 refuse-pap refuse-eap refuse-chap +mppe-128 nomppe-stateful |
קוד: |
Dec 17 16:53:58 peace pptp[7672]: anon log[main:pptp.c:267]: The synchronous pptp option is NOT activated Dec 17 16:53:58 peace pptp[7675]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 1 'Start-Control-Connection-Request' Dec 17 16:53:58 peace pptp[7675]: anon log[ctrlp_disp:pptp_ctrl.c:738]: Received Start Control Connection Reply Dec 17 16:53:58 peace pptp[7675]: anon log[ctrlp_disp:pptp_ctrl.c:772]: Client connection established. Dec 17 16:53:59 peace pptp[7675]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 'Outgoing-Call-Request' Dec 17 16:53:59 peace pptp[7675]: anon log[ctrlp_disp:pptp_ctrl.c:857]: Received Outgoing Call Reply. Dec 17 16:53:59 peace pptp[7675]: anon log[ctrlp_disp:pptp_ctrl.c:896]: Outgoing call established (call ID 0, peer's call ID 6003). Dec 17 16:53:59 peace pppd[7676]: pppd 2.4.4 started by root, uid 0 Dec 17 16:53:59 peace pppd[7676]: using channel 7 Dec 17 16:53:59 peace pppd[7676]: Using interface ppp0 Dec 17 16:53:59 peace pppd[7676]: Connect: ppp0 <--> /dev/pts/3 Dec 17 16:53:59 peace pppd[7676]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x54d105e1> <pcomp> <accomp>] Dec 17 16:54:01 peace pppd[7676]: rcvd [LCP ConfReq id=0x1 <auth pap> <magic 0xdbf9e58a>] Dec 17 16:54:01 peace pppd[7676]: sent [LCP ConfNak id=0x1 <auth chap MS-v2>] Dec 17 16:54:01 peace pppd[7676]: rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x54d105e1> <pcomp> <accomp>] Dec 17 16:54:01 peace pppd[7676]: rcvd [LCP ConfReq id=0x2 <auth chap MD5> <magic 0xdbf9e58a>] Dec 17 16:54:01 peace pppd[7676]: sent [LCP ConfNak id=0x2 <auth chap MS-v2>] Dec 17 16:54:01 peace pppd[7676]: rcvd [LCP ConfReq id=0x3 <auth pap> <magic 0xdbf9e58a>] Dec 17 16:54:01 peace pppd[7676]: sent [LCP ConfNak id=0x3 <auth chap MS-v2>] Dec 17 16:54:01 peace pppd[7676]: rcvd [LCP ConfReq id=0x4 <auth chap MD5> <magic 0xdbf9e58a>] Dec 17 16:54:01 peace pppd[7676]: sent [LCP ConfNak id=0x4 <auth chap MS-v2>] Dec 17 16:54:01 peace pppd[7676]: rcvd [LCP ConfReq id=0x5 <auth pap> <magic 0xdbf9e58a>] Dec 17 16:54:01 peace pppd[7676]: sent [LCP ConfNak id=0x5 <auth chap MS-v2>] Dec 17 16:54:01 peace pppd[7676]: rcvd [LCP ConfReq id=0x6 <auth chap MD5> <magic 0xdbf9e58a>] Dec 17 16:54:01 peace pppd[7676]: sent [LCP ConfRej id=0x6 <auth chap MD5>] Dec 17 16:54:01 peace pppd[7676]: rcvd [LCP ConfReq id=0x7 <auth pap> <magic 0xdbf9e58a>] Dec 17 16:54:01 peace pppd[7676]: sent [LCP ConfRej id=0x7 <auth pap>] Dec 17 16:54:01 peace pppd[7676]: rcvd [LCP ConfReq id=0x8 <auth chap MD5> <magic 0xdbf9e58a>] Dec 17 16:54:01 peace pppd[7676]: sent [LCP ConfRej id=0x8 <auth chap MD5>] Dec 17 16:54:01 peace pppd[7676]: rcvd [LCP ConfReq id=0x9 <auth pap> <magic 0xdbf9e58a>] Dec 17 16:54:01 peace pppd[7676]: sent [LCP ConfRej id=0x9 <auth pap>] Dec 17 16:54:01 peace pppd[7676]: rcvd [LCP ConfReq id=0xa <auth chap MD5> <magic 0xdbf9e58a>] Dec 17 16:54:01 peace pppd[7676]: sent [LCP ConfRej id=0xa <auth chap MD5>] Dec 17 16:54:01 peace pppd[7676]: rcvd [LCP ConfReq id=0xb <auth pap> <magic 0xdbf9e58a>] Dec 17 16:54:01 peace pppd[7676]: sent [LCP ConfRej id=0xb <auth pap>] Dec 17 16:54:01 peace pppd[7676]: rcvd [LCP ConfReq id=0xc <auth chap MD5> <magic 0xdbf9e58a>] Dec 17 16:54:01 peace pppd[7676]: sent [LCP ConfRej id=0xc <auth chap MD5>] Dec 17 16:54:01 peace pppd[7676]: rcvd [LCP ConfReq id=0xd <auth pap> <magic 0xdbf9e58a>] Dec 17 16:54:01 peace pppd[7676]: sent [LCP ConfRej id=0xd <auth pap>] Dec 17 16:54:01 peace pppd[7676]: rcvd [LCP ConfReq id=0xe <auth chap MD5> <magic 0xdbf9e58a>] Dec 17 16:54:01 peace pppd[7676]: sent [LCP ConfRej id=0xe <auth chap MD5>] Dec 17 16:54:01 peace pppd[7676]: rcvd [LCP ConfReq id=0xf <auth pap> <magic 0xdbf9e58a>] Dec 17 16:54:01 peace pppd[7676]: sent [LCP ConfRej id=0xf <auth pap>] Dec 17 16:54:01 peace pppd[7676]: rcvd [LCP TermReq id=0x10] Dec 17 16:54:01 peace pppd[7676]: sent [LCP TermAck id=0x10] Dec 17 16:54:01 peace pptp[7675]: anon log[ctrlp_disp:pptp_ctrl.c:928]: Call disconnect notification received (call id 6003) Dec 17 16:54:01 peace pptp[7675]: anon log[ctrlp_disp:pptp_ctrl.c:787]: Received Stop Control Connection Request. Dec 17 16:54:01 peace pptp[7675]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 4 'Stop-Control-Connection-Reply' Dec 17 16:54:01 peace pptp[7675]: anon log[callmgr_main:pptp_callmgr.c:255]: Closing connection (shutdown) Dec 17 16:54:01 peace pptp[7675]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 12 'Call-Clear-Request' Dec 17 16:54:01 peace pppd[7676]: Hangup (SIGHUP) Dec 17 16:54:01 peace pppd[7676]: Modem hangup Dec 17 16:54:01 peace pppd[7676]: Connection terminated. Dec 17 16:54:01 peace pptp[7675]: anon log[call_callback:pptp_callmgr.c:78]: Closing connection (call state) Dec 17 16:54:02 peace pppd[7676]: Exit. |
קוד: |
lock noauth nobsdcomp nodeflate debug lcp-echo-failure 30 lcp-echo-interval 20 refuse-eap refuse-chap |
קוד: |
nameserver 212.150.49.10 nameserver 206.49.94.234 |
קוד: |
domain localhost |
קוד: |
PPPD_OPTIONS="mru 1500 mtu 1500 defaultroute usepeerdns lock noauth refuse-eap refuse-chap nobsdcomp nodeflate lcp-echo-failure 30 lcp-echo-interval 20 debug nomppe-stateful" |
קוד: |
/etc/init.d/networking restart /etc/init.d/icables start |
קוד: |
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> <!--*- mode: xml -*--> <glade-interface> <widget class="GtkWindow" id="window_pptp_dialer"> <property name="visible">True</property> <property name="border_width">1</property> <property name="title" translatable="yes">window1</property> <property name="resizable">False</property> <property name="window_position">GTK_WIN_POS_CENTER</property> <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> <signal name="destroy" handler="on_window_pptp_dialer_destroy"/> <child> <widget class="GtkVBox" id="vbox1"> <property name="visible">True</property> <child> <widget class="GtkLabel" id="label1"> <property name="visible">True</property> <property name="label" translatable="yes"><b>PPTP dailer installation Script</b> <u>carmit3levi@gmail.com</u></property> <property name="use_markup">True</property> <property name="justify">GTK_JUSTIFY_CENTER</property> <property name="ellipsize">PANGO_ELLIPSIZE_MIDDLE</property> <property name="width_chars">0</property> </widget> <packing> <property name="padding">10</property> </packing> </child> <child> <widget class="GtkImage" id="image1"> <property name="visible">True</property> <property name="pixbuf">projects_internetpptpisrael.png</property> </widget> <packing> <property name="position">1</property> </packing> </child> <child> <widget class="GtkTable" id="table1"> <property name="visible">True</property> <property name="n_rows">2</property> <property name="n_columns">3</property> <child> <widget class="GtkLabel" id="label_enterusername"> <property name="visible">True</property> <property name="xalign">0</property> <property name="label" translatable="yes">Username here</property> </widget> <packing> <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> </child> <child> <widget class="GtkLabel" id="label_enterpassword"> <property name="visible">True</property> <property name="xalign">0</property> <property name="label" translatable="yes">Password here</property> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> </child> <child> <widget class="GtkLabel" id="label_enterISP"> <property name="visible">True</property> <property name="xalign">0</property> <property name="label" translatable="yes">Choose your ISP </property> <property name="use_underline">True</property> <property name="justify">GTK_JUSTIFY_CENTER</property> </widget> <packing> <property name="left_attach">2</property> <property name="right_attach">3</property> <property name="x_options">GTK_FILL</property> <property name="y_options"></property> </packing> </child> <child> <widget class="GtkComboBoxEntry" id="comboboxentry_ISP"> <property name="visible">True</property> <property name="items" translatable="yes">Netvision Actcom</property> <signal name="changed" handler="on_comboboxentry_ISP_changed"/> <child internal-child="entry"> <widget class="GtkEntry" id="comboboxentry_ISP"> <property name="editable">False</property> </widget> </child> </widget> <packing> <property name="left_attach">2</property> <property name="right_attach">3</property> <property name="top_attach">1</property> <property name="bottom_attach">2</property> <property name="x_options">GTK_FILL</property> </packing> </child> <child> <widget class="GtkEntry" id="entry_Password"> <property name="visible">True</property> <property name="can_focus">True</property> <signal name="activate" handler="on_entry_Password_activate"/> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> <property name="top_attach">1</property> <property name="bottom_attach">2</property> <property name="y_options"></property> </packing> </child> <child> <widget class="GtkEntry" id="entry_Username"> <property name="visible">True</property> <property name="can_focus">True</property> <signal name="activate" handler="on_entry_Username_activate"/> </widget> <packing> <property name="top_attach">1</property> <property name="bottom_attach">2</property> <property name="y_options"></property> </packing> </child> </widget> <packing> <property name="position">2</property> </packing> </child> <child> <widget class="GtkButton" id="button1"> <property name="visible">True</property> <property name="can_focus">True</property> <signal name="clicked" handler="on_button1_clicked"/> <child> <widget class="GtkAlignment" id="alignment1"> <property name="visible">True</property> <property name="xscale">0</property> <property name="yscale">0</property> <signal name="key_press_event" handler="on_alignment1_key_press_event"/> <child> <widget class="GtkHBox" id="hbox1"> <property name="visible">True</property> <property name="spacing">2</property> <child> <widget class="GtkImage" id="image2"> <property name="visible">True</property> <property name="stock">gtk-ok</property> </widget> <packing> <property name="expand">False</property> <property name="fill">False</property> </packing> </child> <child> <widget class="GtkLabel" id="label2"> <property name="visible">True</property> <property name="label" translatable="yes">*** Start Installation ***</property> <property name="use_underline">True</property> </widget> <packing> <property name="expand">False</property> <property name="fill">False</property> <property name="position">1</property> </packing> </child> </widget> </child> </widget> </child> </widget> <packing> <property name="expand">False</property> <property name="fill">False</property> <property name="position">3</property> </packing> </child> </widget> </child> </widget> </glade-interface> |
קוד: |
#!/usr/bin/env python # -*- coding: utf-8 -*- # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Generated with glade2py script # glade2py script can be found at hocr web site http://hocr.berlios.de import pygtk; pygtk.require('2.0') import gtk; import gtk.glade; import re; import os; import sys; class MainWindow: def __init__(self): # create widget tree ... xml = gtk.glade.XML('project2.glade') # connect handlers xml.signal_autoconnect(self) # widgets self.window_pptp_dialer = xml.get_widget('window_pptp_dialer') self.vbox1 = xml.get_widget('vbox1') self.label1 = xml.get_widget('label1') self.image1 = xml.get_widget('image1') self.table1 = xml.get_widget('table1') self.label_enterusername = xml.get_widget('label_enterusername') self.label_enterpassword = xml.get_widget('label_enterpassword') self.label_enterISP = xml.get_widget('label_enterISP') self.comboboxentry_ISP = xml.get_widget('comboboxentry_ISP') self.comboboxentry_ISP = xml.get_widget('comboboxentry_ISP') self.entry_Password = xml.get_widget('entry_Password') self.entry_Username = xml.get_widget('entry_Username') self.button1 = xml.get_widget('button1') self.alignment1 = xml.get_widget('alignment1') self.hbox1 = xml.get_widget('hbox1') self.image2 = xml.get_widget('image2') self.label2 = xml.get_widget('label2') # signal handlers def on_window_pptp_dialer_destroy(self, obj, event = None): "on_window_pptp_dialer_destroy activated" print 'on_window_pptp_dialer_destroy activated' gtk.main_quit() def on_comboboxentry_ISP_changed(self, obj, event = None): "on_comboboxentry_ISP_changed activated" print 'on_comboboxentry_ISP_changed activated' def on_entry_Password_activate(self, obj, event = None): "on_entry_Password_activate activated" print 'on_entry_Password_activate activated' def on_entry_Username_activate(self, obj, event = None): "on_entry_Username_activate activated" print 'on_entry_Username_activate activated' def on_button1_clicked(self, obj, event = None): "on_button1_clicked activated" print 'on_button1_clicked activated' print 'username: '+self.entry_Username.get_text() print 'password: '+self.entry_Password.get_text() print 'isp: '+self.comboboxentry_ISP.get_text() #here i need function to check if legal username and password and then continue but i am too lazy now so... sorry #self.writeSecrets() os.system('sh ppptp_dialer_installation.sh') def writeSecrets(self): papSecretsFile = open('/etc/ppp/pap-secrets','w'); papSecretsFile.write('"' + self.entry_Username.get_text() + '" * "'+self.entry_Password.get_text() + '"\n'); papSecretsFile.close(); chapSecretsFile = open('/etc/ppp/chap-secrets','w'); chapSecretsFile.write('"' + self.entry_Username.get_text() + '" * "'+self.entry_Password.get_text() + '"\n'); chapSecretsFile.close(); # run main loop def main(): main_window = MainWindow() main_window.window_pptp_dialer.show() gtk.main() if __name__ == "__main__": main() |
קוד: |
# Made in Israel GPL stuff ++ and part of pptp dialerscript # I am the author my name is: Carmit Levi ISPinfoFile="$HOME/Desktop/scriptfolder/ISPinfo" #this file supposed to have only one selected pptp server from python GUI and username=user myoutputFile="$HOME/connectpptp.me" myiconFile="$HOME/Desktop/PPTP_DIALER.desktop" mycounter="0" while [ true ] do echo echo "TRYING TO GET INFO" echo "FOR ETH$mycounter:" echo "*******************" gksudo dhclient eth$mycounter if [ "0" != "$?" ] then echo "THE SCRIPT COULDN'T GET ETHERNET to comunicate the INTERNET... checked until eth$mycounter" exit 1; fi echo "FOUND ETH$mycounter" echo "CHECKING IF THIS IS THE ETH FOR CABLE INTERNET CONNECTION" GW=$(netstat -nr | grep eth$counter | grep UG | awk {'print $2'}) if [ -n "$GW" ] then echo "THE GATEWAY: $GW" if [ "$GW" == "10.0.0.138" ] then echo "FOUND: BEZEQ style eth$mycounter" echo "this script is pptp dialer for non adsl infrastructure" exit 0 fi echo "Get ISP info..." myISPpptpServer=$(cat $ISPinfoFile | grep pptpserver | cut -d "=" -f2) theusername=$(cat $ISPinfoFile | grep username | cut -d "=" -f2) sudo route add -host $myISPpptpServer gw $GW if [ "0" == "$?" ] then echo "FOUND: eth$mycounter" echo "myETH=eth$mycounter" > $myouputFile echo "myHOST=$myISPpptpServer" >> $myoutputFile echo "myUSER=$theusername" >> $myoutputFile echo 'gksudo dhclient $myETH' >> $myoutputFile echo 'myGW=$(route -n | grep $myETH | grep UG | awk {'print $2'})' >> $myoutputFile echo 'sudo route add -host $myHOST gw $myGW' >> $myoutputFile myPPTPserverIP=$(route -n | grep eth$mycounter | grep UGH | awk {'print $1'}) echo 'myPPTPsvrIP=$(route -n | grep $myETH | grep UGH | awk {'print $1'})' >> $myoutputFile echo 'pptp $myPPTPsvrIP --debug user $myUSER mru 1500 mtu 1500 defaultroute usepeerdns replacedefaultroute' >> $myoutputFile echo 'route' >> $myoutputFile pptp $myPPTPserverIP --debug user $theusername mru 1500 mtu 1500 defaultroute usepeerdns replacedefaultroute sleep 3 ping -c2 www.google.com if [ "$?" != "0" ] then echo "check your username and password in /etc/ppp/chap-secrets" echo " and /etc/ppp/pap-secrets" fi # PPTP_DIALER.desktop icon echo '[Desktop Entry]' > $myiconFile echo 'Version=1.0' >> $myiconFile echo 'Encoding=UTF-8' >> $myiconFile echo 'Name=PPTP_DIALER' >> $myiconFile echo 'Type=Application' >> $myiconFile echo 'Terminal=false' >> $myiconFile echo "Exec=$myoutputFile" >> $myiconFile echo 'Name[he_IL]=PPTP_DIALER' >> $myiconFile echo 'GenericName[he_IL]=' >> $myiconFile echo 'Icon=/usr/share/icons/gnome/48x48/apps/gnome-favorites.png' >> $myiconFile echo "********** THE END *************" exit 0 else echo "FOUND: eth$mycounter" echo "There is problem with this ethernet: can't get host from HOT" echo "continue searching other device..." fi else echo "THERE IS NO GATEWAY FOR THIS CARD" echo "ETH$mycounter is not the one with comunication to the internet" echo " continue checking..." fi mycounter=$(($mycounter+1)) done |
קוד: |
myiconFile="$HOME/Desktop/PPTP_DIALER.desktop" mycounter="0" myoutputFile="$HOME/connectpptp.me" errNoGwMsg() { echo "THERE IS NO GATEWAY FOR THIS CARD" echo "ETH$mycounter is not the one with comunication to the internet" echo " continue checking..." } errHostMsg() { echo "FOUND: eth$mycounter" echo "There is problem with this ethernet: can't get host from HOT" echo "continue searching other device..." } CreateThePptpScript() { sudo echo "\"$1\" * \"$2\"" >> /etc/ppp/pap-secrets sudo echo "\"$1\" * \"$2\"" >> /etc/ppp/chap-secrets echo "FOUND: eth$mycounter"; echo "myETH=eth$mycounter" > $myoutputFile echo "myHOST=$3" >> $myoutputFile echo "myUSER=$1" >> $myoutputFile echo 'gksudo --user root dhclient $myETH' >> $myoutputFile echo "myGW=\$(route -n | grep \$myETH | grep UG | awk {'print \$2'})" >> $myoutputFile echo 'sudo route add -host $myHOST gw $myGW' >> $myoutputFile myPPTPserverIP=$(route -n | grep eth$mycounter | grep UGH | awk {'print $1'}) echo "myPPTPsvrIP=\$(route -n | grep \$myETH | grep UGH | awk {'print \$1'})" >> $myoutputFile echo 'sudo pptp $myPPTPsvrIP --debug user $myUSER mru 1500 mtu 1500 defaultroute usepeerdns replacedefaultroute' >> $myoutputFile echo 'route' >> $myoutputFile sudo pptp $myPPTPserverIP --debug user $theusername mru 1500 mtu 1500 defaultroute usepeerdns replacedefaultroute sudo chmod a+x $myoutputFile CreateDesktopIcon echo "********** THE END *************" exit 0 } CreateDesktopIcon() { echo '[Desktop Entry]' > $myiconFile echo 'Version=1.0' >> $myiconFile echo 'Encoding=UTF-8' >> $myiconFile echo 'Name=PPTP_DIALER' >> $myiconFile echo 'Type=Application' >> $myiconFile echo 'Terminal=false' >> $myiconFile echo "Exec=$myoutputFile" >> $myiconFile echo 'Name[he_IL]=PPTP_DIALER' >> $myiconFile echo 'GenericName[he_IL]=' >> $myiconFile echo 'Icon=/usr/share/icons/gnome/48x48/apps/gnome-favorites.png' >> $myiconFile } BezeqOut() { if [ "$1" = "10.0.0.138" ]; then echo "FOUND: BEZEQ style eth$mycounter" echo "this script is pptp dialer for non adsl infrastructure" exit 0 fi } while [ true ] do gksudo ifconfig eth$mycounter down sudo dhclient eth$mycounter if [ "0" != "$?" ] then echo "THE SCRIPT COULDN'T GET ETHERNET to comunicate the INTERNET... checked until eth$mycounter" exit 1 fi echo "*******************" echo "TRYING TO GET INFO" echo "FOR ETH$mycounter:" echo "*******************" GW="$(netstat -nr | grep eth$counter | grep UG | awk {'print $2'} | head -n 1)" if [ -n "$GW" ] then BezeqOut "$GW" echo "Try to connect the founded ethernet gateway: $GW to the pptp host server" sudo route add -host $3 gw $GW if [ "$?" != "0" ] then errHostMsg else CreateThePptpScript $1 $2 $3 fi else errNoGwMsg fi mycounter=$(($mycounter+1)) done |
קוד: |
#!/usr/bin/env python # -*- coding: utf-8 -*- # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Generated with glade2py script # glade2py script can be found at hocr web site http://hocr.berlios.de import pygtk; pygtk.require('2.0') import gtk; import gtk.glade; import re; import os; import sys; class MainWindow: def __init__(self): # create widget tree ... xml = gtk.glade.XML('project2.glade') # connect handlers xml.signal_autoconnect(self) # widgets self.window_pptp_dialer = xml.get_widget('window_pptp_dialer') self.vbox1 = xml.get_widget('vbox1') self.label1 = xml.get_widget('label1') self.image1 = xml.get_widget('image1') self.table1 = xml.get_widget('table1') self.label_enterusername = xml.get_widget('label_enterusername') self.label_enterpassword = xml.get_widget('label_enterpassword') self.label_enterISP = xml.get_widget('label_enterISP') self.comboboxentry_ISP = xml.get_widget('comboboxentry_ISP') self.comboboxentry_ISP = xml.get_widget('comboboxentry_ISP') self.entry_Password = xml.get_widget('entry_Password') self.entry_Username = xml.get_widget('entry_Username') self.button1 = xml.get_widget('button1') self.alignment1 = xml.get_widget('alignment1') self.hbox1 = xml.get_widget('hbox1') self.image2 = xml.get_widget('image2') self.label2 = xml.get_widget('label2') self.pptpServer="" # signal handlers def on_window_pptp_dialer_destroy(self, obj, event = None): "on_window_pptp_dialer_destroy activated" print 'on_window_pptp_dialer_destroy activated' gtk.main_quit() def on_comboboxentry_ISP_changed(self, obj, event = None): "on_comboboxentry_ISP_changed activated" print 'on_comboboxentry_ISP_changed activated' mytextval = self.comboboxentry_ISP.get_text() if mytextval == 'Netvision': self.pptpServer="cable.netvision.net.il" elif mytextval == 'Actcom': self.pptpServer="192.117.122.13" elif mytextval == 'Barak': self.pptpServer="pns.barak.net.il" elif mytextval == 'Bezeqint': self.pptpServer="matav.bezeqint.net" elif mytextval == 'Zahav': self.pptpServer="pns.inter.net.il" elif mytextval == '012Net': self.pptpServer="cablepns.012.net.il" elif mytextval == 'Technion': self.pptpServer="ccdis3.technion.ac.il" elif mytextval == 'HebrewUniversity': self.pptpServer="vpn.huji.ac.il" print self.pptpServer def on_entry_Password_activate(self, obj, event = None): "on_entry_Password_activate activated" print 'on_entry_Password_activate activated' def on_entry_Username_activate(self, obj, event = None): "on_entry_Username_activate activated" print 'on_entry_Username_activate activated' print self.entry_Username.get_text() userForm = re.compile('^[\w]+$') correctUser = userForm.match(self.entry_Username.get_text()) print correctUser if self.pptpServer == '': print 'ISP needed to be chosen' if correctUser: print 'correct username' else: print 'wrong username' def on_button1_clicked(self, obj, event = None): "on_button1_clicked activated" print 'on_button1_clicked activated' print 'username: '+self.entry_Username.get_text() print 'password: '+self.entry_Password.get_text() print 'isp: '+self.pptpServer print self.entry_Username.get_text() userForm = re.compile('^[\w]+$') correctUser = userForm.match(self.entry_Username.get_text()) if self.pptpServer == '': print 'ISP needed to be chosen' elif self.entry_Password.get_text() == '': print 'set password' elif correctUser: print 'username checked ok' os.system('sh ppptp_dialer_installation.sh '+self.entry_Username.get_text()+' '+ self.entry_Password.get_text() +' '+ self.pptpServer) else: print 'wrong username' print 'Username form without spaces or non alphabetic charactars' print 'Username must not be empty!' # run main loop def main(): main_window = MainWindow() main_window.window_pptp_dialer.show() gtk.main() if __name__ == "__main__": main() |
קוד: |
sudo dpkg-reconfigure -f gnome icables |
mmoalem : |
hi there all - i cant write in hebrew on my pc so sorry...
just to say that i have tried the install and after it didnt work for a while i have tried all kind of options in the connectpptp.me script . finally i have managed to get it working when i have added the password my_password to the line before the last one and i had to chane myETH to eth1 - my wireless connection. maybe this info will help you improve the install to new linux users |
3dman : |
אני ביזבזתי כבר איזה חודש בקריאת מדריכים והתקנות שדורשות כל מיני ספריות חסרות, פתיחת קבצים, פיזורם בכל רחבי הלינוקסים שלי אבל עוד לא מצאתי מדריך אחד שבאמת מניח שאתה לא מבין כלום ואומר לך שלב אחר שלב מה להוריד ->היכן לפתוח->איפה למקם->שלבי הפעלה....
|
3dman : |
כרמית שלום,
קודם כל - כל הכבוד על המאמץ ליצור משהו פשוט שכולם יוכלו להשתמש בו, הלוואי והיה לי מספיק ידע לעשות זאת בעצמי, אך אולי אוכל לתרום משהו בכל זאת במובן של יצירת אייקונים ועיצוב גראפי בכיף... בכל אופן קראתי את הסקריפטים אך לא הבנתי: 1. איזה קבצים עליי להוריד אם בכלל? 2. בתור איזה שם קובץ לשמור את הסקריפט? 3. איפה לשים את הקבצים? 4. מה להפעיל קודם? 5. יש לי כבר pptp מובנה בהפצה שלי וכן PPPD אם זה קשור... אני ביזבזתי כבר איזה חודש בקריאת מדריכים והתקנות שדורשות כל מיני ספריות חסרות, פתיחת קבצים, פיזורם בכל רחבי הלינוקסים שלי אבל עוד לא מצאתי מדריך אחד שבאמת מניח שאתה לא מבין כלום ואומר לך שלב אחר שלב מה להוריד ->היכן לפתוח->איפה למקם->שלבי הפעלה.... אני בטוח שאם אני אצליח להבין אוכל להסביר לעוד הרבה אנשים ואף לגרום להם להגר מwindows ללינוקס המבורך. אני בכיר בחברת אינטרנט גדולה ויכול להכניס את זה אפילו לאתרים הרשמיים של החברות הן של התשתית והן של ספקי האינטרנט. כרגע אני מנסה הפצה של לינוקס שנקראת PCPuppyOS |
3dman : |
תודה כרמית,
אך אולי תוכלי להניח כאן איזה קישור לקובץ. כרגע יש לי גישה לאינטרנט אך לא לתשתית הכבלים. וכנראה שאתחבר דרך 014 האם זה משנה? תודה |
Anonymous : | ||||
1. אם לאנשים נוח עם סקריפטים וקבצי הגדרות אז בכיף... למי שלא אוהב להתעסק עם זה, יעדיף להשתמש בGUI. 2. ניתן לטעון הגדרות מקובץ ואז זה בכלל נהיה פשוט. אם היית אפשרות לעלות קבצים לכאן הייתי מעלה את קובץ ההגדרות שלי ואז כל מי שמחובר ל012 היה פשוט מיבא אותו. 3. ניתן להשתמש גם בגרסה המתקדמת יותר של pptp אין מניעה לכך. 4. משתמשים מתחילים גם לא יודעים מה זה terminal, איך פותחים tar.gz. עדיף כבר להרגיל אותם לpackage manager, למרות שבמקרה זה לא צריך package manager כי אפשר פשוט ללחוץ על קבצי הdeb ואז הubuntu מתקין אותם. אם זה עובד טוב עם mtu 1500 אז אפשר לנסות גם פה. 5. אין צורך לרשום כל הזמן, מסמנים את תיבת "Remember Password" ואז זה שומר את זה בkeyring. יתרונות נוספים: 1. כל משתמש windows שעובר לubuntu רוצה להתעסק כמה שפחות עם terminal ולעבוד דרך הgui של ubuntu. 2. ישנה אינדיקציה בפינה של המסך שהconnection מחובר. (יש סמל של מנעול ליד הסמל של המחשבים וזה מציין שהvpn מחובר) 3. ניתן להתחבר ולהנתק על ידי לחיצה על הicon הנ"ל ובחירה מהתפריט. 4. לא צריך סיסמת sudo בשביל להתחבר. דרך אגב: בהוראות ההתחברות של 012 לwindows ישנו פירוט דומה לגבי יצירת vpn בwindows, כל מי שהתנסה ביצירת vpn בwindows יוכל בקלות ליצור את הvpn גם כאן. אבל שלא תביני לא נכון, אני תומך ברעיון שלך - שבו תהיה חבילה אחת שבלחיצת כפתור אוכל להגדיר את החיבור שלי לאינטרנט ורק אצטרך לבחור ספק ולהזין שם משתמש וסיסמא. כאשר יהיה בתוכנה שלך גם GUI נוח ופשוט עם Tray Icon שמציין את סטטוס ההתחברות. אני בכיף אשתמש בה. |
leo212 : |
צר לי לאכזב אתכם, אבל ניתן להתחבר באובונטו לכבלים בצורה הרבה יותר "טבעית".
1. הורדה והתקנת החבילות הבאות: (ניתן להוריד במחשב אחר שמחובר לאינטרנט ולהתקין באובונטו ללא חיבור לאינטרנט) pptp-linux network-manager-pptp כתובות להורדה של הגרסאות העדכניות נכון להיום:http://launchpadlibrarian.net/6716221/pptp-linux_1.7.0-2ubuntu2_i386.deb http://launchpadlibrarian.net/6718639/pptp-linux_1.7.0-2ubuntu2_ia64.deb http://launchpadlibrarian.net/4629745/network-manager-pptp_0.6.3%2Bcvs20060819-0ubuntu2_i386.deb http://launchpadlibrarian.net/4631331/network-manager-pptp_0.6.3%2Bcvs20060819-0ubuntu2_ia64.deb הגרסה העדכנית ביותר נמצאת ב: https://launchpad.net/ubuntu/feisty 2. לחיצה עם מקש עכבר שמאלי על הIcon של הConnection (שתי מחשבים) ובחירת VPN Connection -> Configure VPN. 3. לחיצה על Add. 4. לחיצה על Forward, בחירת "PPTP Tunnel" מהרשימה ולחיצה שוב על Forward. 5. בשדה Connection Name יש לכתוב שם ידידותי לחיבור האינטרנט (למשל 012) 6. בשדה Gateway יש לרשום את כתובת הספק - במקרה שלי cablepns.012.net.il. 7. לעבור לטאב "Compression and Encryption" ולנקות את כל תיבות הסימון. 8. לעבור לטאב "PPP Options" ולסמן את Use Peer DNS. 9. להזין MTU 1416 ו-MRU 1460. 10. להזין lcp-echo-failure 3 ו- lcp-echo-interval 20. זהו, פחות או יותר. ללחוץ על Forward ואז Apply. והvpn יופיע לכם ברשימה. כדי להתחבר לVPN צריך ללחוץ על הIcon של הConnection ולבחור VPN Connection, יופיע השם של הVPN שיצרתם - אם תלחצו עליו זה יתחיל להתחבר. (לאחר הזנת שם משתמש וסיסמא כמובן) בהצלחה! |
shlomi6 : |
אם כל מה שנכתב לפניי, כל ההשקעה האדירה, הזמן, המאמץ, והיידע שאנשים משקיעים כאן ביצירת החייגן, כל זה הוא דיון אקדמי שנועד להרחיב את הידע, אז אחלה ומה שאכתוב בהמשך אינו רלוונטי.
לדעתי האישית, הפוסט הזה דומה לפתרון של האמריקאים לכתיבה בפרוייקט אפולו, דהיינו עט מיוחד שיכול לכתוב בחלל ושעלה 10 מליון דולר, כאשר הרוסים שלחו את הקוסמונאוטים עם עיפרון שעלה רובל אחד. ההקבלה ( על דרך ההקצנה ) היא שיותר פשוט ונכון לקנות ראוטר פשוט שמתחיל ב 120 ש"ח ( TPLINK ), גם זול גם אין משמעות למערכת ההפעלה, לסוג המכשיר המתחבר לרשת (PC, מחשב כף יד, אייפון, או מכשיר עם אנדרואיד וויפי ) וגם חומת אש בסיסית. בכלל כל נושא החייגנים בכל הסוגים של מערכות ההפעלה, צריך לעבור מהעולם. מה גם שבכבלים החיבור הכי טוב הוא ללא חייגן. |
ציטוט: |
למשל אם השם משתמש הוא עם @ זה יהיה בזק |
Anonymous : | ||
נתב גם מריץ לינוקס , ולכן מה שאני טוען הוא , מה מפריע לך שללינוקס יהיה כלי עזר לפעולה זאת? |
nivw2 : |
צריך לבטל את network manager ולהפעיל את הservice |
דוביקס : | ||||
כמה הערות: 1. ב-ksp אפשר למצוא נתב קווי ב-40 ש"ח ונתב אלחוטי ב-95 ש"ח. במחירים כאלו, מי שמחפש להתעסק עם סקריפטים כאלו או אחרים מבזבז את זמנו (אלא אם הוא עושה זאת לשם הלימוד/הכיף). 2. לא כל הנתבים מריצים לינוקס, חלקם פועלים על BSD. 3. אין מניעה שיהיה סקריפט התחברות בלינוקס, ואם הוא משולב בכלי המערכת עוד יותר טוב. אבל כבר 10 שנים מתבצעים נסיונות כאלו או אחרים בקהילה המקומית לייצר כלי כזה ועוד לא הגענו לפתרון שיפעל על כל ההפצות, יפעל תמיד, וגם יתוחזק. ולכן, הפתרון המומלץ הוא נתב, נקודה. |