網(wǎng)工知識(shí)問(wèn)答精華(十二)考試大整理收集
●Linux、Unix下的網(wǎng)絡(luò)配置命令
一、 Linux、Unix下的網(wǎng)絡(luò)配置命令:
1 網(wǎng)卡配置
Ifconfig interface[family] address up option
Interface 設(shè)備名,le0 、we0
Family :綁定的網(wǎng)絡(luò)協(xié)議,默認(rèn)為IP(inet)
Address:地址,可以ip地址,可以是主機(jī)名字(通過(guò)/etc/hosts或DNS找到IP)
Up: (down)啟動(dòng)或關(guān)閉
Option:子網(wǎng)掩碼、廣播地址等
2 靜態(tài)路由 route
Route [-f] op [type] destination gateway hop-count
Op:add 增加一個(gè)路由表項(xiàng) delete 刪除一個(gè)路由表項(xiàng)
Destination:主機(jī)地址或網(wǎng)絡(luò)地址或關(guān)鍵字default
Gateway:收到目的地址是Destination時(shí),轉(zhuǎn)發(fā)的機(jī)器(該機(jī)器必須和當(dāng)前主機(jī)是一個(gè)網(wǎng)絡(luò)內(nèi)直連)
hop-count:轉(zhuǎn)發(fā)次數(shù),通常為1
F:刪除所有路由表項(xiàng)
Type:取值host 表示Destination是主機(jī)
取值net 表示Destination是網(wǎng)絡(luò)地址
3 routed 標(biāo)準(zhǔn)路由daemon(守護(hù)進(jìn)程)
– 只支持RIP協(xié)議
– 兩種運(yùn)行方式:
服務(wù)器模式(-s):發(fā)布自己的路由信息
– 多網(wǎng)卡的服務(wù)器中設(shè)置成該模式
安靜模式(-q):只是監(jiān)聽廣播包,默認(rèn)方式
4 gated 更好的路由daemon
– 支持不同的路由協(xié)議(RIP、OSPF、BGP/EGP、HELLO)
– 需要配置文件(/etc/gated.conf)進(jìn)行路由描述
2、啟動(dòng)服務(wù)(httpd)的兩種方法:
1) 獨(dú)立方式 standalone
命令格式:httpd [-d 目錄] [-f 文件]
目錄:ServerRoot 指定的項(xiàng)
文件:系統(tǒng)配置文件httpd.conf,
默認(rèn): /usr/local/etc/httpd /conf/ httpd.conf
2) 系統(tǒng)啟動(dòng)inted
(1) 修改/etc/services文件
加入:http 端口號(hào) /tcp ;端口號(hào) 在httpd.conf中定義的
(2) 修改/etc/inted.conf文件
加入: http stream tcp nowait nobody /路徑 /httpd
路徑 : 如 /usr/local/etc/httpd ; httpd的絕對(duì)路徑
(3)重啟系統(tǒng)
ps 查找inted 的進(jìn)程號(hào) pid
Kill-HUP inted pid;向inted發(fā)起掛起信號(hào)HUP,inted 重新讀取 /etc/inted.conf文件
二、 DNS配置
1 啟動(dòng)運(yùn)行 /usr/sbin/ named
2 相關(guān)文件:
/etc/named.boot :包含一些指向包含區(qū)信息的主文件。
區(qū)文件:named.cache等。
●Linux、Unix下的網(wǎng)絡(luò)配置命令
一、 Linux、Unix下的網(wǎng)絡(luò)配置命令:
1 網(wǎng)卡配置
Ifconfig interface[family] address up option
Interface 設(shè)備名,le0 、we0
Family :綁定的網(wǎng)絡(luò)協(xié)議,默認(rèn)為IP(inet)
Address:地址,可以ip地址,可以是主機(jī)名字(通過(guò)/etc/hosts或DNS找到IP)
Up: (down)啟動(dòng)或關(guān)閉
Option:子網(wǎng)掩碼、廣播地址等
2 靜態(tài)路由 route
Route [-f] op [type] destination gateway hop-count
Op:add 增加一個(gè)路由表項(xiàng) delete 刪除一個(gè)路由表項(xiàng)
Destination:主機(jī)地址或網(wǎng)絡(luò)地址或關(guān)鍵字default
Gateway:收到目的地址是Destination時(shí),轉(zhuǎn)發(fā)的機(jī)器(該機(jī)器必須和當(dāng)前主機(jī)是一個(gè)網(wǎng)絡(luò)內(nèi)直連)
hop-count:轉(zhuǎn)發(fā)次數(shù),通常為1
F:刪除所有路由表項(xiàng)
Type:取值host 表示Destination是主機(jī)
取值net 表示Destination是網(wǎng)絡(luò)地址
3 routed 標(biāo)準(zhǔn)路由daemon(守護(hù)進(jìn)程)
– 只支持RIP協(xié)議
– 兩種運(yùn)行方式:
服務(wù)器模式(-s):發(fā)布自己的路由信息
– 多網(wǎng)卡的服務(wù)器中設(shè)置成該模式
安靜模式(-q):只是監(jiān)聽廣播包,默認(rèn)方式
4 gated 更好的路由daemon
– 支持不同的路由協(xié)議(RIP、OSPF、BGP/EGP、HELLO)
– 需要配置文件(/etc/gated.conf)進(jìn)行路由描述
2、啟動(dòng)服務(wù)(httpd)的兩種方法:
1) 獨(dú)立方式 standalone
命令格式:httpd [-d 目錄] [-f 文件]
目錄:ServerRoot 指定的項(xiàng)
文件:系統(tǒng)配置文件httpd.conf,
默認(rèn): /usr/local/etc/httpd /conf/ httpd.conf
2) 系統(tǒng)啟動(dòng)inted
(1) 修改/etc/services文件
加入:http 端口號(hào) /tcp ;端口號(hào) 在httpd.conf中定義的
(2) 修改/etc/inted.conf文件
加入: http stream tcp nowait nobody /路徑 /httpd
路徑 : 如 /usr/local/etc/httpd ; httpd的絕對(duì)路徑
(3)重啟系統(tǒng)
ps 查找inted 的進(jìn)程號(hào) pid
Kill-HUP inted pid;向inted發(fā)起掛起信號(hào)HUP,inted 重新讀取 /etc/inted.conf文件
二、 DNS配置
1 啟動(dòng)運(yùn)行 /usr/sbin/ named
2 相關(guān)文件:
/etc/named.boot :包含一些指向包含區(qū)信息的主文件。
區(qū)文件:named.cache等。