偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

Fedora ifconfig配置網(wǎng)絡(luò)接口

系統(tǒng) Linux
Fedora ifconfig 可以用來配置網(wǎng)絡(luò)接口的IP地址、掩碼、網(wǎng)關(guān)、物理地址等;值得一說的是用Fedora ifconfig 為網(wǎng)卡指定IP地址,這只是用來調(diào)試網(wǎng)絡(luò)用的,并不會(huì)更改系統(tǒng)關(guān)于網(wǎng)卡的配置文件。

Fedora ifconfig 是一個(gè)用來查看、配置、啟用或禁用網(wǎng)絡(luò)接口的工具,這個(gè)工具極為常用的??梢杂眠@個(gè)工具來臨時(shí)性的配置網(wǎng)卡的IP地址、掩碼、廣播地址、網(wǎng)關(guān)等。也可以把它寫入一個(gè)文件中(比如/etc/rc.d/rc.local),這樣系統(tǒng)引導(dǎo)后,會(huì)讀取這個(gè)文件,為網(wǎng)卡設(shè)置IP地址。

1、Fedora ifconfig 查看網(wǎng)絡(luò)接口狀態(tài)Fedora ifconfig 如果不接任何參數(shù),就會(huì)輸出當(dāng)前網(wǎng)絡(luò)接口的情況

  1. [root@localhost ~]# Fedora ifconfig   
  2.  
  3. eth0 Link encap:Ethernet  HWaddr 00:C0:9F:94:78:0E  
  4. inet addr:192.168.1.88  Bcast:192.168.1.255  Mask:255.255.255.0  
  5. inet6 addr: fe80::2c0:9fff:fe94:780e/64 Scope:Link  
  6. UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1  
  7. RX packets:850 errors:0 dropped:0 overruns:0 frame:0  
  8. TX packets:628 errors:0 dropped:0 overruns:0 carrier:0  
  9. collisions:0 txqueuelen:1000  
  10. RX bytes:369135 (360.4 KiB)  TX bytes:75945 (74.1 KiB)  
  11. Interrupt:10 Base address:0x3000  
  12.  
  13. lo Link encap:Local Loopback  
  14. inet addr:127.0.0.1  Mask:255.0.0.0  
  15. inet6 addr: ::1/128 Scope:Host  
  16. UP LOOPBACK RUNNING  MTU:16436  Metric:1  
  17. RX packets:57 errors:0 dropped:0 overruns:0 frame:0  
  18. TX packets:57 errors:0 dropped:0 overruns:0 carrier:0  
  19. collisions:0 txqueuelen:0  
  20. RX bytes:8121 (7.9 KiB)  TX bytes:8121 (7.9 KiB)注解: 

eth0 表示***塊網(wǎng)卡, 其中 HWaddr 表示網(wǎng)卡的物理地址,可以看到目前這個(gè)網(wǎng)卡的物理地址(MAC地址)是 00:C0:9F:94:78:0E ; inet addr 用來表示網(wǎng)卡的IP地址,此網(wǎng)卡的 IP地址是 192.168.1.88,廣播地址, Bcast:192.168.1.255,掩碼地址Mask:255.255.255.0。

lo 是表示主機(jī)的回環(huán)地址,這個(gè)一般是用來測(cè)試一個(gè)網(wǎng)絡(luò)程序,但又不想讓局域網(wǎng)或外網(wǎng)的用戶能夠查看,只能在此臺(tái)主機(jī)上運(yùn)行和查看所用的網(wǎng)絡(luò)接口。比如把 HTTPD服務(wù)器的指定到回壞地址,在瀏覽器輸入 127.0.0.1 就能看到你所架WEB網(wǎng)站了。但只是您能看得到,局域網(wǎng)的其它主機(jī)或用戶無從知道。

如果想知道主機(jī)所有網(wǎng)絡(luò)接口的情況,請(qǐng)用下面的命令:[root@localhost ~]# Fedora ifconfig -a
如果想查看某個(gè)端口,比如查看eth0 的狀態(tài),就可以用下面的方法:[root@localhost ~]# Fedora ifconfig eth0
 
2、Fedora ifconfig 配置網(wǎng)絡(luò)接口

Fedora ifconfig 可以用來配置網(wǎng)絡(luò)接口的IP地址、掩碼、網(wǎng)關(guān)、物理地址等;值得一說的是用Fedora ifconfig 為網(wǎng)卡指定IP地址,這只是用來調(diào)試網(wǎng)絡(luò)用的,并不會(huì)更改系統(tǒng)關(guān)于網(wǎng)卡的配置文件。

