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
#
 
-----------------------------
man pppd
参考pppd的man-page里的SCRIPTS一节,摘录如下:
SCRIPTS
Pppd invokes scripts at various stages in its processing which can be
used to perform site-specific ancillary processing. These scripts are
usually shell scripts, but could be executable code files instead.
Pppd does not wait for the scripts to finish. The scripts are exe-
cuted as root (with the real and effective user-id set to 0), so that
they can do things such as update routing tables or run privileged
daemons. Be careful that the contents of these scripts do not compro-
mise your system’s security. Pppd runs the scripts with standard
input, output and error redirected to /dev/null, and with an environ-
ment that is empty except for some environment variables that give
information about the link. The environment variables that pppd sets
are:

DEVICE The name of the serial tty device being used.

IFNAME The name of the network interface being used.

IPLOCAL
The IP address for the local end of the link. This is only set
when IPCP has come up.

IPREMOTE
The IP address for the remote end of the link. This is only
set when IPCP has come up.

PEERNAME
The authenticated name of the peer. This is only set if the
peer authenticates itself.

SPEED The baud rate of the tty device.

ORIG_UID
The real user-id of the user who invoked pppd.

PPPLOGNAME
The username of the real user-id that invoked pppd. This is
always set.

For the ip-down and auth-down scripts, pppd also sets the following
variables giving statistics for the connection:

CONNECT_TIME
The number of seconds from when the PPP negotiation started
until the connection was terminated.

BYTES_SENT
The number of bytes sent (at the level of the serial port) dur-
ing the connection.

BYTES_RCVD
The number of bytes received (at the level of the serial port)
during the connection.

LINKNAME
The logical name of the link, set with the linkname option.

DNS1 If the peer supplies DNS server addresses, this variable is set
to the first DNS server address supplied.

DNS2 If the peer supplies DNS server addresses, this variable is set
to the second DNS server address supplied.

Pppd invokes the following scripts, if they exist. It is not an error
if they don’t exist.

 

ip-up脚本参数的更多相关文章

  1. python注释、脚本参数、字节码

    python注释.脚本参数.字节码 --道心 python安装 1.下载安装包 https://www.python.org/downloads/ 2.安装 默认安装路径:C:\python27 3. ...

  2. linux下TCP/IP及内核参数优化调优(转)

    Linux下TCP/IP及内核参数优化有多种方式,参数配置得当可以大大提高系统的性能,也可以根据特定场景进行专门的优化,如TIME_WAIT过高,DDOS攻击等等. 如下配置是写在sysctl.con ...

  3. Linux内核 TCP/IP、Socket参数调优

    Linux内核 TCP/IP.Socket参数调优 2014-06-06  Harrison....   阅 9611  转 165 转藏到我的图书馆   微信分享:   Doc1: /proc/sy ...

  4. jquery 、 JS 脚本参数的认识与使用

    jquery . JS 脚本参数的认识与使用 如何使用jquery刷新当前页面 下面介绍全页面刷新方法:有时候可能会用到 window.location.reload(); //刷新当前页面. par ...

  5. 对于shell脚本参数获取时的一点小技巧

    问题如下: 根据脚本参数的个数$#进行一个循环,在依次输出每个参数$1 $2 $3...... 我有一个循环变量i $i 取到这时的i为1,我想使用这个1再去调用$1,也是就是打印出第一个参数 就是$ ...

  6. TCP/IP及内核参数优化调优

    Linux下TCP/IP及内核参数优化有多种方式,参数配置得当可以大大提高系统的性能,也可以根据特定场景进行专门的优化,如TIME_WAIT过高,DDOS攻击等等.如下配置是写在sysctl.conf ...

  7. Linux下批量ping某个网段ip的脚本

    比如现在需要对172.16.50.0/24网段的ip进行检查,检查哪些ip现在被占用,哪些ip没有被占用,可以通过ping命令来检查,脚本如下: [root@uatdns01 opt]# vim /o ...

  8. shell脚本参数中有空格

    shell脚本参数中有空格 在shell脚本中如果有空格的处理如下: sh test.sh "hello word" echo $1 得到的是hello,而不是hello word ...

  9. Linux TCP/IP调优参数 /proc/sys/net/目录

    所有的TCP/IP调优参数都位于/proc/sys/net/目录. 例如, 下面是最重要的一些调优参数,后面是它们的含义: /proc/sys/net/core/rmem_default " ...

  10. 写了个爬虫代理ip的脚本给大家使用

    写了个爬虫代理ip的脚本给大家使用 一.代码 import requests from lxml.html import etree url = 'http://www.kuaidaili.com/f ...

随机推荐

  1. vue better-scroll 下拉上拉,加载刷新

    _initScroll(){             this.$nextTick(() => {                 if (!this.scroll) {             ...

  2. php相关操作

    array_unshift : 数组头部追加 用法如下: $arr = ['demo','dmoa']; array_unshift($arr,'demob'); //在$arr的前面追加demob ...

  3. thinkphp 前置和后置操作

    前置和后置操作指的是在执行某个操作方法之前和之后会自动调用的方法,不过仅对访问控制器有效. 其他的分层控制器层和内部调用控制器的情况下前置和后置操作是无效的. 系统会检测当前操作是否具有前置和后置操作 ...

  4. SpringBoot_04_SpringBoot对ssm的整合

    1.在SpringBoot框架下对ssm进行整合 2.搭建一个web的SpringBoot框架 2.1添加pom.xml坐标(需要加上SpringBoot对jsp的支持,和对资源文件位置的说明) &l ...

  5. Linux课程---15、域名相关

    Linux课程---15.域名相关 一.总结 一句话总结: 先购买域名,再备案,再解析,域名即可使用 1.域名备案是怎么回事(比如二级域名,三级域名)? 每个二级域名需要备案一次,三级域名不需要备案, ...

  6. error C2054:在“inline”之后应输入“(”

    转自VC错误:http://www.vcerror.com/?p=79 问题描述: error C2054:在"inline"之后应输入"(" 按照编译错误的提 ...

  7. x-杂项-maven-repository-lombok:lombok

    ylbtech-杂项-maven-repository-lombok:lombok Project Lombok是一个java库,可以自动插入编辑器并构建工具,为您的java增添色彩.永远不要再写另一 ...

  8. UNIT对话系统(杂记)

    单轮对话指标: 召回率=机器人能回答的问题数/问题总数 准确率=机器人正确回答的问题数/问题总数 问题解决率=机器成功解决的问题数/问题总数 多轮对话指标: 任务完成率=成功结束的多轮会话数/多轮会话 ...

  9. python基础语法(运算符及优先级)

    python基础语法(运算符及优先级) python语言支持的运算符类型 算数运算符 假设变量a为10,变量b为21 算数符 描述 实例 + 加-两个对象相加 a+b结果31 - 减-得到一个负数或者 ...

  10. webservice、httpClient、dubbo的区别

    在开发中,对于同一个war包中的对象方法我们可以直接调用,但是很多情况下需要在不同项目或者不同服务器进行相互调用 webservice webservice技术可以实现不同服务器项目直接的调用和交换数 ...