| gapy21 |  | 
| 
                Темы:
                
                    12
                
             
                Сообщения:
                
                    67
                
             
                Участник с: 30 июня 2012
             | Вообщем я попробовал все что написали, и увидел что /etc/resolv.conf - после запуска pon... очищаеться в стандарт. Почитав много тем по поводу настройки ВПН, пришел к выводу что в файл /etc/ppp/peers/mediana я что то или не дописываю, или что то лишнее вписываю(либо 2 в одном). Помогите разобраться что туда писать. Вот Скриншоты из Убунты:         | 
| naszar |  | 
| 
                Темы:
                
                    21
                
             
                Сообщения:
                
                    507
                
             
                Участник с: 24 сентября 2012
             | pty "pptp 10.172.119.1 --nolaunchpppd" pon mediana З.Ы. <TUNNEL> - это вам mediana нужно подставить.. и за такие большие картинки вас наверное наругают.. З.З.Ы. ваша программка похожа на скрипт, который просто конфиги заполняет. Посмотрите в убунте в /etc/ppp/peers мож там тоже есть mediana. Тогда надо просто папку /etc/ppp из убунты унести. | 
| gapy21 |  | 
| 
                Темы:
                
                    12
                
             
                Сообщения:
                
                    67
                
             
                Участник с: 30 июня 2012
             | naszarКавычки не там стоят? Или что не так? naszarСкачал образ archlinux-2013.07.01-dual.iso, записал его на флэшку (там толи (скорее всего)Fat32 толи NTFS.) naszarВвожу руками nano /etc/ppp/peers/mediana. Заполняю тоже руками (перепечатываю с листика). naszarЭм...У меня тут диск разбит чудовищно, хотел с нуля переразбить. Да и не совсем я понимаю как это делать. | 
| naszar |  | 
| 
                Темы:
                
                    21
                
             
                Сообщения:
                
                    507
                
             
                Участник с: 24 сентября 2012
             | там толи (скорее всего)Fat32 толи NTFS. mount Кавычки не там стоят? Или что не так? pppd call mediana debug nodetach | 
| naszar |  | 
| 
                Темы:
                
                    21
                
             
                Сообщения:
                
                    507
                
             
                Участник с: 24 сентября 2012
             | Может локаль у вас какая-нибудь не английская? А если так? pptpsetup --create middinna --server 10.172.119.1 --username VPN_LOGIN --password VPN_PASSWORD pppd call middinna nodetach debug UPD: ТУТ у вас даже получилось... вы тогда продвинулись много дальше чем в начале этой темы.. давайте повторим? Скажите еще ip link ping -c2 10.172.119.1 | 
| gapy21 |  | 
| 
                Темы:
                
                    12
                
             
                Сообщения:
                
                    67
                
             
                Участник с: 30 июня 2012
             | naszar Для вывода этой команды, логин и пароль я заменил. Их уж извените, но не покажу.naszar/dev/sdc1 on /media/ARCH_201307 type iso9660 (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,iocharset=utf8,mode=0400,dmode=0500) | 
| naszar |  | 
| 
                Темы:
                
                    21
                
             
                Сообщения:
                
                    507
                
             
                Участник с: 24 сентября 2012
             | Вы сообщение последнее читали? У вас уже получалось решить проблему. Давайте выкинем бумажки и найдем какой-нибудь носитель, на котором сохраним скрипт, поднимающий ваше соединение... так сказать автоматизируем ваши попытки... Получится у вас примонтировать раздел от убунты? #!/usr/bin/sh ip a a 10.172.119.13/24 dev eth0 ip l s up dev eth0 ip r a default via 10.172.119.254 #Прописываем IP DNS-серверов в файл /etc/resolv.conf Он должен выглядеть следующим образом: #Файл: /etc/resolv.conf echo 'nameserver 10.172.119.1' > /etc/resolv.conf #Если сеть работоспособна, должны пинговаться шлюз и VPN-сервер. Проверяем: ping -c2 10.172.119.254 ping -c2 10.172.119.1 #Добавляем в нашу таблицу роутинга статические маршруты на VPN и DNS сервера: ip r a 10.172.119.1 via 10.172.119.254 ip r d default #Проверка: мы должны успешно пинговать DNS и VPN сервера. ping -c2 10.172.119.1 pptpsetup --create middinna --server 10.172.119.1 --username VPN_LOGIN --password VPN_PASSWORD pppd call middinna nodetach debug cmod +x pptp_up /mnt/ubuntu/<путь_до_pptp_up/pptp_up /mnt/ubuntu/<путь_до_pptp_up/pptp_up > /mnt/ubuntu/<путь_до_pptp_up/pptp_up_errors | 
| gapy21 |  | 
| 
                Темы:
                
                    12
                
             
                Сообщения:
                
                    67
                
             
                Участник с: 30 июня 2012
             | naszarpptpsetup - вернул в дефолт. pptp_up_errors: А вот с моего скриптика:  | 
