Страница проекта: http://bird-lg.subnets.ru/
Для работы LG необходимо:
- установленный и запущенный BIRD
web сервер (аля apache)
PHP5: модуль для apache и CLI версия
birdclient stream tcp nowait root /usr/sbin/tcpd /usr/bin/php /usr/local/bin/bird.client.php &
birdclient 55555/tcp
ALL:ALL
# netstat -lnp | grep 55555
tcp 0 0 0.0.0.0:55555 0.0.0.0:* LISTEN 15842/inetd
Total routes: 0
[ERROR]: Remote IP is unknown
[2014-12-02 05:47:47]: bird.client run as remote
[2014-12-02 05:47:47]: Remote IP is unknown
PHP Notice: Undefined offset: 1 in /usr/local/bin/bird.client.php on line 187
$query_type=$tmp[1];
$query_type="";
if (is_array($permitted_commands)){
unset($tmp);
preg_match("/^(\S+)\s/",$command,$tmp);
$query_type=$tmp[1];
if (!in_array($tmp[1],$permitted_commands)){
<------>$error[]=sprintf("%s is prohibited",$query_type);
}
# uname -a
Linux www-ns 2.6.32-5-686 #1 SMP Mon Jan 16 16:04:25 UTC 2012 i686 GNU/Linux
# php -v
PHP 5.3.3-7+squeeze19 with Suhosin-Patch (cli) (built: Feb 18 2014 13:59:15)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH
dragomir писал(а):birdclient stream tcp nowait root /usr/sbin/tcpd /usr/bin/php /usr/local/bin/bird.client.php &
dragomir писал(а):у вас в примерах показана настройкана freebsd с tcp-server
dragomir писал(а):подскажите, что можно подправить
If a connection is made with a streaming protocol (‘stream’) and if --environment option has been given, inetd will set the following environment variables before starting the program:
PROTO
Always ‘TCP’.
TCPLOCALIP
Local IP address of the interface which accepted the connection.
TCPLOCALPORT
Port number on which the TCP connection was established.
TCPREMOTEIP
IP address of the remote client.
TCPREMOTEPORT
Port number on the client side of the TCP connection.
Additionally, if given the --remote option, inetd sets the following environment variables:
TCPLOCALHOST
DNS name of TCPLOCALIP.
TCPREMOTEHOST
DNS name of TCPREMOTEIP.
$remote_ip=isset($_SERVER['TCPREMOTEIP']) ? $_SERVER['TCPREMOTEIP'] : "";
$remote_ip=isset($_SERVER['TCPREMOTEIP']) ? $_SERVER['TCPREMOTEIP'] : getenv('TCPREMOTEIP');
$config['bird_client_remote_permited_ips']=array();
$config['bird_client_remote_permited_ips'][]="127.0.0.1";
$remote_ip="127.0.0.1";
# ps aux | grep inetd
root 21669 0.0 0.0 12780 780 ? S 16:24 0:00 /usr/sbin/inetutils-inetd --environment
$remote_ip=isset($_SERVER['TCPREMOTEIP']) ? $_SERVER['TCPREMOTEIP'] : getenv('TCPREMOTEIP');
[2014-12-02 16:26:38]: bird.client run as remote
[2014-12-02 16:26:38]: Remote connection FORBIDDEN for 91.x.x.x
$remote_ip="127.0.0.1";
[2014-12-02 16:31:17]: bird.client run as remote
[2014-12-02 16:31:17]: Remote connection from 127.0.0.1
[2014-12-02 16:31:17]: ++++++++++++ got params +++++++++++++++
[2014-12-02 16:31:17]: -- 0 = -c
[2014-12-02 16:31:17]: -- 1 = ipv4:
[2014-12-02 16:31:17]: -- 2 = show
[2014-12-02 16:31:17]: -- 3 = route
[2014-12-02 16:31:17]: -- 4 = for
[2014-12-02 16:31:17]: -- 5 = 91.X.X.X
[2014-12-02 16:31:17]: -- 6 = all
[2014-12-02 16:31:17]: execute command [ipv4: show route for 91.X.X.X all]
[2014-12-02 16:31:17]: 91.X.X.X/22 via 91.X.X.6 on eth2 [Telecom Nov25] * (100) [AS197XXi]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 197XX
BGP.next_hop: 91.X.X.X
BGP.med: 0
BGP.local_pref: 100
via 91.X.X.15 on eth2 [Telecom2 Nov25] (100) [AS197XXi]
Type: BGP unicast univ
BGP.origin: IGP
BGP.as_path: 197XX 197XX 197XX
BGP.next_hop: 91.X.X.X
BGP.local_pref: 100
[2014-12-02 05:47:47]: Remote IP is unknown
[2014-12-02 16:26:38]: Remote connection FORBIDDEN for 91.x.x.x
$config['bird_client_remote_permited_ips'][]="91.x.x.x";
$config['bird_client_remote_permited_ips'][]="91.x.x.x";
$config['bird_client_remote']=false;
//First node
$hin++;
$config['nodes'][$hin]['host'] = '91.X.X.1';
$config['nodes'][$hin]['port'] = '55555';
$config['nodes'][$hin]['name'] = 'Remote';
$config['nodes'][$hin]['description'] = 'BIRD on 91.X.X.1';
$config['bird_client_remote']=true;
$config['bird_client_remote_permited_ips']=array();
$config['bird_client_remote_permited_ips'][]="127.0.0.1";
$config['bird_client_remote_permited_ips'][]="95.X.X.35";
//First node
$hin++;
$config['nodes'][$hin]['host'] = 'socket';
$config['nodes'][$hin]['port'] = '';
$config['nodes'][$hin]['name'] = 'Localhost';
$config['nodes'][$hin]['description'] = 'This server';
dragomir писал(а):мне не помогает.
$config['bird_client_remote']=true;
$config['bird_client_remote_permited_ips']=array();
$config['bird_client_remote_permited_ips'][]="127.0.0.1";
$config['bird_client_remote_permited_ips'][]="95.X.X.35";
Total routes: 0
[ERROR]: Remote connection from 91.X.X.35 is forbidden
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 9