小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

基本網(wǎng)絡配置

 ALinux 2007-03-24
一、基本配置文件
/etc/hosts
將IP地址和主機名聯(lián)系起來的簡單文本文件
127.0.0.1       nameserver      localhost.localdomain   localhost #IP地址  主機名 完整主機名 別名
/etc/services
端口號和標準服務之間的對應關系。服務器和客戶端的程序便能夠把服務的名字轉成端口號。
# 21 is registered to ftp, but also used by fsp
ftp             21/tcp
ftp             21/udp          fsp fspd #主機服務名 端口號/端口類型 別名
ssh             22/tcp                          # SSH Remote Login Protocol
ssh             22/udp                          # SSH Remote Login Protocol
telnet          23/tcp
telnet          23/udp
/etc/sysconfig/network
用于指定所期望的網(wǎng)絡配置信息。(主機的網(wǎng)絡配置,不針對某一個設備)
NETWORKING=yes
HOSTNAME=nameserver
二、可執(zhí)行腳本和命令
/etc/rc.d/init.d/network {start|stop|restart|reload|status} =service network restart
系統(tǒng)啟動時的初始化腳本程序。主要調用/etc/sysconfig/network-scripts/目錄相關腳本程序
/etc/sysconfig/network-scripts/ifdown | /etc/sysconfig/network-scripts/ifup
其實是調用/sbin/ifup或/sbin/ifdown
參數(shù)配置文件/etc/sysconfig/networking/devices/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
BROADCAST=192.168.10.255
IPADDR=192.168.10.5
NETMASK=255.255.255.0
NETWORK=192.168.10.0
ONBOOT=yes
USERCTL=no
PEERDNS=no
TYPE=Ethernet
ifconfig
用來在系統(tǒng)內核表中設置或讀取網(wǎng)絡設備參數(shù)。
顯示、激活、關閉網(wǎng)絡設備;顯示、添加、刪除網(wǎng)絡設備的地址信息及狀態(tài)
 ifconfig --help #語法
Usage:
  ifconfig [-a] [-i] [-v] [-s] <interface> [[<AF>] <address>]
  [add <address>[/<prefixlen>]]
  [del <address>[/<prefixlen>]]
  [[-]broadcast [<address>]]  [[-]pointopoint [<address>]]
  [netmask <address>]  [dstaddr <address>]  [tunnel <address>]
  [outfill <NN>] [keepalive <NN>]
  [hw <HW> <address>]  [metric <NN>]  [mtu <NN>]
  [[-]trailers]  [[-]arp]  [[-]allmulti]
  [multicast]  [[-]promisc]
  [mem_start <NN>]  [io_addr <NN>]  [irq <NN>]  [media <type>]
  [txqueuelen <NN>]
  [[-]dynamic]
  [up|down] ...
#ifconfig   #查看網(wǎng)卡參數(shù)
#ifconfig eth0 up|down #啟動|關閉網(wǎng)卡
#ifconfig eth0 192.168.0.2 netmask 255.255.255.0 #為網(wǎng)卡設IP地址

netconfig #網(wǎng)絡設備配置工具。將配置參數(shù)寫入 /etc/sysconfig/network-scripts/ifcfg-eth0
redhat-config-network gui #圖形界面
system-config-network-cmd tui #AS4下命令
***************************************************************************************
補充:
#ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx  #手工改網(wǎng)卡的MAC地址
#ifconfig eth0:0 192.168.200.9 netmask 255.255.255.0 broadcast 192.168.200.255 #網(wǎng)卡添加一個IP地址(eth0的別名、eth0:0、eth0:1、.......)
兩塊網(wǎng)卡:在/etc/modules.conf加:
alias eth1 ne-pci
/etc/sysconfig/networking/devices/ifcfg-eth0 #修改后要/etc/rc.d/init.d/network restart才生效
netconfig #修改后要/etc/rc.d/init.d/network restart才生效
netconfig 將配置參數(shù)寫入 /etc/sysconfig/network-scripts/ifcfg-eth0
ifconfig #修改后立即生效,但重啟后丟失。
***************************************************************************************
三、設置DHCP客戶端
1、通過netconfig
2、ifconfig -dynamic
3、修改/etc/sysconfig/networking/devices/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none  #=dhcp
四、DNS
cat /etc/host.conf
 order hosts,bind
/etc/nsswitch.conf
passwd:     files
shadow:     files
group:      files
hosts:      files dns    #先查hosts文件再查DNS
/etc/resolv.conf
nameserver 127.0.0.1 #DNS服務器IP地址
nameserver 192.168.10.5
search test.com #域名查詢順序
五、路由與網(wǎng)絡連通性
ping #連通性測試
route #路由設置及管理
#route
#route add -net 192.168.213.0 netmask 255.255.255.0 dev eth0 #等同下一條命令
#route add -net 192.168.213.0 netmask 255.255.255.0 gw 192.168.10.5
#route del -net 192.168.213.0 netmask 255.255.255.0
#route -C #查看路由緩存表
#route -n #查看路由信息
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
61.235.103.1    0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
192.168.10.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         61.235.103.1    0.0.0.0         UG    0      0        0 ppp0
traceroute路由測試
#traceroute yahoo.com.cn
 1  * * *
 2  61.235.96.165 (61.235.96.165)  2.663 ms  1.709 ms  1.551 ms
 3  61.235.96.129 (61.235.96.129)  1.773 ms  1.847 ms  1.755 ms
# arp #查看arp緩存
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.10.100           ether   00:14:85:DC:3D:3A   C                     eth0
# hostname #查看更改主機名
nameserver
# netstat #查看IP協(xié)議狀態(tài)、套接字、接口狀態(tài)等
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      2 192.168.10.5:telnet     192.168.10.100:xtel     ESTABLISHED
tcp        0      0 nameserver:33606        nameserver:ipp          TIME_WAIT
tcp        0      0 nameserver:33607        nameserver:ipp          TI

    本站是提供個人知識管理的網(wǎng)絡存儲空間,所有內容均由用戶發(fā)布,不代表本站觀點。請注意甄別內容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權內容,請點擊一鍵舉報。
    轉藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多