| gapy21 |  | 
| 
                Темы:
                
                    12
                
             
                Сообщения:
                
                    67
                
             
                Участник с: 30 июня 2012
             | naszarСделал так: sh ./pptp_up > pptp_up_errors 2>&1 и получил вот что: PING 10.172.119.254 (10.172.119.254) 56(84) bytes of data. From 10.172.119.13 icmp_seq=1 Destination Host Unreachable From 10.172.119.13 icmp_seq=2 Destination Host Unreachable --- 10.172.119.254 ping statistics --- 2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 999ms pipe 2 PING 10.172.119.1 (10.172.119.1) 56(84) bytes of data. 64 bytes from 10.172.119.1: icmp_seq=1 ttl=64 time=0.595 ms 64 bytes from 10.172.119.1: icmp_seq=2 ttl=64 time=0.251 ms --- 10.172.119.1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.251/0.423/0.595/0.172 ms PING 10.172.119.1 (10.172.119.1) 56(84) bytes of data. From 10.172.119.13 icmp_seq=1 Destination Host Unreachable From 10.172.119.13 icmp_seq=2 Destination Host Unreachable --- 10.172.119.1 ping statistics --- 2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 999ms pipe 2 sh: strings: command not found /usr/bin/pptpsetup: couldn't find MPPE support in pppd. pppd: Can't open options file /etc/ppp/peers/middinna: No such file or directory #!/usr/bin/perl
use strict;
use Getopt::Long;
use vars qw($VERSION);
$VERSION = '0.03';
# Command-line parameters:
# actions
my ( $_create, $_delete, $_help );
# values
my ( $SERVER, $DOMAIN, $USERNAME, $PASSWORD, $ENCRYPT, $START );
my $result = GetOptions(
    "create|c=s"   => \$_create,    # --create foo -> &create("foo")
    "delete=s"     => \$_delete,    # --delete foo -> &delete("foo")
    "help|h"       => \$_help,      # --help       -> &help()
    "server|s=s"   => \$SERVER,
    "domain|d=s"   => \$DOMAIN,
    "username|u=s" => \$USERNAME,
    "password|p=s" => \$PASSWORD,
    "encrypt|e"    => \$ENCRYPT,
    "start"        => \$START,
);
if ($_create) {
    &create($_create);
} elsif ($_delete) {
    &delete($_delete);
} elsif ($_help) {
    &help();
} else {
    die "$0: too few arguments.\nTry '$0 --help' for more information.\n";
}
exit;
####
sub create {
    my $TUNNEL = shift;
    # system checking
    &Check_MPPE_in_kernel
        or die "$0: couldn't find MPPE support in kernel.\n";
    &Check_MPPE_in_pppd
        or die "$0: couldn't find MPPE support in pppd.\n";
    # input validation
    ($TUNNEL) = $TUNNEL =~ m{^(\w+)$}
      or die "$0: invalid tunnel name.\nTry '$0 --help' for more information.\n";
    ($SERVER) = $SERVER =~ m{^(.+)$}
      or die "$0: invalid server.\nTry '$0 --help' for more information.\n";
    ($USERNAME) = $USERNAME =~ m{^(.+)$}
      or die "$0: invalid username.\nTry '$0 --help' for more information.\n";
    # ask password
    if ( !$PASSWORD ) {
        print "Password: ";
        $PASSWORD = <STDIN>;
        chomp $PASSWORD;
    }
    # put '\' between domain and username IF specified a domain
    $DOMAIN = "$DOMAIN\\" if $DOMAIN;
    # create or add lines to the /etc/ppp/chap-secrets file,
    # which holds usernames and passwords
    my $chap_secrets_file = '/etc/ppp/chap-secrets';
    open( FILE, ">>$chap_secrets_file" )
      or die "$0: can't write to '$chap_secrets_file': $!\n";
    print FILE "\n# added by pptpsetup for $TUNNEL\n$DOMAIN$USERNAME $TUNNEL \"$PASSWORD\" *\n";
    close FILE;
    # create a /etc/ppp/peers/$TUNNEL file
    my $tunnel_file = "/etc/ppp/peers/$TUNNEL";
    open( FILE, ">$tunnel_file" )
      or die "$0: can't write to '$tunnel_file': $!\n";
    print FILE <<"TUNNEL";
# written by pptpsetup
pty "pptp $SERVER --nolaunchpppd"
lock
noauth
nobsdcomp
nodeflate
name $DOMAIN$USERNAME
remotename $TUNNEL
ipparam $TUNNEL
TUNNEL
    print FILE "require-mppe-128\n" if $ENCRYPT;
    close FILE;
    # start tunneling
    if ($START) {
        system("pppd call $TUNNEL updetach");
    }
}
####
sub help {
    print <<'EOF';
pptpsetup --create <TUNNEL> --server <SERVER> [--domain <DOMAIN>]
          --username <USERNAME> [--password <PASSWORD>]
          [--encrypt] [--start]
pptpsetup --delete <TUNNEL>
Options:
* the name you wish to use to refer to the tunnel (you choose it),
* the IP address or host name of the server,
* the authentication domain name (optional),
* the username you are to use,
* the password you are to use,
* whether encryption is required,
* whether to start the connection after configuration.
pptpsetup - Point-to-Point Tunneling Protocol setup
Copyright (C) 2006 Nelson Ferraz
pptpsetup comes with ABSOLUTELY NO WARRANTY; for details see source.
This is free software, and you are welcome to redistribute it
under certain conditions; see source for details.
EOF
    exit;
}
####
sub delete {
    my $tunnel = shift;
    # input validation
    ($tunnel) = $tunnel =~ m{^(\w+)$}
      or die "$0: invalid tunnel name.\nTry '$0 --help' for more information.\n";
    # delete tunnel file
    my $tunnel_file = "/etc/ppp/peers/$tunnel";
    unlink $tunnel_file
        or die "$0: can't delete '$tunnel_file': $!\n";
    # delete entry from chap-secrets
    my $chap_file = '/etc/ppp/chap-secrets';
    open( FILE, $chap_file )
        or die "$0: can't read '$chap_file': $!\n";
    my @chap = <FILE>;
    close FILE;
    my $new_chap = '';
    foreach (@chap) {
        $new_chap .= $_ unless /\b$tunnel\b/;
    }
    # backup
    rename( $chap_file, "$chap_file.bkp" );
    # write new chap-secrets
    open( FILE, ">$chap_file" )
        or die "$0: can't write '$chap_file': $!\n";
    print FILE $new_chap;
    close FILE;
    exit;
}
### AUXILIAR SUBS ###
sub Check_MPPE_in_kernel {
    my $command = q/modprobe ppp-compress-18/;
    if (system( $command ) == 0) {
        # no error!
        return 1;
    } else {
        return 0;
    }
}
sub Check_MPPE_in_pppd {
    my $command = q/strings `which pppd`|grep -i mppe|wc --lines/;
    my $answer  = `$command`;
    if ($answer > 0) {
        # ok!
        return 1;
    } else {
        return 0;
    }
}
__END__
=head1 NAME
pptpsetup - Point-to-Point Tunneling Protocol setup
=head1 SYNOPSIS
    pptpsetup --create <TUNNEL> --server <SERVER> [--domain <DOMAIN>]
              --username <USERNAME> [--password <PASSWORD>]
              [--encrypt] [--start]
    pptpsetup --delete <TUNNEL>
