海运的博客

通过OpenWRT连接ROS重新PPPoe拨号

发布时间:May 27, 2013 // 分类:ROS // No Comments

OpenWRT安装PPPoe服务器,当客户端连接或断开时通过ip-down.d/ip-up.d执行ROS命令,ROS需配置使用SSH Key验证
当系统拨号断开时停止PPPoe:

mkdir /etc/ppp/ip-down.d
cat >/etc/ppp/ip-down.d/pppoe-down.sh << EOF
#!/bin/sh
ssh admin@192.168.1.21 "/interface pppoe-client disable pppoe-out1"
EOF
chmod +x /etc/ppp/ip-down.d/pppoe-down.sh 

当连接系统拨号连接时开启PPPoe:

mkdir /etc/ppp/ip-up.d
cat >/etc/ppp/ip-up.d/pppoe-up.sh << EOF
#!/bin/sh
ssh admin@192.168.1.21 "/interface pppoe-client enable pppoe-out1"
EOF
chmod +x /etc/ppp/ip-up.d/pppoe-up.sh 

2015.03.17更新:
ros重新拨号只需enable就行,无需先disable:

ssh admin@192.168.1.21 "/interface pppoe-client enable pppoe-out1"

OpenWRT更新到14.07安装的pppoe不执行ip-down.d或up目录下脚本,需添加相应脚本,PPPD连接时会执行此脚本:

cat >/etc/ppp/ip-up << EOF
#!/bin/sh
[ -d /etc/ppp/ip-up.d ] && {
        for SCRIPT in /etc/ppp/ip-up.d/*
        do
                [ -x "$SCRIPT" ] && "$SCRIPT" "$@"
        done
}
EOF
chmod +x /etc/ppp/ip-up

使用SSH Key验证登录ROS

发布时间:May 26, 2013 // 分类:ROS // No Comments

首先生成SSH key:

ssh-keygen -t dsa

复制SSH Key到ROS:

scp ~/.ssh/id_dsa.pub admin@192.168.1.21:

登录到ROS导入SSH Key:

user ssh-keys import public-key-file=id_dsa.pub user=admin 

然后就可免验证登录ROS了:

ssh admin@192.168.1.21

OpenWRT安装配置PPPoe服务器

发布时间:May 26, 2013 // 分类:OpenWrt // 1 Comment

OpenWRT安装PPPoe:

opkg update
opkg install rp-pppoe-server

配置PPPoe:

cat > pppoe-server-options << EOF
# PPP options for the PPPoE server
# LIC: GPL
require-chap
login
lcp-echo-interval 10
lcp-echo-failure 2
ms-dns 8.8.8.8
EOF

设置PPPoe账号、密码:

cat >/etc/ppp/chap-secrets << EOF
#USERNAME  PROVIDER  PASSWORD  IPADDRESS
www.haiyun.me * www.haiyun.me *
EOF

启动PPPoe服务脚本:

cat >/etc/init.d/pppoe-server << EOF
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50

start() {
        echo 1 > /proc/sys/net/ipv4/ip_forward
        iptables -t nat -A POSTROUTING -s 10.0.1.0/24 -j MASQUERADE
        /usr/sbin/pppoe-server -k -T 60 -I eth1.1 -N 100 -L 10.0.1.1 -R 10.0.1.2
}

stop() {
        iptables -t nat -D POSTROUTING -s 10.0.1.0/24 -j MASQUERADE
    killall pppoe-server
}
EOF
chmod +x /etc/init.d/pppoe-server

遇到的问题1,客户端连接错误代码619,使用tcpdump监听数据包:

Generic-Error "RP-PPPoE: Child pppd process terminated"

查看pppoe错误日志:

May 26 13:31:07 OpenWrt daemon.notice pppd[4972]: Connect: ppp0 <--> /dev/pts/1
May 26 13:31:07 OpenWrt daemon.notice pppd[4972]: Modem hangup
May 26 13:31:07 OpenWrt daemon.notice pppd[4972]: Connection terminated.

解决方法:启动参数加-k,加载内核pppoe模块启动。
遇到的问题2,客户端连接错误代码691,原因:

用户名或密码填写错误
require-chap账号密码文件确认为chap-secrets

Lnmp编译添加php imap模块

发布时间:May 11, 2013 // 分类:PHP // No Comments

cd php-5.2.17/ext/imap
/usr/local/php/bin/phpize 
./configure --with-php-config=/usr/local/php/bin/php-config --with-kerberos --with-imap-ssl
make
make install

编译时如遇到错误:

configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.

安装imap库:

yum install libc-client-devel

加载imap到php配置文件:

extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"
extension=imap.so

此内容被密码保护

发布时间:May 9, 2013 // 分类:Mail // 3 Comments

请输入密码访问

分类
最新文章
最近回复
  • 海运: 地址格式和udpxy一样,udpxy和msd_lite能用这个就能用。
  • 1: 怎么用 编译后的程序在家里路由器内任意一台设备上运行就可以吗?比如笔记本电脑 m参数是笔记本的...
  • 孤狼: ups_status_set: seems that UPS [BK650M2-CH] is ...
  • 孤狼: 擦。。。。apcupsd会失联 nut在冲到到100的时候会ONBATT进入关机状态,我想想办...
  • 海运: 网络,找到相应的url编辑重发请求,firefox有此功能,其它未知。
  • knetxp: 用浏览器F12网络拦截或监听后编辑重发请求,修改url中的set为set_super,将POS...
  • Albert: 啊啊啊啊啊啊啊啊啊 我太激动了,终于好了英文区搜索了半天,翻遍了 pve 论坛没找到好方法,博...
  • jiangker: good, very helpful to me
  • fengfeng: N1 armbian 能有编译下内核吗。。我要开启can 不懂怎么操作
  • 1: 方法一ngtcp2要改下:./configure PKG_CONFIG_PATH=/usr/l...