【整理】solaris pppoe 拨号上网共享和动态ip与域名绑定
发表于:2007-06-09来源:作者:点击数:
标签:
一、SolarisDNS客户端设置 1.#vi/etc/resolv.conf ##xxx.xxx.xxx.xxx为你isp的dns nameserverxxx.xxx.xxx.xxx 2.#vi/etc/nsswitch.conf 修改hosts:files为hosts:filesdns 3.reboot 二、PPPOE配置: 1.首先请确定你已经安装了下列软件,如果您的系统版本低于So
一、Solaris DNS客户端设置
1. # vi /etc/resolv.conf
## xxx.xxx.xxx.xxx 为你isp的dns
nameserver xxx.xxx.xxx.xxx
2. # vi /etc/nsswitch.conf
修改hosts: files 为 hosts: files dns
3. reboot
二、PPPOE配置:
1.首先请确定你已经安装了下列软件,如果您的系统版本低于 Solaris 8 10/01你还没有装上:
SUNWpppd - Solaris PPP Device Drivers
SUNWpppdr - Solaris PPP configuration files
SUNWpppdt - Solaris PPP Tunneling
SUNWpppdu - Solaris PPP daemon and utilities
SUNWpppdx - Solaris PPP 64-bit (ONLY needed for SPARC's with 64-bit kernels)
请执行下面简单的命令确认:
# ls /dev | grep ppp
sppp
sppptun
# grep sppp /etc/name_to_major
sppp 146
sppptun 147
2. 基本信息
拨号用户
.netstorm
密 码:password
# ifconfig -a 取得网卡接口 我的为 rtls0 (Realtek8139网卡)
3. 下面是主要使用到的程序,具体怎么用我还不清楚呢!
/usr/lib/inet/pppoed
/usr/sbin/sppptun
/usr/bin/pppd
4. # touch /etc/ppp/pppoe.if (不知道什么用)
5. 创建一个 连接isp的配置文件 /etc/ppp/peers/hzcnc 内容如下:
###################### /etc/ppp/peers/hzcnc ######################
sppptun # what device to use
plugin pppoe.so # initialize the
connect "/usr/lib/inet/pppoec rtls0" #注意这里和pppd带的模板文件中不同
persist # if the connection dies, bring it back up
user "zhangfan" # username
noauth # Do not make the other side authenticate itself
noipdefault # Let them give you what IP they w
ant to give you
# 如果你知道下面命令的意思,请不吝补充
no
clearcase/" target="_blank" >ccp # No compression
novj # No compression
noaccomp # No compression
nopcomp # No compression
defaultroute # add an appropriate default route
####################################################################
6. 设定你的 用户验证文件。
我的连接是网通的,所以我用/etc/ppp/pap-secrets,按照前面的例子,
我设定她的内容为:
################ /etc/ppp/pap-secrets #####################
#user isp password
netstorm*password
###########################################################
注意: netstorm,*,password之间使用了 [TAB] 而不是空格
如果你的isp需要相应设定 /etc/ppp/chat-secrets 请自己搞定。
7. 创建拨号Shell文件
# vi /etc/ppp/hzcnc.sh
#!/usr/bin/sh
/usr/sbin/sppptun plumb pppoed rtls0
/usr/sbin/sppptun plumb pppoe rtls0
/usr/bin/pppd call hzcnc
#chmod a+x /etc/ppp/hzcnc.sh
8. 每次开机自动拨号
# vi /etc/rc2.d/S65CallHzcnc
/etc/ppp/hzcnc.sh
9. 拨号
测试 #/etc/ppp/hzcnc.sh
#ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
rtls0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 192.168.0.119 netmask ffffff00 broadcast 192.168.0.255
ether 0:50:56:40:0:53
sppp0: flags=10008d1<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST,IPv4> mtu 1492 index 3
inet 218.108.204.62 --> 210.83.128.121 netmask ffffff00
ether 0:0:0:0:0:0
# ping 202.96.96.68
202.96.96.68 is alive
# ping www.spy-movie.com (此步如果不正常,证明你的dns没有设置好)
www.spy-movie.com is alive
二、IP Filter安装配置(IP转发,使局域网内客户机能通过Solaris主机上网)
1.
网络环境:
Solaris主机IP: 192.168.62.1
所在子网: 192.168.62.0/24
2. IP Filter 3.4.29
下载:
http://coombs.anu.edu.au/~avalon/
3. IP Filter 安装:
# gunzip ip-fil3.4.29.tar.gz
# tar xvf ip-fil3.4.29.tar
# cd ip-fil3.4.29
# make solaris(据说不能用GNU make,我用的/usr/ccs/bin/make,下同)
# cd SunOS5
# make package(会提示安装,确定以后会自动安装完毕)
4. IP Filter 配置:
# vi /etc/opt/ipf/ipnat.conf
#加入以下规则
map sppp0 192.168.62.0/24 -> 0/32 proxy port ftp ftp/tcp
map sppp0 192.168.62.0/24 -> 0/32 portmap tcp/udp auto
map sppp0 192.168.62.0/24 -> 0/32
(系统每次重起都会启动ipf)
5. 允许IP转发
# ndd -get /dev/tcp ip_forwarding
0
如果以上结果为1,证明系统已经允许ip转发,你不要任何设置
如果为0 则:
# touch /etc/gateways (这样系统每次启动,# ndd -get /dev/tcp ip_forwarding 结果都为1)
6. reboot
四、Windows客户端配置
默认网关: 192.168.62.1 (Solaris主机ip)
首选DNS : 210.83.130.18 (ISP DNS,最好与 Solaris中/etc/resolv.conf的 DNS一样)
设置完后,ie,qq,msn,ftp 等 应该都可以用了
五、动态ip与域名的绑定( ddclient)
1. 从这里下载ddclient软件 http://burry.ca:4141/ddclient/
2. ddclient 支持 的动态域名服务:
DynDNS.org - See http://members.dyndns.org for details on obtaining a free account.
Hammernode - See http://www.hn.org for details on obtaining a free account.
Zoneedit - See http://www.zoneedit.com for details.
EasyDNS - See http://www.easydns.com for details.
3. 要求:
- 至少要有以下动态域名服务的一个帐号:
DynDNS.org - See http://members.dyndns.org for details on obtaining a free account.
Hammernode - See http://www.hn.org for details on obtaining a free account.
Zoneedit - See http://www.zoneedit.com for details.
EasyDNS - See http://www.easydns.com for details.
- Perl 5.004 以上版本(Solaris8 1001版不用另行安装)
-
Linux/
Unix 系统
3. ddclient 安装:
#gunzip ddclient-3.6.2.tar.gz
#tar xvf ddclient-3.6.2.tar
#cd ddclient-3.6.2
#cp ddclient /usr/sbin/
#cp sample-etc_ddclient.conf /etc/ddclient.conf
如果你用的是ppp拨号, 每次拨号自动更新
#cp sample-etc_ppp_ip-up.local /etc/ppp/ip-up.local
4. ddclient 配置
# vi /etc/ddclient.conf
daemon=300 # check every 300 seconds
syslog=yes # log update msgs to syslog
mail=root # mail update msgs to root
pid=/var/run/ddclient.pid # record PID in file.
use=if, if=sppp0 #ifconfig -a 取得网络接口
# 我的动态域名服务是dyndns.org
protocol=dyndns2
server=members.dyndns.org
login=netstorm826 #dyndns.org的用户
password=mypass #dyndns.org的密码
server=members.dyndns.org, \
protocol=dyndns2 \
ftp2.homeftp.net #你在dyndns.org的域名
#其它域名服务请参看ddclient 的sample
5. 每次启动也让ddclient自动启动
把/usr/sbin/ddcient 加到/etc/rc2.d/ 目录的某个文件中即可
Ok, 现在你就可以用域名ftp2.homeftp.net 远程登陆你的solaris 了
如果有什么错误,请大家指出来
yjmyb 回复于:2002-10-15 11:14:10
|
支持!!!
|
sunmarmot 回复于:2002-10-15 11:56:17
|
好人啊!终于有人整理了
|
yjmyb 回复于:2002-10-16 22:16:10
|
netstorm兄,你辛苦了!!!
|
jerry206 回复于:2002-10-17 01:43:23
|
这样的话. 我的系统终于可以上网了. 多谢了netstorm
|
南非蜘蛛 回复于:2002-10-17 02:46:38
|
怎么确认系统已经识别了拨号适配器这个设备????
|
netstorm 回复于:2002-10-17 08:39:16
|
我的ISP是网通的,拨号器就是网卡 rtls0 电信ADSL的话我就不清楚了
|
lynx2002 回复于:2002-10-17 09:09:57
|
如果是用adsl modem上网,可以选用内置pppoe的modem,这样就只需把主机的ip设在modem同一网段就可以了。
|
wtusm 回复于:2002-10-18 22:15:04
|
不错不错,值得大家学习啊
|
科学球 回复于:2002-10-19 11:30:18
|
虽然照着配好了,也都能用了。可是用SUN的机器上网特别慢,WHY?
|
kknirvana 回复于:2002-10-20 22:52:44
|
我的计算机没有网卡,只有个56K,全向MODEM,我按照上面的步骤做,但那个“sppptun”根本没有,我已经把能装的程序都装了,还是没有,请指点,谢谢。
|
韦小宝 回复于:2002-10-21 00:21:16
|
[quote][b]下面引用由[u]南非蜘蛛[/u]在 [i]2002/10/17 02:46am[/i] 发表的内容:[/b] 怎么确认系统已经识别了拨号适配器这个设备???? [/quote] ifconfig -a 我用它做代理一点都不慢,达到isp给我带宽的极限
|
科学球 回复于:2002-10-21 16:15:39
|
今天又配了一次,发现在/etc/ppp/peers/hzcnc中,少了2个环境啊!!! remotename myisp updetach 这两个环境没有,就不能拨通
|
netstorm 回复于:2002-10-21 16:34:59
|
我的用起来没问题啊, 速度也蛮快的,
|
sunnycn 回复于:2002-10-21 16:45:12
|
经典!好! 你辛苦了! 谢谢!
|
flyingboy 回复于:2002-10-22 07:48:08
|
辛苦!
|
pxlh 回复于:2002-10-31 16:10:24
|
我按你说的做了还是不能上网: #/etc/ppp/hzcnc.sh rtls0:pppoed rtls0 pppoe using interface sppp0 connect sppp0<-->/dev/sppptun lcd RCVD Code reject for identification id 173 lcd RCVD Code reject for identification id 174 Lcp terminated by peer connection terminated
|
原文转自:http://www.ltesting.net