|
|
|
|
| 电脑有一个eth0口,还有一个PPP拔号的端口,向大家请教一个问题 |
 电脑有一个eth0口,还有一个PPP拔号的端口,向大家请教一个问题 - chenkuizhong [ 2007-10-31 15:19 | 1,053 byte(s)]
 Re: 电脑有一个eth0口,还有一个PPP拔号的端口,向大家请教一个问题 - arnina [ 2007-12-26 22:41 | 460 byte(s)]
 Re: 电脑有一个eth0口,还有一个PPP拔号的端口,向大家请教一个问题 - xfzhu2008 [ 2008-01-06 21:23 | 1,686 byte(s)]
 Re: 电脑有一个eth0口,还有一个PPP拔号的端口,向大家请教一个问题 - knight_oliver [ 2007-11-29 15:17 | 327 byte(s)]
|
|
|
|
[Original]
[Print]
[Top]
|
一、
LINUX下PPP拔号,最后
local IP address : 10.95.178.121
remote IP address: 192.168.111.111
这个remote IP是什么意思?
二、为什么PPP登陆上去后,默认的网关不会改变?
三、拔号以后,我查看了一下PPP0的属性
inet addr:10.95.178.121 p-1-p:192.168.111.111 Mask:255.255.255.255
为什么 Mask是255.255.255.255啊?
我觉得应该是10.95.0.0
四、我的电脑上还有一个以太网接口eth0,IP是192.168.2.57
我想让eth0收到的数据包从ppp0转发出去,也就是想把LINUX配置在路由功能
我是这样做的:
添加以太网端口的路由规则 :# route add -net 192.168.2.0 netmask 255.255.255.0
添加PPP端口的路由规则:# route add -net 10.×.×.× netmask 255.255.255.0(这一条我就不会写了)
增加系统的IP转发功能:echo 1 > /proc/sys/net/ipv4/ip_forward
接下来是不是要添加默认路由?我是默认从PPP0发送,这一句应该怎么写呢?
谢谢大侠!
|
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
一、 可以看看点对点的链接。
二、我这边登录后默认网关好像会变得啊,他会多一条从ppp0出去的默认路由。
三、还是要看看点对点连接的含义。
四、Iptables 指南1.1.19,自己感觉比iptables howto 写得好。http://man.ddvip.com/net/iptables-tutorial-cn/iptables-tutorial-cn-1.1.19.html
|
|
|
----
读书不求甚解,快而已。 读一遍明白一个问题,足已。
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
一:local ip address 是服务器为你分配的ip地址
remote ip address 是服务器为自己分配的ip地址,其实就是服务器的ip地址
二:
linux的网关需要自己手动添加,谁叫用的是linux呢?
三:
点对点没有子网掩码的概念,255.255.255.255没有起作用,就算你把它改成别的值也没有影响
四:
这样有何意义?
可以这样试试:
route add default gw 192.168.111.111 dev ppp0
|
|
|
----
"my darling ,you are wonderful tonight"
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
我以前写过一个帖子,应该有用
让adsl连接建立后自动添加网关,并自动把ip同步到3322.org
作者:xfzhu2008@yahoo.com 来源:Linuxeden (2005-03-21 13:27:25)
笔者使用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
祝您成功!
|
|
|
[Original]
[Print]
[Top]
|
|
|