Home | 简体中文 | 繁体中文 | 杂文 | Search | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎专栏 | Email

第 14 章 Networking

目录

14.1. hosts
14.1.1. hostnamectl - Control the system hostname
14.1.2. /etc/hostname
14.1.3. /etc/host.conf
14.1.4. /etc/hosts
14.1.5. hosts.allow / hosts.deny
14.1.6. /etc/resolv.conf
14.2. Hostname
14.3. Network adapter
14.3.1. 接口名称
14.4. Ethernet Interfaces
14.4.1. ifquery
14.4.2. DHCP
14.4.3. Static IP
14.5. Mask
14.6. Gateway
14.7. Configuring Name Server Lookups
14.8. IP forwarding(IP转发)
14.9. bonding
14.9.1. Ubuntu
14.10. Finding optimal MTU
14.11. wireless
14.11.1. rfkill - tool for enabling and disabling wireless devices
14.11.2. iwlist - Get more detailed wireless information from a wireless interface
14.11.3. iwconfig - configure a wireless network interface
14.11.4. /proc/net/wireless
14.12. Linux IP And Router
14.12.1. netmask
14.12.1.1. iptab
14.12.1.2. netmask - a netmask generation and conversion program
14.12.2. arp - manipulate the system ARP cache
14.12.2.1. display hosts
14.12.2.2. delete a specified entry
14.12.2.3. /proc/net/arp
14.12.2.4. /etc/ethers
14.12.3. iproute2
14.12.3.1. 添加路由
14.12.3.2. 删除路由
14.12.3.3. 变更路由
14.12.3.4. 替换已有的路由
14.12.3.5. 增加默认路由
14.12.3.6. cache
14.12.4. 策略路由
14.12.5. 负载均衡
14.12.6. MASQUERADE
14.12.7. ip tunnel
14.12.8. VLAN
14.12.9. Zebra
14.13. CentOS 网络配置
14.13.1. Gateway
14.13.2. bonding
14.13.3. brctl
14.13.4. nmtui

14.1. hosts

14.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
			

14.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

		
		

14.1.3. /etc/host.conf

解析顺序配置文件

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

首先在/etc/hosts文件中寻找,如果不存在,再去DNS服务器中寻找

14.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
			

14.1.5. hosts.allow / hosts.deny

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

许可IP/禁止IP,相当于黑白名单

14.1.6. /etc/resolv.conf

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