试了下,果然全部可以ping通,为什么呢,什么导致造成如此惊人假象[/quote]
试了下,果然全部可以ping通,为什么呢,什么导致造成如此惊人假象[/quote]
Loopback IP Addresses
The IP address range 127.0.0.0 – 127.255.255.255 is reserved for loopback i.e. a Host’s self-address. Also known as localhost address. This loopback IP address is managed entirely by and within the operating system. Using loopback addresses, enable the Server and Client processes on a single system to communicate with each other. When a process creates a packet with destination address as loopback address, the operating system loops it back to itself without having any interference of NIC.
Data sent on loopback is forward by the operating system to a virtual network interface within operating system. This address is mostly used for testing purposes like client-server architecture on a single machine. Other than that, if a host machine can successfully ping 127.0.0.1 or any IP from loopback range, implies that the TCP/IP software stack on the machine is successfully loaded and working.
这是我找到的一段英文说明, 说127.x.x.x/8 被预留位loopback 的地址空间, 每个范围内的IP都代表本机
这应该可以解释配置lo:0 为一个网段时 的2种情况
1) 任意IP都能ping通(因为都代表本机)
2) eth0 ping不通(因为被OS预留了)[/quote]
但是我把 lo:0 的子网掩码设置为255.255.255.255之后,外面的电脑就可以正常ping这台Linux电脑呢,而且可以ping eth0和lo:0两个都可以。[/quote]
子网掩码设置为255.255.255.255的时候 ,被OS预留的IP只有一个IP 192.168.100.229
eth0的IP地址可以正常工作,所以外部可以ping通eth0。
至于能ping通lo:0, 我抓包试验了一下,所有的ICMP包还是经过eth0转发的.
这边我觉得还是由于eth0 和lo:0配置了同一个网段,而lo:0又实际上是虚接口导致的
这个理解可能有点问题!
不过楼主不同接口还是应该配置不同网段的IP
试了下,果然全部可以ping通,为什么呢,什么导致造成如此惊人假象[/quote]
试了下,果然全部可以ping通,为什么呢,什么导致造成如此惊人假象[/quote]
Loopback IP Addresses
The IP address range 127.0.0.0 – 127.255.255.255 is reserved for loopback i.e. a Host’s self-address. Also known as localhost address. This loopback IP address is managed entirely by and within the operating system. Using loopback addresses, enable the Server and Client processes on a single system to communicate with each other. When a process creates a packet with destination address as loopback address, the operating system loops it back to itself without having any interference of NIC.
Data sent on loopback is forward by the operating system to a virtual network interface within operating system. This address is mostly used for testing purposes like client-server architecture on a single machine. Other than that, if a host machine can successfully ping 127.0.0.1 or any IP from loopback range, implies that the TCP/IP software stack on the machine is successfully loaded and working.
这是我找到的一段英文说明, 说127.x.x.x/8 被预留位loopback 的地址空间, 每个范围内的IP都代表本机
这应该可以解释配置lo:0 为一个网段时 的2种情况
1) 任意IP都能ping通(因为都代表本机)
2) eth0 ping不通(因为被OS预留了)[/quote]
但是我把 lo:0 的子网掩码设置为255.255.255.255之后,外面的电脑就可以正常ping这台Linux电脑呢,而且可以ping eth0和lo:0两个都可以。
试了下,果然全部可以ping通,为什么呢,什么导致造成如此惊人假象[/quote]
Loopback IP Addresses
The IP address range 127.0.0.0 – 127.255.255.255 is reserved for loopback i.e. a Host’s self-address. Also known as localhost address. This loopback IP address is managed entirely by and within the operating system. Using loopback addresses, enable the Server and Client processes on a single system to communicate with each other. When a process creates a packet with destination address as loopback address, the operating system loops it back to itself without having any interference of NIC.
Data sent on loopback is forward by the operating system to a virtual network interface within operating system. This address is mostly used for testing purposes like client-server architecture on a single machine. Other than that, if a host machine can successfully ping 127.0.0.1 or any IP from loopback range, implies that the TCP/IP software stack on the machine is successfully loaded and working.
这是我找到的一段英文说明, 说127.x.x.x/8 被预留位loopback 的地址空间, 每个范围内的IP都代表本机
这应该可以解释配置lo:0 为一个网段时 的2种情况
1) 任意IP都能ping通(因为都代表本机)
2) eth0 ping不通(因为被OS预留了)