=head1 DESCRIPTION
PPTP Client is a Linux, FreeBSD, NetBSD and OpenBSD client for the
proprietary Microsoft Point-to-Point Tunneling Protocol, PPTP.
This script configures PPTP Client on Linux.
=head1 OPTIONS
=over 16
=item --create TUNNEL
create a tunnel named TUNNEL
=item --delete TUNNEL
delete the file /etc/ppp/peers/TUNNEL and any lines from
/etc/ppp/chap-secrets that contains "TUNNEL" as a single word
=item --server SERVER
the IP address or host name of the server
=item --domain DOMAIN
the authentication domain name (optional)
=item --username USERNAME
the username you are to use
=item --password PASSWORD
the password you are to use. If you don't specify a password,
pptpsetup will ask for one.
=item --encrypt
whether encryption is required
=item --start
whether the connection should be started after configuration.
=back
=head1 AUTHOR
Nelson Ferraz <nferraz at gmail.com>,
based on James Cameron's PPTP Client Debian HOWTO.
=head1 SEE ALSO
=over 16
=item PPTP Client Debian HOWTO
http://pptpclient.sourceforge.net/howto-debian.phtml
=item PPTP Client Diagnosis HOWTO
http://pptpclient.sourceforge.net/howto-diagnosis.phtml
=back
=head1 COPYRIGHT
pptpsetup - Point-to-Point Tunneling Protocol setup
Copyright (C) 2006 Nelson Ferraz
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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA | 
| naszar |  | 
| 
                Темы:
                
                    21
                
             
                Сообщения:
                
                    507
                
             
                Участник с: 24 сентября 2012
             | Вы такое уже чинили по этому совету... sub Check_MPPE_in_pppd { return 1;}pty pptp 10.172.119.1 --nolaunchpppd echo 'pty "pptp 10.172.119.1 --nolaunchpppd"'> /etc/ppp/peers/mediana Попробуйте так: #!/usr/bin/sh ifconfig enp2s0 down ifconfig enp2s0 10.172.119.13/24 ifconfig enp2s0 up route add -host 10.172.119.1 gw 10.172.119.254 dev enp2s0 #Прописываем IP DNS-серверов в файл /etc/resolv.conf Он должен выглядеть следующим образом: #Файл: /etc/resolv.conf echo 'nameserver 10.172.119.1' > /etc/resolv.conf #Если сеть работоспособна, должны пинговаться шлюз и VPN-сервер. Проверяем: ping -c2 10.172.119.254 ping -c2 10.172.119.1 #fix pptpsetup echo 'echo i love mppe' > /usr/bin/strings chmod +x /usr/bin/strings #fixed pptpsetup --create middinna --server 10.172.119.1 --username VPN_LOGIN --password VPN_PASSWORD pppd call middinna nodetach debug |