免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 6936 | 回复: 17
打印 上一主题 下一主题

【整理】solaris pppoe 拨号上网共享和动态ip与域名绑定 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2002-10-14 22:09 |只看该作者 |倒序浏览
一、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 want to give you
      # 如果你知道下面命令的意思,请不吝补充
      noccp                   # 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 了
如果有什么错误,请大家指出来

论坛徽章:
0
2 [报告]
发表于 2002-10-15 11:14 |只看该作者

【整理】solaris pppoe 拨号上网共享和动态ip与域名绑定

支持!!!

论坛徽章:
0
3 [报告]
发表于 2002-10-15 11:56 |只看该作者

【整理】solaris pppoe 拨号上网共享和动态ip与域名绑定

好人啊!终于有人整理了

论坛徽章:
0
4 [报告]
发表于 2002-10-16 22:16 |只看该作者

【整理】solaris pppoe 拨号上网共享和动态ip与域名绑定

netstorm兄,你辛苦了!!!

论坛徽章:
0
5 [报告]
发表于 2002-10-17 01:43 |只看该作者

【整理】solaris pppoe 拨号上网共享和动态ip与域名绑定

这样的话. 我的系统终于可以上网了. 多谢了netstorm

论坛徽章:
0
6 [报告]
发表于 2002-10-17 02:46 |只看该作者

【整理】solaris pppoe 拨号上网共享和动态ip与域名绑定

怎么确认系统已经识别了拨号适配器这个设备????

论坛徽章:
0
7 [报告]
发表于 2002-10-17 08:39 |只看该作者

【整理】solaris pppoe 拨号上网共享和动态ip与域名绑定

我的ISP是网通的,拨号器就是网卡 rtls0
电信ADSL的话我就不清楚了

论坛徽章:
0
8 [报告]
发表于 2002-10-17 09:09 |只看该作者

【整理】solaris pppoe 拨号上网共享和动态ip与域名绑定

如果是用adsl modem上网,可以选用内置pppoe的modem,这样就只需把主机的ip设在modem同一网段就可以了。

论坛徽章:
0
9 [报告]
发表于 2002-10-18 22:15 |只看该作者

【整理】solaris pppoe 拨号上网共享和动态ip与域名绑定

不错不错,值得大家学习啊

论坛徽章:
0
10 [报告]
发表于 2002-10-19 11:30 |只看该作者

【整理】solaris pppoe 拨号上网共享和动态ip与域名绑定

虽然照着配好了,也都能用了。可是用SUN的机器上网特别慢,WHY?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP