当前位置: 技术问答>linux和unix
请问我的redhat-Linux9如何上宽带
来源: 互联网 发布时间:2015-06-18
本文导语: 谢谢 | 转安装ADSL: 硬件、软件都装好了,下面开始具体配置。(加了#提示符号表示输入命令) 1、用ifconfig看看网络配置 [root@localhost /root]#ifconfig lo Link encap:Local Loopback inet...
谢谢
|
转安装ADSL:
硬件、软件都装好了,下面开始具体配置。(加了#提示符号表示输入命令)
1、用ifconfig看看网络配置
[root@localhost /root]#ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:23 errors:0 dropped:0 overruns:0 frame:0
TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
只有lo没找到网卡。不急,自己配。我是DLINK的DE220 IRQ=3 IO=300,兼容NE2000。在/etc/conf.modules 加两句。
具体如下:
[root@localhost /root]#cd /etc
[root@localhost /root]#vi conf.modules
alias eth0 ne
options eth0 io=0x300 irq=3
IO和IRQ可以根据你自己的网卡设置
如果不能插入就按INSERT,加完就按ESC。再按: ,再输入w 存盘,再q 退出。如果不放心就 #more conf.modules 看看写进去没有。
一般市面上ISA的便宜网卡都兼容NE2000。如果是新手在LINUX下安装网卡的可能会遇到这样那样的问题,多在网上找找看看,一般都能解决。要提醒大家最好别用PNP即插即用模式,在LINUX出了问题不好解决,简直是场噩梦。
2、下面配置网卡IP地址, 在/etc/sysconfig/network-scripts下有个文件
ifcfg-eth0 写成如下:
DEVICE=eth0
IPADDR=192.168.0.254
这是网卡的IP地址,以后客户机的网关就是这个地址。
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
ONBOOT=yes
BOOTPROTO=none
重起就能找到网卡。
我们再[root@localhost /root]#ifconfig
eth0 Link encap:Ethernet HWaddr 00:40:05:64:11:28
inet addr:192.168.0.254 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:347573 errors:0 dropped:0 overruns:0 frame:0
TX packets:40194 errors:0 dropped:0 overruns:0 carrier:0
collisions:35 txqueuelen:100
Interrupt:3 Base address:0x300
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:23 errors:0 dropped:0 overruns:0 frame:0
TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
哈哈,eth0找到网卡了,配置也正确,恭喜恭喜!进行下一步。
3、下一步做ADSL的驱动。去http://www.roaringpenguin.com/pppoe/rp-pppoe-2.6.tar.gz 下个驱动程序先,大概85K大小。 考到/root去。
然后 #tar xvfz rp-pppoe-2.6.tar.gz
#cd rp-pppoe-2.6
#./go
开始安装,装好就#make一下下,开始配置ADSL。
Welcome to the Roaring Penguin ADSL client setup. First, I will run some checks on your system to make sure the PPPoE client is installed properly... Looks good! Now, please enter some information:
USER NAME
> > > Enter your PPPoE user name (default):
这里输入在电信局申请的adsl的帐号
INTERFACE
> > > 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就可以了
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 seconds after which the link should be dropped. If you want the link to stay up permanently, enter 'no' (two letters, lower-case.)
NOTE: Demand-activated links do not interact well with dynamic IP addresses. You may have some problems with demand-activated links.
> > > Enter the demand value (default no):
用缺省的no就可以了。
Please enter the IP address of your ISP's primary DNS server. If your ISP claims that 'the server will provide DNS addresses', enter 'server' (all lower-case) here. If you just press enter, I will assume you know what you are doing and not modify your DNS setup.
> > > Enter the DNS information here:
这里填你ISP的DNS地址,成都用61.139.2.69,辅助DNS成都可用202.98.127.32
PASSWORD
> > > Please enter your PPPoE password:
ADSL拨号密码这个东东。
搞定!爽爽,用#adsl-start 就可以开始拨号。如果连接成功系统会提示你:…….connect
用ifconfig看看。[root@localhost /root]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:40:05:64:11:28
inet addr:192.168.0.254 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:347573 errors:0 dropped:0 overruns:0 frame:0
TX packets:40194 errors:0 dropped:0 overruns:0 carrier:0
collisions:35 txqueuelen:100
Interrupt:3 Base address:0x300
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:23 errors:0 dropped:0 overruns:0 frame:0
TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
ppp0 Link encap:Point-to-Point Protocol
inet addr:61.157.91.227 P-t-P:61.157.91.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:20498 errors:0 dropped:0 overruns:0 frame:0
TX packets:19187 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
看见ppp0没有!
4、最后一步:配置ipchains伪装IP。
在 /etc/sysconfig的network文件里保证要有这句: FORWARD_IPV4=true
然后改/etc/rc.d/rc.local这个文件,加入以下内容
route add -net 192.168.0.0 netmask 255.255.255.0 eth0
depmod -a
modprobe ip_masq_ftp
modprobe ip_masq_irc
modprobe ip_masq_raudio
/sbin/ipchains -P forward DENY
/sbin/ipchains -A forward -s 192.168.0.0/24 -j MASQ
以防万一:# echo 1 > /proc/sys/net/ipv4/ip_forward 这样一下下。存盘,退出,重启,完。是不是很简单啊!这样一台最简单的软路由就做好了,其实ipchains功能很强大,这里就不详细再讲了如有需要我会另外找时间再写。
5、配置的你每台客户机,如果用WINDOWNS系列,只要在网络设置的网卡的TCP/IP中加入网关192.168.0.254
注意:如果没用LINUX做DNS的话还要加DNS地址,成都的DNS地址是: 61.139.2..69和202.98.127.32
硬件、软件都装好了,下面开始具体配置。(加了#提示符号表示输入命令)
1、用ifconfig看看网络配置
[root@localhost /root]#ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:23 errors:0 dropped:0 overruns:0 frame:0
TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
只有lo没找到网卡。不急,自己配。我是DLINK的DE220 IRQ=3 IO=300,兼容NE2000。在/etc/conf.modules 加两句。
具体如下:
[root@localhost /root]#cd /etc
[root@localhost /root]#vi conf.modules
alias eth0 ne
options eth0 io=0x300 irq=3
IO和IRQ可以根据你自己的网卡设置
如果不能插入就按INSERT,加完就按ESC。再按: ,再输入w 存盘,再q 退出。如果不放心就 #more conf.modules 看看写进去没有。
一般市面上ISA的便宜网卡都兼容NE2000。如果是新手在LINUX下安装网卡的可能会遇到这样那样的问题,多在网上找找看看,一般都能解决。要提醒大家最好别用PNP即插即用模式,在LINUX出了问题不好解决,简直是场噩梦。
2、下面配置网卡IP地址, 在/etc/sysconfig/network-scripts下有个文件
ifcfg-eth0 写成如下:
DEVICE=eth0
IPADDR=192.168.0.254
这是网卡的IP地址,以后客户机的网关就是这个地址。
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
ONBOOT=yes
BOOTPROTO=none
重起就能找到网卡。
我们再[root@localhost /root]#ifconfig
eth0 Link encap:Ethernet HWaddr 00:40:05:64:11:28
inet addr:192.168.0.254 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:347573 errors:0 dropped:0 overruns:0 frame:0
TX packets:40194 errors:0 dropped:0 overruns:0 carrier:0
collisions:35 txqueuelen:100
Interrupt:3 Base address:0x300
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:23 errors:0 dropped:0 overruns:0 frame:0
TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
哈哈,eth0找到网卡了,配置也正确,恭喜恭喜!进行下一步。
3、下一步做ADSL的驱动。去http://www.roaringpenguin.com/pppoe/rp-pppoe-2.6.tar.gz 下个驱动程序先,大概85K大小。 考到/root去。
然后 #tar xvfz rp-pppoe-2.6.tar.gz
#cd rp-pppoe-2.6
#./go
开始安装,装好就#make一下下,开始配置ADSL。
Welcome to the Roaring Penguin ADSL client setup. First, I will run some checks on your system to make sure the PPPoE client is installed properly... Looks good! Now, please enter some information:
USER NAME
> > > Enter your PPPoE user name (default):
这里输入在电信局申请的adsl的帐号
INTERFACE
> > > 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就可以了
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 seconds after which the link should be dropped. If you want the link to stay up permanently, enter 'no' (two letters, lower-case.)
NOTE: Demand-activated links do not interact well with dynamic IP addresses. You may have some problems with demand-activated links.
> > > Enter the demand value (default no):
用缺省的no就可以了。
Please enter the IP address of your ISP's primary DNS server. If your ISP claims that 'the server will provide DNS addresses', enter 'server' (all lower-case) here. If you just press enter, I will assume you know what you are doing and not modify your DNS setup.
> > > Enter the DNS information here:
这里填你ISP的DNS地址,成都用61.139.2.69,辅助DNS成都可用202.98.127.32
PASSWORD
> > > Please enter your PPPoE password:
ADSL拨号密码这个东东。
搞定!爽爽,用#adsl-start 就可以开始拨号。如果连接成功系统会提示你:…….connect
用ifconfig看看。[root@localhost /root]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:40:05:64:11:28
inet addr:192.168.0.254 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:347573 errors:0 dropped:0 overruns:0 frame:0
TX packets:40194 errors:0 dropped:0 overruns:0 carrier:0
collisions:35 txqueuelen:100
Interrupt:3 Base address:0x300
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:23 errors:0 dropped:0 overruns:0 frame:0
TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
ppp0 Link encap:Point-to-Point Protocol
inet addr:61.157.91.227 P-t-P:61.157.91.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:20498 errors:0 dropped:0 overruns:0 frame:0
TX packets:19187 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
看见ppp0没有!
4、最后一步:配置ipchains伪装IP。
在 /etc/sysconfig的network文件里保证要有这句: FORWARD_IPV4=true
然后改/etc/rc.d/rc.local这个文件,加入以下内容
route add -net 192.168.0.0 netmask 255.255.255.0 eth0
depmod -a
modprobe ip_masq_ftp
modprobe ip_masq_irc
modprobe ip_masq_raudio
/sbin/ipchains -P forward DENY
/sbin/ipchains -A forward -s 192.168.0.0/24 -j MASQ
以防万一:# echo 1 > /proc/sys/net/ipv4/ip_forward 这样一下下。存盘,退出,重启,完。是不是很简单啊!这样一台最简单的软路由就做好了,其实ipchains功能很强大,这里就不详细再讲了如有需要我会另外找时间再写。
5、配置的你每台客户机,如果用WINDOWNS系列,只要在网络设置的网卡的TCP/IP中加入网关192.168.0.254
注意:如果没用LINUX做DNS的话还要加DNS地址,成都的DNS地址是: 61.139.2..69和202.98.127.32