Linux服务器网卡驱动安装及故障(转帖)

转自:http://www.ccw.com.cn/server/yyjq/htm2005/20050817_15OF4_3.htm

Linux服务器网卡驱动安装及故障排除

 

 

2005-08-17 16:04:42.107

 

  计世网特约撰稿 曹江华 

 

3.为新网卡设定IP地址

在Linux 网络设备在配置时被赋予别名,该别名由一个描述性的缩略词和一个编号组成。某种类型的第一个设备的编号为 0,其他设备依次被编号为 1、2、3,等。但是网卡并

不是最为裸设备出现在/dev目录下,而是存在内存中。eth0, eth1是以太网卡接口。它们用于大多数的以太网卡,包括许多并行端口以太网卡。本文主要讨论这类网卡。 为Linux以太网卡设定IP地址的方式非常灵活,你可以选择适合你工作情况的方法:

(1)使用ip或ifconfig命令

ifconfig命令是最重要的Linux网络命令,最主要的用途是设定、修改网卡的IP地址,修改网卡ip地址:

#ifconfig eth0 192.168.0.2 netmask 255.255.255.0

默认情况下, ifconfig 显示活动的网络设备。给这个命令添加一个 -a 开关就能看到所有设备。但是ifconfig命令设置网络设备的ip地址系统重新启动后设置会自动失效。所以它主要用于网卡状态调试。假设您要建立一个临时的网络配置以供测试。您可以使用发行版本中的工具来编辑配置,但是需要注意在完成测试之后,将所有设置恢复回去。通过使用 ifconfig ,我们无需影响已保存的设置,就能够快速地配置网卡。

Ip命令是iproute2软件包里面的一个强大的网络配置工具,它能够替代一些传统的网络管理工具。例如:ifconfig、route等。现在,绝大多数 Linux 发行版和绝大多数 UNIX都使用古老的arp, ifconfig和route命令。虽然这些工具能够工作,但它们在Linux2.2和更高版本的内核上显得有一些落伍。使用iproute2前你应该确认已经安装了这个工具。这个包的名字在RedHat Linux 9.0叫作“iproute2”,也可以在:ftp://ftp.inr.ac.ru/ip-routing/ 下载源代码安装。

如果希望在以太网接口eth0上增加一个地址10.0.0.1,掩码长度为24位,标准广播地址,标签为eth0:Alias:

#ip addr add 10.0.0.1/24 brd + dev eth0 label eth0:Alias

(2)使用 netconfig命令

netconfig命令可以设置网络设备的ip地址,netconfig命令可以永久保存设置。

使用方法是:“netconfig ethX”。使用命令“netconfig eth0”后会在命令行下弹出一个对话框,这时即可进行设定见图2,

图2 netconfig配置界面

设定结束后用“tab”键选择“OK”即可保存设置并且退出。然后使用命令:“service network restart “激活即可生效。

(3)使用neat命令

使用neat命令需要配置好X window系统,在命令行下运行“neat”命令后添加IP地址和其他相关参数后保存设置,从新启动网络和网络服务或计算机,见图-3。

图-3 图形界面添加IP地址

另外neat命令还有一个同价命令:“redhat-config-network”,二者完全相同。Neat和redhat-config-config命令可以永久保存设置。

(4)修改TCP/IP网络配置文件

除非另行指定,Red Hat Linux 系统中大多数配置文件都在 /etc 目录中。网卡相关的TCP/IP网络配置文件是:/etc/sysconfig/network-scripts/ifcfg-ethx。其中x从0开始,第一个以太网配置文件即:/etc/sysconfig/network-scripts/ifcfg-eth0。使用vi编辑器修改这个文件,也可以修改网卡IP地址。

#vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0        #设定网卡的名称,要跟文件名称对应 #

ONBOOT=yes        #是否在开机的的时候启动网卡#

BOOTPROTO=static      #启动的时候的 IP 取得的协议,这里是固定的,

               如果是动态主机的话,要改成 dhcp 才行#

IPADDR=192.168.1.2     #IP 地址#

NETMASK=255.255.255.0   #子网掩吗#

NETWORK=192.168.1.0    #该网段的第一个 IP#

BROADCAST=192.168.1.255  #最后一个同网段的广播地址#

GATEWAY=192.168.1.2    #网关地址#

#GATEWAYDEV=eth0      

存盘后使用命令:“service network restart “激活即可生效。这个方法同样可以永久保存设置。

(5)为网卡添加IPV6地址

和Windows系统相比Linux对Ipv6的支持更好,最早的支持Ipv6的Linux内核是 2.2.xxx。一般Linux基于2.4内核的Linux发行版本都可以直接使用Ipv6,使用前要看系统IPv6模块是否被加载,如果没有的话可以使用命令手工加载,这需要超级用户的权限。然后使用命令检测,如果显示IPv6地址(inet6 addr:fe80::200:e8ff:fea0:2586/64)证明IPv6已经加载。

