飘飘悠悠 发表于 2015-1-14 20:12:43

带来一篇CentOS下ifconfig下令具体剖析

欢迎大家来到仓酷云论坛!1.测试情况:
#cat/etc/redhat-release
CentOSrelease5.4(Final)
#uname-r
2.6.18-164.el5
#ifconfig#本机的收集设置
eth0Linkencap:EthernetHWaddr00:0C:29:BC:7A:11
inetaddr:10.0.0.30Bcast:10.0.0.255Mask:255.255.255.0
inet6addr:fe80::20c:29ff:febc:7a11/64Scope:Link
UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1
RXpackets:893errors:0dropped:0overruns:0frame:0
TXpackets:447errors:0dropped:0overruns:0carrier:0
collisions:0txqueuelen:1000
RXbytes:91733(89.5KiB)TXbytes:84456(82.4KiB)
Interrupt:185Baseaddress:0x1400

eth1Linkencap:EthernetHWaddr00:0C:29:BC:7A:1B
inetaddr:192.168.0.30Bcast:192.168.0.255Mask:255.255.255.0
inet6addr:fe80::20c:29ff:febc:7a1b/64Scope:Link
UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1
RXpackets:25errors:0dropped:0overruns:0frame:0
TXpackets:44errors:0dropped:0overruns:0carrier:0
collisions:0txqueuelen:1000
RXbytes:6622(6.4KiB)TXbytes:7942(7.7KiB)
Interrupt:169Baseaddress:0x1480

loLinkencap:LocalLoopback
inetaddr:127.0.0.1Mask:255.0.0.0
inet6addr:::1/128Scope:Host
UPLOOPBACKRUNNINGMTU:16436Metric:1
RXpackets:16errors:0dropped:0overruns:0frame:0
TXpackets:16errors:0dropped:0overruns:0carrier:0
collisions:0txqueuelen:0
RXbytes:1224(1.1KiB)TXbytes:1224(1.1KiB)
申明:
eth0暗示第一块网卡,个中HWaddr暗示网卡的物理地点,我们能够看到今朝这
个网卡的物理地点(MAC地点)是00:0C:29:BC:7A:1B;inetaddr用来暗示网卡
的IP地点,此网卡的IP地点是10.0.0.30,播送地点,
Bcast:10.0.0.255,掩码地点Mask:255.255.255.0

lo是暗示主机的回坏地点,这个通常为用来测试一个收集步伐,但又不想让局域
网或外网的用户可以检察,只能在此台主机上运转和检察所用的收集接口。好比我
们把HTTPD办事器的指定到回坏地点,在扫瞄器输出127.0.0.1就可以看到你所架
WEB网站了。但只是您能看失掉,局域网的别的主机或用户无从晓得;
2.经由过程man下令检察体系自带的匡助
#manifconfig
NAME
ifconfig-configureanetworkinte***ce

SYNOPSIS#择要,提要,粗心
ifconfig
ifconfiginte***ceoptions|address...

DESCRIPTION
Ifconfigisusedtoconfigurethekernel-residentnetworkinte***ces.Itisusedatboottimetosetupinte***cesasnecessary.Afterthat,itisusuallyonlyneededwhendebuggingorwhensystemtuningisneeded.
Ifnoargumentsaregiven,ifconfigdisplaysthestatusofthecurrentlyactiveinte***ces.Ifasingleinte***ceargumentisgiven,itdisplaysthestatusofthegiveninte***ceonly;ifasingle-aargumentisgiven,itdisplaysthestatusofallinte***ces,eventhosethataredown.Otherwise,itconfiguresaninte***ce.

AddressFamilies
Ifthefirstargumentaftertheinte***cenameisrecognizedasthenameofasupportedaddressfamily,thataddressfamilyisusedfordecodinganddisplayingallprotocoladdresses.Currentlysupportedaddressfamiliesincludeinet(TCP/IP,default),inet6(IPv6),ax25(AMPRPacketRadio),ddp(Appletalk
Phase2),ipx(NovellIPX)andnetrom(AMPRPacketradio).AllnumberssuppliedaspartsinIPv4dotteddecimalnotationmaybedecimal,octal,orhexadecimal,asspecifiedintheISOCstandard(thatis,aleading0xor0Ximplieshexadecimal;otherwise,aleadingimpliesoctal;otherwise,thenumberisinterpretedasdecimal).UseofhexamedialandoctalnumbersisnotRFC-compliantandthereforeitsuseisdiscouragedandmaygoaway.

OPTIONS
Inte***ce#e.geth0、eth1
Thenameoftheinte***ce.Thisisusuallyadrivernamefollowedbyaunitnumber,forexampleeth0forthefirstEthernetinte***ce.
e.g
#ifconfigeth0
eth0Linkencap:EthernetHWaddr00:0C:29:BC:7A:11
inetaddr:10.0.0.30Bcast:10.0.0.255Mask:255.255.255.0
inet6addr:fe80::20c:29ff:febc:7a11/64Scope:Link
UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1
RXpackets:673errors:0dropped:0overruns:0frame:0
TXpackets:338errors:0dropped:0overruns:0carrier:0
collisions:0txqueuelen:1000
RXbytes:68647(67.0KiB)TXbytes:66442(64.8KiB)
Interrupt:185Baseaddress:0x1400

upThisflagcausestheinte***cetobeactivated.Itisimplicitlyspecifiedifanaddressisassignedtotheinte***ce.
e.g
在假造机上实行ifconfigeth0up下令,激活eth0
#ifconfigeth0up
#ifconfig#考证是不是激活
eth0Linkencap:EthernetHWaddr00:0C:29:BC:7A:11
inetaddr:10.0.0.30Bcast:10.0.0.255Mask:255.255.255.0
inet6addr:fe80::20c:29ff:febc:7a11/64Scope:Link
UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1
RXpackets:893errors:0dropped:0overruns:0frame:0
TXpackets:447errors:0dropped:0overruns:0carrier:0
collisions:0txqueuelen:1000
RXbytes:91733(89.5KiB)TXbytes:84456(82.4KiB)
Interrupt:185Baseaddress:0x1400

