如何在Ubuntu上创建逻辑环回?
如何创建逻辑本地环回, 就像 Juniper路由器的过程一样 。 ( 不是在谈论127.0.0.1 )
配置本地环回操作
要在不将发送端口物理连接到接收端口的情况下配置本地环回,请执行以下步骤:
在配置模式下,转到以下层次结构级别:
[编辑]
user @ host#edit interfaces interface-name(fastether-options | gigether-options)
配置本地环回:
[编辑接口interface-name(fastether-options | gigether-options)]
user @ host #set loopback
容易死(如果你知道怎么做)
sudo ifdown eth0 gksudo gedit /etc/network/interfaces
将以下内容添加到最后:
auto eth0 allow-hotplug eth0 iface eth0 inet loopback iface eth0 inet static address 192.168.200.200 netmask 255.255.255.0
执行:
sudo ifup eth0
Presto:软件中的eth0环回!
ping 192.168.200.200 PING 192.168.200.200 (192.168.200.200) 56(84) bytes of data. 64 bytes from 192.168.200.200: icmp_seq=1 ttl=64 time=0.073 ms 64 bytes from 192.168.200.200: icmp_seq=2 ttl=64 time=0.042 ms 64 bytes from 192.168.200.200: icmp_seq=3 ttl=64 time=0.069 ms 64 bytes from 192.168.200.200: icmp_seq=4 ttl=64 time=0.044 ms ^C --- 192.168.200.200 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 2997ms rtt min/avg/max/mdev = 0.042/0.057/0.073/0.014 ms