让adsl连接建立后自动添加网关,并自动把ip同步到3322.org - fanqiang...
来源:百度文库 编辑:神马文学网 时间:2024/04/28 14:01:24
让adsl连接建立后自动添加网关,并自动把ip同步到3322.org
笔者使用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 interface name used by pppd (e.g. ppp3)
# $2 the tty device name
# $3 the tty device speed
# $4 the local IP address for the interface
# $5 the remote IP address
# $6 the parameter specified by the 'ipparam' option to pppd
#
PATH=/sbin:/usr/sbin:/bin:/usr/bin
export PATH
route 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 restart
ip addr
(多看几次ip,如果ppp0获取了ip地址,则用route查看网关是否已经自动添加)
route
祝您成功!
(http://www.fanqiang.com)
原文链接:http://www.linuxeden.com/forum/showthread.php?t=118764
让adsl连接建立后自动添加网关,并自动把ip同步到3322.org - fanqiang...
如何让ADSL实现开机自动连接
如何让ADSL实现开机自动连接
如何让ADSL实现开机自动连接
如何实现开机自动连接ADSL?
如何实现开机自动连接ADSL?
如何让宽带自动连接?
弄潮轩社区-[图解]让ADSL开机自动拨号并永远在线
ADSL自动拨号连接(不用任何软件)
ADSL自动拨号连接(不用任何软件)
ADSL自动拨号连接、宽带故障错误信息处理大全
ADSL自动拨号连接、宽带故障错误信息处理大全
电脑开机后宽带自动连接设置
电脑开机后自动连接怎么设置
怎么让电脑开机自动连接网络
怎么把宽带连接设置为自动连接
自动为窗体和报表添加代码并设置右键
如何建立宽带连接和设置自动拨号
Up the Sync:自动同步本地文件到Google Docs
让你的ADSL不再自动掉线
利用FreeBSD建立ADSL拨号网关服务器
宽带自动连接网络
如何自动宽带连接
如何自动宽带连接