Home | 簡體中文 | 繁體中文 | 雜文 | Search | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 作品與服務 | Email

第 13 章 Networking

目錄

13.1. hosts
13.1.1. hostnamectl - Control the system hostname
13.1.2. /etc/hostname
13.1.3. /etc/host.conf
13.1.4. /etc/hosts
13.1.5. hosts.allow / hosts.deny
13.1.6. /etc/resolv.conf
13.2. Hostname
13.3. Network adapter
13.3.1. 介面名稱
13.4. Ethernet Interfaces
13.4.1. ifquery
13.4.2. DHCP
13.4.3. Static IP
13.5. Mask
13.6. Gateway
13.7. Configuring Name Server Lookups
13.8. IP forwarding(IP轉發)
13.9. bonding
13.9.1. Ubuntu
13.10. Finding optimal MTU
13.11. wireless
13.11.1. rfkill - tool for enabling and disabling wireless devices
13.11.2. iwlist - Get more detailed wireless information from a wireless interface
13.11.3. iwconfig - configure a wireless network interface
13.11.4. /proc/net/wireless
13.12. CentOS 網絡配置
13.12.1. Gateway
13.12.2. bonding
13.12.3. brctl
13.12.4. nmtui

13.1. hosts

13.1.1. hostnamectl - Control the system hostname

[root@localhost ~]# hostnamectl
   Static hostname: localhost.localdomain
         Icon name: computer-desktop
           Chassis: desktop
        Machine ID: 072e88a0fdd2447296554f3cd5129076
           Boot ID: a978056f50544355abd723b328a89b6f
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-229.el7.x86_64
      Architecture: x86_64
			

13.1.2. /etc/hostname

# cat /etc/hostname
web1.example.com
			
		
# cat -n /etc/hosts
     1  # Do not remove the following line, or various programs
     2  # that require network functionality will fail.
     3  127.0.0.1               development.domain.org development localhost.localdomain localhost
     4  ::1             localhost6.localdomain6 localhost6

		
		

13.1.3. /etc/host.conf

解析順序配置檔案

[root@development bin]# cat /etc/host.conf
order hosts,bind
			

首先在/etc/hosts檔案中尋找,如果不存在,再去DNS伺服器中尋找

13.1.4. /etc/hosts

IP地址後面TAB符,然後寫主機地址

127.0.0.1       localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6
192.168.1.10	development.example.com development
			

13.1.5. hosts.allow / hosts.deny

/etc/hosts.allow 和 /etc/hosts.deny

許可IP/禁止IP,相當於黑白名單

13.1.6. /etc/resolv.conf

			
search example.com
nameserver 208.67.222.222
nameserver 208.67.220.220
			
			
comments powered by Disqus