如果您想把網(wǎng)絡(luò)接口的IP地址固定下來,目前有三個(gè)方法:一是通過各個(gè)發(fā)行和版本專用的工具來修改IP地址;二是直接修改網(wǎng)絡(luò)接口的配置文件;三是修改特定的文件,加入Fedora ifconfig 指令來指定網(wǎng)卡的IP地址,比如在redhat或Fedora中,把Fedora ifconfig 的語(yǔ)名寫入/etc/rc.d/rc.local文件中。

Fedora ifconfig 配置網(wǎng)絡(luò)端口的方法:Fedora ifconfig 工具配置網(wǎng)絡(luò)接口的方法是通過指令的參數(shù)來達(dá)到目的的,我們只說最常用的參數(shù):Fedora ifconfig 網(wǎng)絡(luò)端口 IP地址 hw <HW> MAC地址 netmask 掩碼地址 broadcast 廣播地址 [up/down]* 實(shí)例一:比如我們用Fedora ifconfig 來調(diào)試 eth0網(wǎng)卡的地址

  1. [root@localhost ~]# Fedora ifconfig eth0 down  
  2. [root@localhost ~]# Fedora ifconfig eth0 192.168.1.99 broadcast 192.168.1.255 netmask 255.255.255.0  
  3. [root@localhost ~]# Fedora ifconfig eth0 up  
  4. [root@localhost ~]# Fedora ifconfig eth0   
  5.    
  6. eth0 Link encap:Ethernet HWaddr 00:11:00:00:11:11  
  7. inet addr:192.168.1.99 Bcast:192.168.1.255 Mask:255.255.255.0  
  8. UP BROADCAST MULTICAST MTU:1500 Metric:1  
  9. RX packets:0 errors:0 dropped:0 overruns:0 frame:0  
  10. TX packets:0 errors:0 dropped:0 overruns:0 carrier:0  
  11. collisions:0 txqueuelen:1000  
  12. RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)  
  13. Interrupt:11 Base address:0x3400 

注解:

  1. ***行:Fedora ifconfig eth0 down 表示如果eth0是激活的,就把它DOWN掉。此命令等同于 ifdown eth0;  
  2. 第二行:用Fedora ifconfig 來配置 eth0的IP地址、廣播地址和網(wǎng)絡(luò)掩碼;  
  3. 第三行:用Fedora ifconfig eth0 up 來激活eth0 ; 此命令等同于 ifup eth0  
  4. 第四行:用 Fedora ifconfig eth0 來查看 eth0的狀態(tài)。 

當(dāng)然您也可以用直接在指令I(lǐng)P地址、網(wǎng)絡(luò)掩碼、廣播地址的同時(shí)激活網(wǎng)卡,要加up參數(shù)。比如下面的例子:

  1. [root@localhost ~]# Fedora ifconfig eth0 192.168.1.99 broadcast 192.168.1.255 netmask 255.255.255.0 up  
  2. [root@localhost ~]# Fedora ifconfig eth0 down  
  3. [root@localhost ~]# Fedora ifconfig eth0 192.168.1.99 broadcast 192.168.1.255 netmask 255.255.255.0  
  4. [root@localhost ~]# Fedora ifconfig eth0 up  
  5. [root@localhost ~]# Fedora ifconfig eth0   

* 實(shí)例二:在這個(gè)例子中,我們要學(xué)會(huì)設(shè)置網(wǎng)絡(luò)IP地址的同時(shí),學(xué)會(huì)設(shè)置網(wǎng)卡的物理地址(MAC地址);
比如我們?cè)O(shè)置網(wǎng)卡eth1的IP地址、網(wǎng)絡(luò)掩碼、廣播地址,物理地址并且激活它。

  1. [root@localhost ~]# Fedora ifconfig eth1 192.168.1.252 hw ether 00:11:00:00:11:11 netmask 255.255.255.0 broadcast 192.168.1.255 up或  
  2. [root@localhost ~]# Fedora ifconfig eth1 hw ether 00:11:00:00:11:22  
  3. [root@localhost ~]# Fedora ifconfig eth1 192.168.1.252 netmask 255.255.255.0 broadcast 192.168.1.255 up  