eth1Linkencap:EthernetHWaddr00:0C:29:BC:7A:1B
inetaddr:192.168.0.30Bcast:192.168.0.255Mask:255.255.255.0
inet6addr:fe80::20c:29ff:febc:7a1b/64Scope:Link
UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1
RXpackets:25errors:0dropped:0overruns:0frame:0
TXpackets:44errors:0dropped:0overruns:0carrier:0
collisions:0txqueuelen:1000
RXbytes:6622(6.4KiB)TXbytes:7942(7.7KiB)
Interrupt:169Baseaddress:0x1480

loLinkencap:LocalLoopback
inetaddr:127.0.0.1Mask:255.0.0.0
inet6addr:::1/128Scope:Host
UPLOOPBACKRUNNINGMTU:16436Metric:1
RXpackets:16errors:0dropped:0overruns:0frame:0
TXpackets:16errors:0dropped:0overruns:0carrier:0
collisions:0txqueuelen:0
RXbytes:1224(1.1KiB)TXbytes:1224(1.1KiB)
看到eth0已乐成激活
downThisflagcausesthedriverforthisinte***cetobeshutdown.
e.g
SecureCRT软件
#ifconfigeth0down
了局:光标一直闪灼
间接在假造机里操纵
#ifconfig
eth1Linkencap:EthernetHWaddr00:0C:29:BC:7A:1B
inetaddr:192.168.0.30Bcast:192.168.0.255Mask:255.255.255.0
inet6addr:fe80::20c:29ff:febc:7a1b/64Scope:Link
UPBROADCASTRUNNINGMULTICASTMTU:1500Metric:1
RXpackets:25errors:0dropped:0overruns:0frame:0
TXpackets:44errors:0dropped:0overruns:0carrier:0
collisions:0txqueuelen:1000
RXbytes:6622(6.4KiB)TXbytes:7942(7.7KiB)
Interrupt:169Baseaddress:0x1480

loLinkencap:LocalLoopback
inetaddr:127.0.0.1Mask:255.0.0.0
inet6addr:::1/128Scope:Host
UPLOOPBACKRUNNINGMTU:16436Metric:1
RXpackets:16errors:0dropped:0overruns:0frame:0
TXpackets:16errors:0dropped:0overruns:0carrier:0
collisions:0txqueuelen:0
RXbytes:1224(1.1KiB)TXbytes:1224(1.1KiB)
申明:实行ifconfigeth0down下令后,网卡eth0就停失落了,不事情了,已断开了毗连,而SecureCRT就是经由过程eth0毗连的假造机,以是光标会一向闪灼;经由过程在假造机上实行ifconfig下令考证,eth0的确停失落了。
[-]arpEnableordisabletheuseoftheARPprotocolonthisinte***ce.
e.g
#ifconfigeth0–arp#封闭了ARP协定
实行完此下令后,SecureCRT和假造机断开毗连。封闭ARP,IP地点和MAC地点得到了对应干系,没法辨认对应的主机。
#ifconfigeth0arp#开启ARP协定
再次毗连一般arp下令(附录一)
[-]promisc
Enableordisablethepromiscuousmodeoftheinte***ce.Ifselected,allpacketsonthenetworkwillbereceivedbytheinte***ce.

[-]allmulti
Enableordisableall-multicastmode.Ifselected,allmulticastpacketsonthenetworkwillbereceivedbytheinte***ce.

metricN#指定在盘算数据包的转送次数时,所要加上的数量
Thisparametersetstheinte***cemetric.
<pstyle="word-wrap:break-word;margin:5px0px;padding:0px;color:rgb(102,102,102);font-family:宋体,Arial;font-size:16px;line-height:26px;"><spanstyle="word-wrap:break-word;font-size:12pt;font-family:宋体;">

再现理想 发表于 2015-1-15 05:07:13

带来一篇CentOS下ifconfig下令具体剖析

为保住菊花,这个一定得回复!

海妖 发表于 2015-1-25 18:34:09

甚至目前许多应用软件都是基于它的。可是没有哪一个系统是十分完美的。

第二个灵魂 发表于 2015-2-3 20:59:16

硬盘安装及光盘安装,清楚了解安装Linux应注意的有关问题,如安装Linux应在最后一个分区内,至少分二个分区。

灵魂腐蚀 发表于 2015-2-9 08:38:14

Linux最大的特点就是其开源性,这一点是十分难得的,这也是它能够存在到现在的原因之一。

小魔女 发表于 2015-2-27 10:12:45

任何一个叫做操作系统的东西都是这样子构成的:内核+用户界面+一般应用程序。

简单生活 发表于 2015-3-9 10:24:02

目前全球有超过一百多个Linux发行版本,在国内也能找到十几个常见版本。如何选择请根据你的需求和能力,RedhatLinux和DebianLinux是网络管理员的理想选择。

透明 发表于 2015-3-17 02:10:04

主流Linux发行版都自带非常详细的文档(包括手册页和FAQ),从系统安装到系统安全,针对不同层次的人的详尽文档,仔细阅读文档后40%问题都可在此解决。

深爱那片海 发表于 2015-3-23 19:30:25

可以说自己收获很大,基本上完成了老师布置的任务,对于拔高的题目没有去做,因为我了解我的水平,没有时间和精力去做。?
页: [1]
查看完整版本: 带来一篇CentOS下ifconfig下令具体剖析