设为首页收藏本站

美丽的网站-英华家电维修论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 659|回复: 0
打印 上一主题 下一主题

让adsl连接建立后自动添加网关,并自动把ip同步到3322.org

[复制链接]
跳转到指定楼层
楼主
发表于 2011-3-28 11:48:10 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
笔者使用rp-pppoe软件拨号上网,但每次重启之后都要手动添加网关,手动同步动态ip到3322,尤为不爽。本文先容如何在pppoe连接建立之后自动添加网关。pppoe连接建立后,系统自动调用/etc/ppp/ip-up脚本。其参数如下面文件所示,第4个参数是系统获得的动态ip。#!/bin/bash## Script which handles the routing issues as necessary for pppd# Only the link to Newman requires this handling.## When the ppp link comes up, this script is called with the following# parameters# $1 the inte***ce name used by pppd (e.g. ppp3)# $2 the tty device name# $3 the tty device speed# $4 the local IP address for the inte***ce# $5 the remote IP address# $6 the parameter specified by the 'ipparam' option to pppd#PATH=/sbin:/usr/sbin:/bin:/usr/binexport PATHroute add default gw $4#下面这一行是使用3322.org的动态域名,如没有使用,可以不加。/usr/local/bin/ez-ipupdate -c /usr/local/ezip/qdns.conf把以上内容存为/etc/ppp/ip-up.local并chmod 755 /etc/ppp/ip-up.local,使之有执行权限。由于ip-up会自动找ip-up.local执行,所以不用修改ip-up文件。最后执行:service network restartip addr(多看几次ip,假如ppp0获取了ip地址,则用route查看网关是否已经自动添加)route祝您成功!
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 分享分享 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|手机版|粤ICP备13038386号|粤ICP备13038386号|美丽的网站-英华家电维修论坛 ( 粤ICP备13038386号 )     站长邮箱 505966338@qq.com

GMT+8, 2025-5-2 17:10 , Processed in 0.144561 second(s), 22 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表