其中 hw 后面所接的是網(wǎng)絡(luò)接口類型, ether表示乙太網(wǎng), 同時(shí)也支持 ax2***RCnet、netrom等,詳情請(qǐng)查看 man Fedora ifconfig。

3、用Fedora ifconfig 來配置虛擬網(wǎng)絡(luò)接口

有時(shí)我們?yōu)榱藵M足不同的需要還需要配置虛擬網(wǎng)絡(luò)接口,比如我們用不同的IP地址來架運(yùn)行多個(gè)HTTPD服務(wù)器,就要用到虛擬地址;這樣就省卻了同一個(gè)IP地址,如果開設(shè)兩個(gè)的HTTPD服務(wù)器時(shí),要指定端口號(hào)。

虛擬網(wǎng)絡(luò)接口指的是為一個(gè)網(wǎng)絡(luò)接口指定多個(gè)IP地址,虛擬接口是這樣的 eth0:0、 eth0:1、eth0:2 ... .. eth1N。當(dāng)然您為 eth1 指定多個(gè)IP地址,也就是 eth1:0、eth1:1、eth1:2 ... ...以此類推。

其實(shí)用Fedora ifconfig 為一個(gè)網(wǎng)卡配置多個(gè)IP地址,就用前面我們所說的Fedora ifconfig的用法,這個(gè)比較簡(jiǎn)單??聪旅娴睦樱?/p>

  1. [root@localhost ~]# Fedora ifconfig eth1:0 192.168.1.251 hw ether 00:11:00:00:11:33 netmask 255.255.255.0 broadcast 192.168.1.255 up或  
  2. [root@localhost ~]# Fedora ifconfig eth1 hw ether 00:11:00:00:11:33  
  3. [root@localhost ~]# Fedora ifconfig eth1 192.168.1.251 netmask 255.255.255.0 broadcast 192.168.1.255 up 

注意:指定時(shí),要為每個(gè)虛擬網(wǎng)卡指定不同的物理地址。在 Redhat/Fedora 或與Redhat/Fedora類似的系統(tǒng),您可以把配置網(wǎng)絡(luò)IP地址、廣播地址、掩碼地址、物理地址以及激活網(wǎng)絡(luò)接口同時(shí)放在一個(gè)句子中,寫入/etc/rc.d/rc.local中。比如下面的例子;
Fedora ifconfig eth1:0 192.168.1.250 hw ether 00:11:00:00:11:44 netmask 255.255.255.0 broadcast 192.168.1.255 up
Fedora ifconfig eth1:1 192.168.1.249 hw ether 00:11:00:00:11:55 netmask 255.255.255.0 broadcast 192.168.1.255 up
解說:上面是為eth1的網(wǎng)絡(luò)接口,設(shè)置了兩個(gè)虛擬接口,每個(gè)接口都有自己的物理地址、IP地址... ...
 

【編輯推薦】

  1. Fedora vsftpd限制登錄安裝配置
  2. Fedora vmware啟動(dòng)ghost computer中的Linux
  3. Fedora Continue打印文檔時(shí)用CanoniP1000
  4. Fedora vncserver運(yùn)行在服務(wù)器用ssh登錄到服務(wù)器
  5. Fedora Gentoo畫面抓圖使用 menuconfig 設(shè)定核心
責(zé)任編輯:佚名 來源: CSDN
相關(guān)推薦

2010-03-03 10:37:05

Linux ifcon

2014-08-08 14:26:13

?i?f?c?o?n?linux

2010-01-12 15:55:18

Fedora 6網(wǎng)絡(luò)

2013-11-12 10:15:59

FedoraFedora 20ARM

2010-03-18 17:13:52

Linux命令

2010-01-12 10:05:22

Fedora Core

2010-01-11 10:35:56

2010-01-18 10:15:53

Fedora編程環(huán)境

2010-01-12 15:37:01

vmware配置

2010-08-02 17:16:10

Fedora10 NF

2009-12-28 16:36:06

Fedora Samb

2009-12-17 09:56:01

FedoraPPStream網(wǎng)絡(luò)電視

2009-12-28 11:27:34

Fedora Core

2010-03-17 13:39:42

Fedora 顯示

2010-03-17 13:30:09

Fedora 顯示

2009-11-23 10:10:45

FedoraFirefox 加速

2010-03-17 14:40:56

Fedora core

2010-01-11 16:45:34

Fedora 10安裝

2010-01-12 17:56:21

Fedora vim

2010-02-26 14:03:11

Fedora vsft
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)