My Internet connection was down for two days

The cause was that my ADSL connection got stuck due to sudden disconnection.
The problem was solved by resetting the ADSL connection from Bezeq’s side.

For future reference, I am writing some information which I collected during the process.

I use the following script to connect to ADSL:

#!/usr/bin/perl
#
# Supports hidden pap-secrets and chap-secrets files.
#
# Copyright (C) 2004 by Omer Zak, all rights reserved.
# Licensed under the GPL (version 2 or later).
#

($prog = $0) =~ s/.*///;
$usage = <<EOT;
Usage: $prog [ start | stop ]
  OPTIONS:
    start - Starts the connection
    stop - Stops it
    !!! implement also clean - to clean if the script
    !!! was aborted and did not clean up its act
EOT

######### Parameters ################################################
## 1. Hardwired parameters needed for both adsl.pl start and adsl.pl stop
$ramdisk = "/dev/ram2";
$ramdisk_mountpoint = "/tmp/ram_adsl";
$ramdisk_log = "/tmp/ramdisk_log$$";   # For messages created by RAMdisk related commands
$pap_secrets = "$ramdisk_mountpoint/alternate-pap-secrets";
$chap_secrets = "$ramdisk_mountpoint/alternate-chap-secrets";
$fw_adsl = "fw-adsl.sh";
## 2. User configurable parameters
$username = "your-username";
$ispname = "your-ISP";  # iactcom, to connect to Actcom
$debug = 0;
######### End of Parameters #########################################

######### Prepare RAMdisk for the secrets files #####################
sub prepare_ramdisk {
    $old_umask = umask(0177);
    $rc = system("dd if=/dev/zero of=$ramdisk bs=1k count=256 >& $ramdisk_log");    # RAMdisk size = 256K
    die "RAMdisk clear operation failed!n" unless (($rc/256) == 0);
    $rc = system("/sbin/mke2fs -vm0 $ramdisk 256 >> $ramdisk_log 2>&1");
    die "Filesystem construction in RAMdisk failed!n" unless (($rc/256) == 0);
    die "Could not make RAMdisk mountpoint!n" unless mkdir($ramdisk_mountpoint,0600);
    $rc = system("mount $ramdisk $ramdisk_mountpoint");
    die "Attempt to mount the RAMdisk failed!n" unless (($rc/256) == 0);
    umask($old_umask);
}
######### End of RAMdisk preparation ################################

######### Create a secrets file in RAMdisk ##########################
sub write_secrets_file {
    local($secret_type,$ramdisk_filename,$psw) = @_;
    # $secret_type is either "pap" or "chap"
    # $ramdisk_filename is the actual RAMdisk filename to which we
    #      establish a symbolic link.
    # $psw is the password which we do not want to actually save on disk.

    $old_umask = umask(0177);

    # Replace /etc/ppp/$secret_type-secrets (if any) by link into the RAMdisk.
    if (-e "/etc/ppp/$secret_type-secrets")
    {
	die "Could not rename existing /etc/ppp/$secret_type-secrets!n" unless rename("/etc/ppp/$secret_type-secrets","/etc/ppp/$secret_type-secrets.old.$$");
	print "Existing /etc/ppp/$secret_type-secrets was renamed as /etc/ppp/$secret_type-secrets.old.$$n";
    }
    die "Could not set up symbolic link at /etc/ppp/$secret_type-secrets!n" unless symlink($ramdisk_filename,"/etc/ppp/$secret_type-secrets");

    ######### Write secrets file ########################################

    die "Failed to open the alternate $secret_type secrets file!n" unless open(SECRETS,">$ramdisk_filename");
    print SECRETS "\"$username@$ispname\" \"10.0.0.138 RELAY_PPP1\" $pswn";
    die "Failed to close the alternate $secret_type secrets file!n" unless close(SECRETS);
    umask($old_umask);
}
###### End of procedure for creation of a RAMdisk secrets file ######

unless ($ARGV[0]) {
    die $usage;
}
if ($ARGV[0] =~ /^start/) {
    $start = 1;
}
elsif ($ARGV[0] =~ /^stop/) {
    $stop = 1;
}
elsif ($ARGV[0] =~ /^clean/) {
    die "The clean option is not implemented yet.n"
}
else {
        die $usage;
}

