详解linux RedHat9.0/Fedora4.0下的上网和配置下面我从adsl配置到nat全过程:1)安装rp-pppoe-3.5-2包在安装系统时,对新用户一般选择全部安装的,那就安装了,以后rpm, 或者tarball了,这很方便,对初学者:eg:rpm -ivh rp-pppoe-3.5-2.rpmtarball 安装:tar zxvf rp-pppoe-3.5-2.tar.gzcd rp-pppoe-3.5-2./configuremake make install2)rp-pppoe-3.5-2配置步骤:a) adsl-setup出现:Welcome to the ADSL client setup. First, I will run some checks onyour system to make sure the PPPoE client is installed properly…The following DSL config was found on your system:Device: Name:ppp0Please enter the device if you want to configure the present DSL config(default ppp0) or enter ‘n’ if you want to create a new one://这是我已经安装过了,主要是写文档:选择默认按回车LOGIN NAMEEnter your Login Name (default lanlgn409ldj@zgcnc)://这是我已经安装过了,:没有安装是输入adsl用户名INTERFACEEnter the Ethernet interface connected to the ADSL modemFor Solaris, this is likely to be something like /dev/hme0.For Linux, it will be ethX, where ‘X’ is a number.(default eth0)://选择默认按回车Do you want the link to come up on demand, or stay up continuously?If you want it to come up on demand, enter the idle time in secondsafter which the link should be dropped. If you want the link tostay up permanently, enter ‘no’ (two letters, lower-case.)NOTE: Demand-activated links do not interact well with dynamic IPaddresses. You may have some problems with demand-activated links.Enter the demand value (default no)://选择默认按回车DNSPlease enter the IP address of your ISP’s primary DNS server.If your ISP claims that ‘the server will provide dynamic DNS addresses’,enter ‘server’ (all lower-case) here.If you just press enter, I will assume you know what you aredoing and not modify your DNS setup.Enter the DNS information here:// 输入server自动得到dns,server的ipPASSWORDPlease enter your Password:USERCTRLPlease enter ‘yes’ (two letters, lower-case.) if you want to allownormal user to start or stop DSL connection (default yes)://选择默认按回车问你是否连接Please choose the firewall rules to use. Note that these rules arevery basic. You are strongly encouraged to use a more sophisticatedfirewall setup; however, these will provide basic security. If youare running any servers on your machine, you must choose ‘NONE’ andset up firewalling yourself. Otherwise, the firewall rules will denyaccess to all standard servers like Web, e-mail, ftp, etc. If youare using SSH, the rules will block outgoing SSH connections whichallocate a privileged source port.The firewall choices are:0 – NONE: This script will not set any firewall rules. You are responsiblefor ensuring the security of your machine. You are STRONGLYrecommended to use some kind of firewall rules.1 – STANDALONE: Appropriate for a basic stand-alone web-surfing workstation2 – MASQUERADE: Appropriate for a machine acting as an Internet gatewayfor a LANChoose a type of firewall (0-2)://是否设置firwallDo you want to start this connection at boot time?Please enter no or yes (default no)://启动时是否连接Do you want to start this connection at boot time?Please enter no or yes (default no):** Summary of what you entered **Ethernet Interface: eth0User name: lanlgn409ldj@zgcncActivate-on-demand: NoDNS: Do not adjustFirewalling: NONEUser Control: yesAccept these settings and adjust configuration files (y/n)?//是否写入配置文件里 选择 y

linux RedHat9.0/Fedora4.0下adsl上网和配置全过程


 3)假如你是用别人的mac连接1 RedHat9.0改mac:ifconfig eth0 downifconfig eth0 hw ether 5254ab323d51ifconfig eth0 upifup ppp02 Fedora 4.0改mac:ifdown eth0ifconfig eth0 hw ether 5254ab323d51ifup eth0ifup ppp0 & adsl-start4)测试一下ping www.baidu.com5)做natecho “1” > /proc/sys/net/ipv4/ip_forward //这很重要,路由转发modprobe ip_tablesmodprobe ip_nat_ftpmodprobe ip_nat_ircmodprobe ip_conntrackmodprobe ip_conntrack_ftpmodprobe ip_conntrack_irc/sbin/iptables -F/sbin/iptables -X/sbin/iptables -Z/sbin/iptables -F -t nat/sbin/iptables -X -t nat/sbin/iptables -Z -t nat/sbin/iptables -P INPUT ACCEPT/sbin/iptables -P OUTPUT ACCEPT/sbin/iptables -P FORWARD ACCEPT/sbin/iptables -t nat -P PREROUTING ACCEPT/sbin/iptables -t nat -P POSTROUTING ACCEPT/sbin/iptables -t nat -P OUTPUT ACCEPT/sbin/iptables -t nat -A POSTROUTING -o ppp0 -s 192.168.0.0/24 -j MASQUERADE//不是adsl也可以把ppp0改成eth0 ,1一般网卡nat:[root@test root]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 BOOTPROTO=dhcpBROADCAST=192.168.0.255 IPADDR=192.168.0.1 NETMASK=255.255.255.0 NETWORK=192.168.0.0 ONBOOT=yes [root@test root]# vi /etc/sysconfig/network-scripts/ifcfg-eth0:0 DEVICE=eth0:0 BOOTPROTO=static BROADCAST=192.168..255 IPADDR=192.168.1.2 NETMASK=255.255.255.0 NETWORK=192.168..0 ONBOOT=yes2 两块网卡nat:只是那個 eth0:0 改成了 eth1 而已啦,其它都是一样的设置6)dns 设置在里面/etc/resolv.conf把你的ip写入里面去nameserver 192.168.0.1然后重启要不然,客户机不能上网

  • 暂无相关文章