45IT.COM- 电脑学习从此开始!
DIY硬件教程攒机经验装机配置
设计Photoshop网页设计特效
系统注册表DOS系统命令其它
存储主板显卡外设键鼠内存
维修显卡CPU内存打印机
WinXPVistaWin7unix/linux
CPU光驱电源/散热显示器其它
修技主板硬盘键鼠显示器光驱
办公ExcelWordPowerPointWPS
编程数据库CSS脚本PHP
网络局域网QQ服务器
软件网络系统图像安全

Linux下adsl拔号与共享上网(2)

电脑软硬件应用网 45IT.COM 时间:2007-06-25 09:14 作者:网络转载

The firewall choices are:
0 - NONE: This script will not set any firewall rules.  You are responsible
          for ensuring the security of your machine.  You are STRONGLY
          recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
                for a LAN
Choose a type of firewall (0-2):
Please enter a number from 0 to 2
The firewall choices are:
0 - NONE: This script will not set any firewall rules.  You are responsible
          for ensuring the security of your machine.  You are STRONGLY
          recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
                for a LAN
Choose a type of firewall (0-2): 0

Start this connection at boot time

Do you want to start this connection at boot time?
Please enter no or yes (default no):

** Summary of what you entered **

Ethernet Interface: eth0
User name:          xyn0699647
Activate-on-demand: No
DNS:                Do not adjust
Firewalling:        NONE
User Control:       yes
Accept these settings and adjust configuration files (y/n)? y
Adjusting /etc/sysconfig/network-scripts/ifcfg-ppp0
Adjusting /etc/ppp/chap-secrets and /etc/ppp/pap-secrets
  (But first backing it up to /etc/ppp/chap-secrets.bak)
  (But first backing it up to /etc/ppp/pap-secrets.bak)

Congratulations, it should be all set up!

Type '/sbin/ifup ppp0' to bring up your xDSL link and '/sbin/ifdown ppp0'
to bring it down.
Type '/sbin/adsl-status /etc/sysconfig/network-scripts/ifcfg-ppp0'
to see the link status.
1.3拔号连接与断开
    输入 '/sbin/ifup ppp0' 进行拔号连接戓'/sbin/ifdown ppp0'断开拔号连接。
    至此,如果一切正常,你就可以正常网上冲浪!
2、共享上网
    通过上面的设置,你只能自己上网,要想其它电脑共享linux的连接上网,需要作如下的设置。

LINUX网络设置:
内网IP:192.168.0.1
子网掩码:255.255.255.0
网关:192.168.0.1
DNS:根据各地的网络服务商不同,云南昆明的是 202.98.160.68

注:要使设置生效,请先停止网卡,然后再激活。

其它的机器的设置只要保证与linux机器在一个网段并且网关设置为192.168.0.1就可以了,如:
192.168.0.2
255.255.255.0
192.168.0.1
DNS和主机一样。

用你喜欢的编辑器(如vi,gedit等)打开LINUX主机的/etc/rc.d/rc.local
在最后补上如下内容:
echo "1" > /proc/sys/net/ipv4/ip_forward
/sbin/ modprobe ip_nat_ftp
/sbin/ modprobe ip_conntrack
/sbin/ modprobe ip_conntrack_ftp
/sbin/ modprobe ip_conntrack_irc
/sbin/iptables -t nat -A POSTROUTING -o ppp0 -s 192.168.0.1/24 -j MASQUERADE

运行一下rc.local
    /etc/rc.d/rc.local
重新拔号,这样linux下的共享连接就设置OK了!

顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
无法在这个位置找到: baidushare.htm
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
验证码:点击我更换图片
推荐知识