# modprobe IPv6;#ifconfig -a

如果希望Linux系统启动时自动加载Ipv6模块,可以在配置文件:/etc/modules.conf中加入一行:

alias net−pf−10 ipv6 # automatically load IPv6 module on demand

把Redhat linux9.0运行在486DX100上了

没有装X图形界面的原来装在K6-2 450,mvp3主板上的Redhat linux9.0的1.6G的硬盘,不经修改就挂到一台老掉牙的486DX100,24M内存的机器上了。可以运行字符界面下面的所有程序。包括:vi,w3m,emacs等等。

今天,就在这台机器上看了那本讲bash编程的电子书(老婆学会了上网聊天,这几天的兴趣正浓,把那台好点的机器给占了),现学现用,把zhcon命令加入到/etc/profile文件的结束处,用户登录后就自动进入zhcon中文的控制台环境了。这就是bash编程教程的第一个例程的功效,bash的最简单的作用就是把一组命令组合在一起来完成一个任务,以后执行这个任务就执行这个bash脚本就是了,不必单独的输入一个一个的命令。

另外,由于这台机器的内存太少了,参照前段时间收藏的一篇讲系统服务的文章把/etc/rc3.d里面不必要的服务的前面的S通通换成K,这样,前面是K的服务就不会启动了。

我的启动级别是3,rc3.d里面的内容如下:


K05kudzu      K13portmap  K24pcmcia   K50snmpd      K90crond    S12syslog

K05saslauthd  K14nfslock  K25netfs    K50snmptrapd  K90xfs      S17keytable

K08iptables   K20nfs      K26apmd     K55sshd       K95anacron  S56rawdevices

K09isdn       K20random   K28autofs   K56xinetd     K95atd      S85gpm

K10network    K24irda     K35winbind  K80sendmail   K97rhnsd    S99local

last week(Aug 12~18, 2006)

1.Irrigating for fighting dry wheather ended at last Friday. Most of my fellows which participating in the irrigating mission  came back from countryside. The dry and hot wheather is continuing. But we can feel a little cool in the morning. Maybe, the good thing is coming?

2.My k6-2 475 CPU was gone. And, with my mistake, it's mvp3 mainboard was also destroyed.

3.Listening 900 english sentences was going on. Now is listening part D.

4.Remove Ubuntu linux 6.0.6 from the p4 computer in company, and replace it with redhat linux9.0, the main reason for this is computer is old and I felt ubuntu isn't appropriate for me although it is a good new linux distribution. The best for others maybe isn't a best for me.

5.职称考试 register will begin at the end of Sept.

goodbye, my dear K6-2 machine

After working with me about 6 years, my K6-2 450 CPU and mvp3 mainboard has been burnt yestoday, it was really a  

 spirited burn. Many chips has been detroyed. One of them smoked when been burnt.

The awful thing began with auto halt of machine. Maybe it was caused by a defective K6-2 475, it can't work at its frequency a long time ago, but a less frequency of 450. At last, it came at its end yesterday.

For my mistake, this caused the destroy of mainboard, I found the fan didn't work when plus power pin onto mainboard. So, I removed one of two power pins from mainboard. The unfortunate thing happend: a little chip began smoking. Many chips was so burned. No any necessity to fix all of them, the mainboard repairer man told me. And the CPU is dead too.

I got a impress lesson, don't operate anything on computer hardware which you are not sure when the power is on!

vi/vim 键盘图 (转帖)

转自:http://blog.linuxsky.net/3000/viewspace_1278_aid_279.html



图片故事

原贴地址: http://www.linuxsir.org/bbs/showthread.php?t=257834

献给vi的初学者!

英文源文件来自: http://www.viemu.com/

请注意:

1、不能代替通过文档学习,因为图片无法涵盖vi的所有功能

2、无法用几个中文字表达#、*、t等功能键的用法,只能保留英文

3、由于制作工具原因,中文未选用合适的粗体,哪位有时间帮忙做一下

简体中文pdf下载

简体中文SVG文件下载 英文源图

对岸的jserv在此基础上又制作了繁体版,见这儿http://blog.linux.org.tw/jserv/

如何扫描检查Linux磁盘(转帖)

转自:http://kb.discuz.net/index.php?title=%E5%A6%82%E4%BD%95%E6%89%AB%E6%8F%8F%E6%A3%80%E6%9F%A5Linux%E7%A3%81%E7%9B%98

如何扫描检查Linux磁盘

Wikipedia,自由的百科全书

Linux提供了一个磁盘检查工具,当磁盘出现错误的时候可以使用fsck对磁盘进行扫描和修复。以下让我们看看如何使用

fsck来检查磁盘分区。