if ($start) {

    ##### Validate ##################################################
    $who = `whoami`;
    die "Only the superuser is permitted to run this script!n" unless ($who eq "rootn");

    ##### Obtain user's password ####################################
    if (-t STDIN) {
	system 'stty', '-echo';
    }
    $| = 1;   # Unbuffer STDOUT
    print "Password: ";
    chop($password = );
    print “n”;
    if (-t STDIN) {
	system ’stty’, ‘echo’;
    }
    # NOTE:  !!! The above is not protected against signals.
    #        !!! Aborting the script file at this point will
    #        !!! cause the terminal to enter Helen Keller mode.

    ##### Debian Addition:  need to create /dev/ppp if nonexistent ##
    if (!-e “/dev/ppp”) {
	print “/dev/ppp does not exist, creating it.n”;
	$rc = system(”mknod /dev/ppp c 108 0″);
	die “Attempt to create /dev/ppp failed!n” unless (($rc/256) == 0);
    }
    else {
	die “/dev/ppp is not a character special file!n” unless(-c “/dev/ppp”);
    }

    ##### Prepare RAM disk and links ################################
    prepare_ramdisk();

    # Replace /etc/ppp/pap-secrets (if any) by link into the RAMdisk.
    write_secrets_file(”pap”,$pap_secrets,$password);
    # Replace /etc/ppp/chap-secrets (if any) by link into the RAMdisk.
    write_secrets_file(”chap”,$chap_secrets,$password);

    # Now can start the ADSL connection.
    print “Calling Actcom via ADSL…n”;
    system(”/usr/sbin/pptp 10.0.0.138 –quirks=BEZEQ_ISRAEL debug user $username@$ispname remotename ”10.0.0.138 RELAY_PPP1” defaultroute mtu 1452 mru 1452 noauth &”);
    sleep 5;  # Should wait until a connection is really established.
    system($fw_adsl);
}

if ($stop) {

    print “Disconnecting from Actcom…n”;
    system(”/sbin/ifconfig ppp0 down”);
    system(”killall pppd”);
    sleep 2;
    print “Restoring regular iptables settings…n”;
    system(”/etc/rc.d/init.d/iptables restart”);

    # Now wipe out the PAP secrets and chat script files and do
    # other cleanup activities.
    die “Could not remove the symbolic link at /etc/ppp/pap-secrets!n” unless unlink(”/etc/ppp/pap-secrets”);
    die “Could not remove the symbolic link at /etc/ppp/chap-secrets!n” unless unlink(”/etc/ppp/chap-secrets”);
    $rc = system(”umount $ramdisk_mountpoint”);
    die “Attempt to unmount the RAMdisk failed!n” unless (($rc/256) == 0);
    die “Could not remove RAMdisk mountpoint!n” unless rmdir($ramdisk_mountpoint);
    $rc = system(”dd if=/dev/zero of=$ramdisk bs=1k count=256 >> $ramdisk_log 2>&1″);    # RAMdisk size = 256K
    die “RAMdisk wipe operation failed!n” unless (($rc/256) == 0);
    #### End of hidden pap-secrets support ##############################
}

######## Hidden pap-secrets file support code ###########################
if ($debug < = 0)
{
    die “Could not remove $ramdisk_log!n” unless unlink($ramdisk_log);
}
######## End of hidden pap-secrets support ##############################

# End of adsl.pl perl script.

(The above script calls another script - fw-adsl.sh - to configure the firewall. This script is not reproduced here.)

When my ADSL connection was stuck, pppd yielded the following error-message:

[pppd] LCP: timeout sending Config-Requests_

I took the following steps:

  1. Turned off and back on the ADSL modem.
  2. Ensured that the two rightmost lights in the modem are green and light steadily. Other lights blinked when there were connection attempts.
  3. Pinging the ADSL modem itself worked.
  4. Bezeq provides a special username for testing - 1@1, with empty password. If you can connect to this special username, but not to your ISP then the problem is with your ISP’s infrastructure. I could not connect to 1@1, proving that the problem was with Bezeq’s infrastructure.
  5. Since Bezeq does not support Linux, they need the user to connect a MS-Windows PC to ADSL and try to connect via it, and to note the error message given by MS-Windows! Since I do not have such a machine at home, I was stuck.
  6. I turned to a friend who might have such a laptop. He did not have a laptop, but told me his war story and advised me to ask Bezeq to reset my ADSL connection from their side. This advice worked!

Moral: we need a table relating pptp/pppd error messages to MS-Windows error codes, which Bezeq support personnel know.

The following FAX numbers are relevant to the problem resolution efforts:

  • Actcom - FAX 04-8676116 - active both during daytime and at night, but support personnel must be notified some other way to look at the FAX machine.
  • Bezeq Internet support center - FAX 03-6829048 - not clear if they answer FAX messages also at night and during weekend, because I contacted them also by alternative means (an hearing person making a phone call in my behalf).

RSS feed | Trackback URI

Comments

No comments yet.

Sorry, the comment form is closed at this time.