>>> Choose a type of firewall (0-2):
输入 0 ,不使用防火墙当出现
>>> Accept these settings and adjust configuration files (y/n)?
如果输入的信息正ā确,输入 y ,完成配置,否则,输入 n 重新输入。
四、启动PPPOE客户端软件使用命令/usr/sbin/adsl-start 启动PPPOE客户端软件,进行连接,如果成功,将出现Connected;如果不成功,请检查网线、ADSL MODEM等物理设备,并查看 /var/log/messages中的信息/usr/sbin/adsl-stop 关闭和ISP的连接/usr/sbin/adsl-status 查看当前连接的状态如果想在Linux系统启动时自动启动ADSL连接,输入以下命令#chkconfig –add adsl将在当前的运行级下加入ADSL的自启动脚本五、测试当连接成功后,使用命令#ifconfig -a在输出中应含有关于 ppp0 的信息,其中还绑定了IP 地址,说明已经从拨号中获得了IP地址。
使用命令#netstat -nr查看路由表信息,这时的默认路由应该是上面获得的IP地址。
如果没有默认路由,我们可以手动增加:#route add default gw 上面获得的IP地址使用命令#nslookup www.sina.com.cn如果解析出新浪的IP,说明已经从拨号中正确获得了DNS服务器最后,使用命令ping某个域名或IP,如果有响应,表示你已经大功告成了。
注:好像在进行配置的过程中,会提示你是否在启动时加载ADSL,选yes,这样就会省的登录后再start了。
五、使用双网卡带动公司网、家庭网络上网
硬件要求:同上双网卡
NAT方式:接内部网络的网卡设置IP为私有地址(192.168.0.0/24、172.16.0.0/16、10.0.0.0/8),
例如192.168.100.123/24.不要设置默认路由(网关),DNS设置为广州地区(61.144.56.100),其它
地区的相应改动为本地区的DNS. 在/etc/rc.d/目录下用touch命令建立firewall文件,执行chmod u+x firewall以改变文件属性,编辑/etc/rc.d/rc.local文件,在末尾加上/etc/rc.d/firewall以确保开机时能自动运行该脚本。
firewall内容为:#!/bin/sh echo “Enable IP Forwarding…”
echo “1″>/proc/sys/net/ipv4/ip_forward echo ”Starting iptables rules…“
/sbin/modprobe iptable_filter /sbin/modprobe ip_tables /sbin/modprobe iptable_nat #Refresh all chains /sbin/iptables -F -t nat iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o ppp0 -j MMASQUERADE客户端设置(windows98/2000/xp、linux)网关设置为这台linux地址(192.168.100.123),DNS设置为61.144.56.100.
透明代理配置代理软件squid:
编辑/usr/local/squid/etc/squid.conf,修改以下内容,确保以下配置:
http_port 192.168.100.123:8080
cache_mem 48 MB acl all src 0.0.0.0/0.0.0.0 acl manager proto cache_object acl localhost src 127.0.0.1/255.255.255.255 acl SSL_ports port 443 563 acl Safe_ports port 80 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 563 # https, snews acl Safe_ports port 70 # gopher acl Safe_ports port 210 # wais acl Safe_ports port 1025-65535 # unregistered ports acl Safe_ports port 280 # http-mgmt acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemakāer acl Safe_ports port 777 # multiling http acl CONNECT method CONNECT acl flag src 192.168.100.0/255.255.255.0










