配置
Important files
/etc/network/interfaces #ip, netmasks should be configured here.
/etc/resolv.conf #dns server should be configured here.
/etc/hosts #it is looked up before the dns is searched.
The IP address, Netmask, Network Address, Broadcast Address, and Gateway Address
are typically specified via the appropriate directives in the file /etc/network/interfaces
. The Nameserver Addresses are typically specified via nameserver
directives in the file /etc/resolv.conf
.
How to get the help?
man interfaces
man resolv.conf
man hosts
Special Nouns.
-
IP address
The IP address is a unique
identifying string expressed as four decimal numbers ranging from zero (0)
to two-hundred and fifty-five (255), separated by periods,
with each of the four numbers representing eight (8) bits of the address for a
total length of thirty-two (32) bits for the whole address. This format is called
dotted quad
notation
.
-
Netmask
The Subnet Mask (or simply,
netmask
) is a local bit mask, or set of flags
which separate the portions of an IP address significant to the network from the
bits significant to the subnetwork
. For example,
in a Class C network, the standard netmask is 255.255.255.0 which masks the first
three bytes of the IP address and allows the last byte of the IP address to
remain available for specifying hosts on the subnetwork.
-
Network Address
The Network Address represents the
bytes comprising the network portion of an IP address. For example, the host 12.128.1.2
in a Class A network would use 12.0.0.0 as the network address, where twelve (12)
represents the first byte of the IP address, (the network part) and zeroes (0)
in all of the remaining three bytes to represent the potential host values. A network
host using the private IP address 192.168.1.100
would in turn use a Network Address of 192.168.1.0, which specifies the first three
bytes of the Class C 192.168.1 network and a zero (0) for all the possible hosts on the
network.
-
Broadcast Address
The Broadcast Address is an IP address
which allows network data to be sent simultaneously to all hosts on a given subnetwork rather
than specifying a particular host. The standard general broadcast address for IP networks is
255.255.255.255, but this broadcast address cannot be used to send a broadcast message to
every host on the Internet because routers block it. A more appropriate broadcast address
is set to match a specific subnetwork. For example, on the private Class C IP network,
192.168.1.0, the broadcast address is 192.168.1.255. Broadcast messages are
typically produced by network protocols such as the Address Resolution Protocol (ARP) and the
Routing Information Protocol (RIP).
-
Gateway Address
A Gateway Address is the IP address through which
a particular network, or host on a network, may be reached. If one network host wishes to communicate
with another network host, and that host is not located on the same network, then a
gateway
must be used. In many cases, the Gateway Address will be that
of a router on the same network, which will in turn pass traffic on to other networks or hosts, such as
Internet hosts. The value of the Gateway Address setting must be correct, or your system will not be able
to reach any hosts beyond those on the same network.
-
Nameserver Address
Nameserver Addresses represent the IP addresses of Domain Name Service
(DNS) systems, which resolve network hostnames into IP addresses. There
are three levels of Nameserver Addresses, which may be specified in
order of precedence: The Primary
Nameserver, the Secondary
Nameserver, and the
Tertiary
Nameserver. In order for your system to be able to resolve network hostnames into their
corresponding IP addresses, you must specify valid Nameserver Addresses which you are authorized to use
in your system's TCP/IP configuration. In many cases these addresses can and will be provided by your
network service provider, but many free and publicly accessible nameservers are available for use, such as
the Level3 (Verizon) servers with IP addresses from
4.2.2.1 to 4.2.2.6.
Static Routing VS.Dynamic Routing
静态路由对动态路由
TCP VS. UDP
With Connections VS. without Connections.
DHCP
原理
请求IP租约:
当客户机初始化一个TCP/IP,IP寻址信息广播一个DHCPISCOVER消息,这时客户机没有IP地址,所以它使用0.0.0.0作为源地址。因为
此时客户机不知道DHCP服务器的IP地址,所以它使用255.255.255.255作为目录地址。这样把消息广播到整个子网。
提供IP租约:
DHCP服务器接受到discover的消息后,会回答一个DHCPFFER消息,这个消息包含了:客户机的硬件地址;所提供的IP地址;子网掩码;租约期限长度;服务器IP地址。
DHCP客户机花费一秒钟的时间等待提供IP地址。如果它没有接收到提供的IP地址,它就将这个请求重新广播四次,广播时间间隔2、4、8、16秒,如
果客户机经过四次请求后,还没有接收到所提供的IP地址,它就采用从169.254.X.X地址。以后再每隔5分钟,该DHCP客户机都继续尝试发现一个
DHCP服务器。
选择IP租约
DHCP客户机在接收到第一个提供(offer)消息之后,广播一个DHCPREQUEST消息作为响应,标识接受该提供。该消息包括发出提供IP信息
并且接受的服务器,然后,所有其他DHCP服务器将收回它们的提供,并将他们的IP地址保留给其他的IP租约请求使用。
确认IP租约
发出接受提供消息的DHCP服务器将广播一个DHCP确认消息(DHCPPACK),用于确认这一成功的租约。
配置文件
/etc/dhcp3/dhclient.conf
Time Ajustment
Tool
1. ntpdate
2. ntpd
这两个工具还是不太会用,以后再研究。
分享到:
相关推荐
基于tensorflow从头开始构建图神经网络-python源码.zip
从头开始对ubuntu进行优化教程,讲述安装了ubuntu系统后怎么对ubuntu系统进行优化。ubuntu系统是目前最受欢迎的linux系统,它简单易学,很容易入门哦。
从头开始对ubuntu进行优化教程.rar
BERT_从头开始训练MASK_BERT_算法训练_优质项目实战
从头开始训练Faster R-CNN-python源码.zip
live-custom-ubuntu-from-scratch:此过程显示如何从头开始创建可启动和可安装的Ubuntu Live(以及自动硬件检测和配置)
教程名称:Photoshop从头学起课程目录:【】Photoshop从头学起第(1-10)【】Photoshop从头学起第(11-20)【】Photoshop从头学起第(21-30)【】Photoshop从头学起第(31-40)【】Photoshop从头学起第(41-50)【】Photoshop...
从头学Android之多媒体--使用MediaPlayer播放音频示例代码
使用我的个人喜好以及安装的常用工具和应用程序配置Ubuntu计算机。 安装全新的Ubuntu安装后,您需要做的是安装ansible: sudo apt-get install python-pip sudo pip install ansible 完成操作后,请运行此存储库中...
cloud-image-ubuntu-from-scratch:此过程显示如何从头创建云映像Ubuntu,以在云环境(EC2,GCE,Azure,QEMU和VirtualBox)上运行
教程名称:从头开始学Oracle 11g Release 2 视频教程(15集)课程目录:【】Oracle11gRelease2视频教程_1【】Oracle11gRelease2视频教程_2【】Oracle11gRelease2视频教程_3【】Oracle11gRelease2视频教程_4【】...
从头开始学习c++的程序代码,本人会保持更新,希望对大家有所帮助
krnl4 从头开始编写的 L4 μ-kernel
magento2-blog-module-tutorial, 关于如何从头开始创建 magento 2模块的教程,带有测试 2博客模块教程这个模块是 WIP,它将被更新为每个教程我目前正在写。介绍如何从头创建完整功能的Magento 2模块。 即使有测试,...
matlab开发-从头开始的图像处理。学习matlab图像处理的基础知识
blog:目标是从头开始创建博客应用程序-Ignite Challenge 05
从头开始训练BERT代码,解压密码在https://blog.csdn.net/herosunly/article/details/113937736