Linux下常用設定檔

來源:互聯網
上載者:User

/etc/sysconfig/network 包括主機基本網路資訊,用於系統啟動

/etc/sysconfig/network-script/ 此目錄下是系統啟動最初始化網路的資訊

/etc/sysconfig/network-script/ifcfg-eth0 網路設定資訊

/etc/xinetd.conf 定義了由超級進程XINETD啟動的網路服務

/etc/protocols 設定了主機使用的協議以及各個協議的協議號

/etc/services 設定了主機的不同連接埠的網路服務

// 網路設定工具

# redhat-config-network

 /* 使用ifconfig命令配置並查看網路介面情況 */

//配置eth0的IP,同時啟用裝置

# ifconfig eth0 192.168.168.119 netmask 255.255.255.0 up

//配置eth0別名裝置 eth0:1 的IP,並添加路由

# ifconfig eth0:1 192.168.168.110

# route add –host 192.168.168.110 dev eth0:1

//啟用(禁用)裝置

# ifconfig eth0:1 up(down)

//查看所有(指定)網路介面配置

# ifconfig (eth0)

 /* 使用route 命令配置路由表 */

//添加到主機路由

# route add –host 192.168.168.110 dev eth0:1

# route add –host 192.168.168.119 gw 192.168.168.1

//添加到網路的路由

# route add –net IP netmask MASK eth0

# route add –net IP netmask MASK gw IP

# route add –net IP/24 eth1

//添加預設閘道

# route add default gw IP

//刪除路由

# route del –host 192.168.168.110 dev eth0:1

 /* 常用命令 */

# traceroute www.pconline.com.cn

# ping www.pconline.com.cn

//顯示網路介面狀態資訊

# netstat –I

//顯示所有監控的伺服器的Socket和正在使用Socket的程式資訊

# netstat –lpe

//顯示核心路由表資訊

# netstat –r

# netstat –nr

//顯示TCP/UDP傳輸協議的串連狀態

# netstat –t

# netstat –u

//更改主機名稱

# hostname myhost

//查看ARP緩衝

# arp

//添加

# arp –s IP MAC

//刪除

# arp –d IP

 /* 運行層級與網路服務 */

//查看當前運行層級

# runlevel

//運行層級的切換

# init

# telinit

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.