fsck使用很简单,首先让我们看看fsck常用的参数:

-t : 给出文件系统格式(例如:vfat,ext3等),如果文件系统格式在 /etc/fstab 中已经定义或 Kernel 本身已经支持,则无需使用参数。

-A : 对/etc/fstab 中所有挂载的分区进行检查。

-C : 显示完整的检查进度。

-d : 显示 e2fsck 的 Debug 结果。

-p : 如果使用 -A 参数,则同时有多个 fsck 扫描并行工作。

-R : 如果使用 -A 参数,则省略 / 分区不检查。

-V : 详细显示模式。

-a : 如果扫描发现错误则自动尝试修复。

-r : 如果扫描发现错误则提示用户,由用户决定是否修复(交互模式)。

举例:

需要对所有以挂载的分区进行扫描,并且让系统自动修复所有错误。

 # fsck -A -C -d -V -a

注意!

1. 如果磁盘含有NTFS分区,则不要对其进行扫描,否则有可能导致NTFS分区彻底损坏!

2. 建议在进行扫描前关闭所有服务!不要有磁盘写操作,否则可能导致磁盘分区检查失败甚至分区损坏!

总之,对于Linux系统经验相对较少的用户还是不推荐使用fsck进行检查的,fsck有一定的风险。如果磁盘分区出现异常最好还是求助于有经验的技术人员。

cheer! cool days

Since about two months' dry and hot wheather, temperature is above 37 usually, and it almost didn't rain totally.

But, a happy thing coming, we have two cool days since tommorow morning's thunder rain.

Big thunder, fire-flag, rain, and cool wind, these just are the best gifts that it gave us. It seems to say: oh, boys and girls, pigs and dogs, trees and flowers, anything under me, enjoy it, your bad days will become past, your good days is coming.

Wish it give us these gifts usually:), but, don't give us too much, especially, like flood.

Do I do need try many linux distribution versions?

I have tried Redhat linux9.0, Ubuntu linux6.0.6, and, I want to try some another versions, like: Debian, slackware, Gentoo, etc..

I ask myself, do I do need try these things?

Of course, I will encouter many questions when I try a new linux distribution version, just like I am being encountered  by trying ubuntu after I have being used Redhat linux9.0 some time, I resolved one by one matters, such as Chinese Input Method under Emacs, text console, compiling kernel, etc..

Now, I am aware of, that is, I have no need to try these things.

My goal is the jobs on the OS, not the OS itself.

Yes, I believe I can resolve all incoming matthers at last, I believe my ability. But, it really is a useless thing!

So, I stop this no end's action. I am back, back to my Redhat linux9.0, Ubuntu is a nice linux distribution, but it isn't a good choice for me: fisrt, my computer is too old, running it is a difficult thing; second, the high level auto installing software's style isn't prefer for me, I wish all the things is under control. when I runing: apt-get install ***, I can't know where my software to go? what place they go? third, there are always some little questions bother me, like chinese input method under text console and emacs, compiling kernel, etc..

So, ubuntu is a good but is a bit green apple for me, today, I have removed it from my computer, replace it by redhat linux9.0.

I think, I won't try other distribution versions, working on redhat9.0 is enough for me.

都市中遇到洪水怎么办(转帖)

(转自:http://www.gov.cn/yjgl/2005-08/03/content_19229.htm)

                                       都市中遇到洪水怎么办

                                                 _

                                                 _

           中国政府门户网站 www.gov.cn   2005年08月03日  来源:国务院应急管理办公室

                               【字体:大中   [打印本页] [关闭窗口]

                                       小】

                                                 _

             都市中遇到洪水最先采取的措施就是迅速登上牢固的高层建筑避险,而后要与救援

           部门取得联系。同时,注意收集各种漂浮物,木盆、木桶都不失为逃离险境的好工具。

           分析洪水中人员失踪的原因,一方面是洪水流量大,猝不及防;另一方面也是因为有的

           人不了解水情而涉险渡水。所以,洪水中必须注意的是,不了解水情的人一定要在安全

           地带等待救援部门的救援。

             1.避难所一般应选择在距家最近、地势较高、交通较为方便处,并有上下水设施,

           卫生条件较好。在城市中大多是高层建筑的平坦楼顶,地势较高或有牢固楼房的学校、

           医院等。

             2.将衣被等御寒物放至高处保存;将不便携带的贵重物品做防水捆扎后埋入地下或

           置放高处,票款、首饰等物品可缝在衣物中。

             3.扎制木排,并搜集木盆、木块等漂浮材料加工为救生设备以备急需;洪水到来时

           难以找到适合的饮用水,所以在洪水来之前可用木盆、水桶等盛水工具贮备干净的饮用

           水。

               4.准备好医药、取火等物品;保存好各种尚能使用的通讯设施,可与外界保持良好

           的通讯、交通联系。