Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1326889
  • 博文数量: 436
  • 博客积分: 7854
  • 博客等级: 少将
  • 技术积分: 3225
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-18 16:30
文章分类

全部博文(436)

文章存档

2013年(2)

2012年(56)

2011年(70)

2010年(308)

分类:

2010-07-27 16:01:43

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.
阅读(3388) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~