免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1995 | 回复: 4
打印 上一主题 下一主题

动态域名ppp.linkup配置问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-07-31 23:55 |只看该作者 |倒序浏览
家里的机器,adsl上网,动态IP,在http://www.2mydns.com/申请了个二级域名,更新DDNS方法是http://dyn.2mydns.com/dyn.asp?us ... mp;myip=123.321.0.1

写了个脚本ddns.sh
#!/bin/sh
IP=`ifconfig tun0 | grep inet | awk '{print $2}'`;
/usr/local/bin/wget -q "http://dyn.2mydns.com/dyn.asp?username=bla&password=bla&hostname=bla.2mydns.com&myip=$IP" -O /dev/null;

执行后,http://bla.2mydns.com/正确指向家中IP,现在想在每次ppp建立连接后自动更新动态dns记录,于是在/etc/ppp/下建立ppp.linkup文件
adsl:
!bg /home/bla/ddns.sh > /dev/null

但每次ppp连接建立后都会报告错误:
tun0: Warning: /etc/ppp/ppp.linkup: !bg /home/bla/ddns.sh > /dev/null: Invalid command

搞不懂怎么就无效命令了,请指点迷津,谢谢

[ 本帖最后由 leix 于 2006-7-31 23:57 编辑 ]

论坛徽章:
1
寅虎
日期:2013-09-29 23:15:15
2 [报告]
发表于 2006-08-01 07:57 |只看该作者
格式问题?
贴一下ppp.conf,ppp.linkup

论坛徽章:
0
3 [报告]
发表于 2006-08-01 11:58 |只看该作者
# cat /etc/rc.conf

# -- sysinstall generated deltas -- # Sun Jun 11 21:44:31 2006
# Created: Sun Jun 11 21:44:31 2006
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
ifconfig_xl0="inet 192.168.1.2  netmask 255.255.255.0"
ifconfig_xl1="inet 192.168.0.1  netmask 255.255.255.0"
defaultrouter="192.168.1.1"
hostname="www.blabla.com"
gateway_enable="YES"
linux_enable="YES"
sshd_enable="YES"
ppp_enable="YES"
ppp_mode="ddial"
ppp_nat="YES"
ppp_profile="adsl"
firewall_enable="NO"
sendmail_enable="NONE"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
syslogd_enable="YES"
syslogd_flags="-ss"
clear_tmp_enable="YES"


# cat /etc/ppp/ppp.conf
#################################################################
# PPP  Sample Configuration File
# Originally written by Toshiharu OHNO
# Simplified 5/14/1999 by wself@cdrom.com
#
# See /usr/share/examples/ppp/ for some examples
#
# $FreeBSD: src/etc/ppp/ppp.conf,v 1.10 2004/11/19 17:12:56 obrien Exp $
#################################################################

default:
  set log Phase Chat LCP IPCP CCP tun command
  set ifaddr 192.168.1.1/0 192.168.1.2/0
  enable dns

adsl:
  set device PPPoEl0
  set authname bla@163.bla
  set authkey BLABLA
  set dial
  set login
  add default HISADDR



# cat /etc/ppp/ppp.linkup
#########################################################################
#
#          Example of ppp.linkup file
#
#  This file is checked when ppp establishes a connection.
#  ppp searches the labels in this file as follows:
#
#  1) The label that matches the IP number assigned to our side.
#
#  2) The label specified on the command line to ppp.
#
#  3) If no label has been found, use MYADDR if it exists.
#
#
# $FreeBSD: src/share/examples/ppp/ppp.linkup.sample,v 1.2 1999/08/28 00:19:31 peter Exp $
#
#########################################################################

# It is no longer necessary to re-add the default route here as our
# ppp.conf route is `sticky' (see the man page).
# If you're into sound effects when the link comes up, you can run
# ``auplay'' (assuming NAS is installed and configured).
#
adsl:
!bg /home/bla/ddns.sh > /dev/null



# cat ddns.sh
#!/bin/sh
IP=`ifconfig tun0 | grep inet | awk '{print $2}'`;
/usr/local/bin/wget -q "http://dyn.2mydns.com/dyn.asp?username=bla&password=bla&hostname=bla.2mydns.com&myip=$IP" -O /dev/null;

论坛徽章:
1
寅虎
日期:2013-09-29 23:15:15
4 [报告]
发表于 2006-08-01 13:32 |只看该作者
原帖由 leix 于 2006-8-1 11:58 发表
adsl:
!bg /home/bla/ddns.sh > /dev/null


前面空一格或tab试试.

论坛徽章:
0
5 [报告]
发表于 2006-08-01 14:09 |只看该作者
原帖由 congli 于 2006-8-1 13:32 发表


前面空一格或tab试试.



加了个空格,顺利通过,更新DNS成功,太神了点吧?!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP