当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > 建立网络拨号的上网共享

Unix/Linux
linux查看内存的大小
在linux下写的代码,用的是utf-8,结果拿到XP下运行的时候,所有的中文都成乱码
linux su和sudo命令的区别
linux cron 下的定时执行工具使用技巧
linux 查找进程及终止进程操作的相关命令
redhat linux 安装 gcc编译器
Linux Mplayer播放各种格式的电影
一起回顾一下linux常用命令
Linux 网站项目发布要做哪些配置
linux SSH配合SecureCRT的密匙完美使用方法
GD 编译出错解决方法
Facebook Open Platform编译FAQ
Linux 系统硬盘 优化
linux 挂载详解
linux crontab定时命令
Linux 系统中确保访问三级域名畅通的方法
Linux 特权帐号VS普通帐号
确保Linux系统安全的前提条件 漏洞防护
Linux 监视系统资源使用率
Red Hat Linux上使用BIND建立DNS服务器

Unix/Linux 中的 建立网络拨号的上网共享


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 38 ::
收藏到网摘: n/a

RedHat7.3 上建立网络拨号的上网共享
RedHat7.3 上建立网通拨号的上网共享1、 网卡配置。 我这里用的网卡是RTL8029和3com905。在系统中,RTL8029标记为eth0,3com905标记为eth1。RTL8029和3com905的IP地址分别是192.168.0.1、192.168.1.1(其他的地址也可),掩码均为255.255.255.0。 eth0用于连接网通,eth1用于连接内网,局域网网段为192.168.0.0。 注意:此处两块网卡均不能设网关。 2、 PPPoE软件的升级与安装 1) 在 http://www.roaringpenguin.com/pppoe/#download 下载 2) 安装rp-pppoe。以root身份执行 rpm –Uvh rp-pppoe-3.5-1.i386.rpm 3、 修改/etc/ sysctl.conf 将其中的 net.ipv4.ip_forward = 0 改为 net.ipv4.ip_forward = 1 4、 去除ipchains模块,只选择iptables方法如下: 1)setup 2)选择system service 3)去除ipchains 4)选中iptables 5)重启机器 5、 PPPoE客户端配置 在rp-pppoe-3.5-1.i386.rpm安装完毕后,接下来就可进行PPPoE客户端配置了。过程如下。 #/usr/sbin/adsl-setup >>> Enter your PPPoE user name: ——此处输入拨号帐号的用户名 >>> Enter the Ethernet interface connected to the ADSL modem For Solaris, this is likely to be something like /dev/hme0. For Linux, it will be ethn, where n is a number. (default eth0):——输eth0 >>> Enter the demand value (default no): ——输no >>> Enter the DNS information here: ——输210.83.130.18 >>> Please enter your PPPoE password: ——输网通用户口令 >>> Choose a type of firewall (0-2): ——输0 >>> Accept these settings and adjust configuration files (y/n)? ——输y 6、 启动拨号连接 /usr/sbin/adsl-start 成功连接后,屏幕显示Connected。 此时这台linux已可以上网浏览了。 7、 IP伪装 为了使局域网中的其他机器能通过Linux服务器共享上网,至少须执行下面的命令: iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE 完成后,在192.168.0.0网段(网关为192.168.0.1)的PC机就可透过Linux上网了! 8、 开机自启动 为了使Linux服务器能够自动拨号,执行下面步骤。 1)chkconfig --add adsl 2)setup 3)选择system services 4)选中ADSL 5)OK退出 6)打开/etc/rc.d/rc.local,在该文件的末尾添上下面语句 echo "[OK]" echo "Drop ICMP form anywhere" echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all echo "[OK]" iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE 说明:前面四句用于关闭ICMP,防止别人Ping。 9、 至此,一切OK,一个简单的拨号建成了。重启机器后,发现linux的internet共享连接已经一切就绪了,好妙!!! 为了建立更安全的拨号连接,请再设置各种安全机制吧,好事多磨嘛。 另外,如果网关后面的客户机无法通过linux上网,请留意一下linux的防火墙设置..