⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 linux 下的 ppp over ethernet + ip masquerade 共享(转).txt

📁 LINUX下的安装声卡等操作和技巧介绍
💻 TXT
字号:
作者:SunADM
日期:00-6-21 下午 10:16:38
发信人: jarry (jarry), 信区: ADSL
标  题: Linux 下的 PPP Over ethernet + IP Masquerade 共享
发信站: BBS 一网情深站 (Sun Jan  9 06:15:32 2000), 转信

WinPPPOET 在 NT 下面真的是太不稳定了。HAdA
MS proxy 的 Winsock Proxy client 当然只能在 Windows 下面用..
HOoOoO 搞得我的 Linux 都上不了网。
废话少讲啦..... M$ 的牢骚也不发了。

OK

你先要有一台装了 Linux 的 Server (我用我的 Sony notebook 做 Server)
下载 Linux Kernel 2.2.13 (Stable from ftp://ftp.openunix.org/pub/linux/kernel)
那里只有 bzip2 压缩格式的 Kernel .

下载了之后
#bzip -d kernel-2.2.13.tar.bz2
#tar -xvf kernel-2.2.13.tar

再下载 http://www.davin.ottawa.on.ca/pppoe/pppoed0.42.tgz
然后 #tar -zxvf pppoed0.42.tgz

注意:把上面两个解压到 /usr/src 里比较好点。

然后patch kernel
cd /usr/src/linux
cat /usr/src/pppoed-0.42/2213-pppox | patch -b -p1

make menuconfig

加入支持 IP masquerade (不会的话自己看IP masquerade HOWTO)
先 make kernel

make
make modules
make modules_install
make install

OK Kernel make 好了。

cd /usr/src/pppoed-0.42
make realclean
make dev
make depend
make
make install

cd /etc/ppp

设置 ppp


---- /etc/ppp/options --------------------
lock
local
nocrtscts
noauth
#be careful with mtu/mru if you are masquareding.
# Look at Kal Lin's page at http://www.cs.toronto.edu/~kal/hse/resource.html
mru 1490
mtu 1490
#please make sure you have noaccomp for now
noaccomp
#the construct below is needed by sympatico
name "userid@sympatico.ca"
#you might want to change defaultroute if you have more
#than one pppoe session
defaultroute
hide-password
sync
#it might be a good idea to uncoment the debug below
#debug
#kdebug 7
#if you use the -R option to make it persistent
#then uncomment the next two lines below
#lcp-echo-interval 240
#lcp-echo-failure 3
#nodetach
------ END /etc/ppp/options ------------

---- start /etc/ppp/pap-secrets --------------------
# Secrets for authentication using PAP
# client        server  secret                  IP addresses
szjarry@169b.gd * my_passwrod
---- END /etc/ppp/pap-secrets --------------------

设置好了就重新启动 (如果你要用 IP masquerade 就要设置好,以后设置也可)

启动之后以root的身份进入

/usr/sbin/pppoed

如果设置正常,几秒钟之后你的 ppp0 就OK了。

如果你不能连上,请 tail /usr/var/messages
看看里面的错误,以中国电信(GD)的 ADSL PPPOE 的问题。
大多错误还是 User ready used 错误,如果是这样,请关掉 modem.
等几分钟再试。

如果可以连上,怎样设置 IP masquerade 就是你自己看HOWTO了。
xixi
如果你是Linux新手我只提示一下 ipchains 的问题。
还有 /etc/sysconfig/network 文件里的FORWARD_IPV4 应该为 true
FORWARD_IPV4=true

还有在 /etc/rc.d/rc.local 里把  IP masquerade 的 modules 在启动的时候加载入。

# modules 载入
/sbin/depmod -a
/sbin/modprobe ip_masq_ftp
/sbin/modprobe ip_masq_raudio
/sbin/modprobe ip_masq_irc
/sbin/modprobe ip_masq_quake
/sbin/modprobe ip_masq_mfw
/sbin/modprobe ip_masq_user
/sbin/modprobe ip_masq_portfw
/sbin/modprobe ip_cuseeme
/sbin/modprobe ip_masq_vdolive
/sbin/modprobe ipip

# enable ip forward 功能
echo "1" > /proc/sys/net/ipv4/ip_forwarding

# ipchains 防火墙的 rules,假想我的内部IP 为 192.168.1.0 - 255
ipchains -P forward DENY
ipchains -A forward -s 192.168.1.0/255.255.255.0 -j MASQ



###############大功告成,亲个嘴儿#############
OK 现在是设置的你的 win$$$dows 机器如何通过 ip masquerade 上网。

点:开始>设置>控制面板>网络>TCP/IP - ethernet 网卡

设置 IP 为 192.168.1.xxx netmask 为 255.255.255.0
要设置DNS 可以设置为 172.21.95.2

重要:网关必需设置成你的 linux Server 的 IP (有 adsl + pppoed 那部)

重启window$: 连接一个网站试试。行了吧。

###############大功告成,亲个嘴儿#############

有问题吗? email 给我:
jarry@szonline.net (NO Spam please)
或 icq: 2922888
oicq: 10203
电话? NONO 不能说..

my homepage: http://202.103.190.31


(C)opyright BY Jarry.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -