在控制台中使用cat / etc / hosts找不到广播地址

时间:2014-02-05 10:22:52

标签: cmd broadcast hosts edx

我一直在尝试安装edX,其命令行指令之一是

 cat /etc/hosts

我收到的回复是

 cat /etc/hosts
 127.0.0.1  localhost
 127.0.1.1  precise64

 # The following lines are desirable for IPv6 capable hosts
 ::1     ip6-localhost ip6-loopback
 fe00::0 ip6-localnet
 ff00::0 ip6-mcastprefix
 ff02::1 ip6-allnodes
 ff02::2 ip6-allrouters

广播ip丢失了,为什么会这样?

1 个答案:

答案 0 :(得分:1)

您通常不会在/ etc / hosts文件中列出广播地址。你为什么期望在那里看到它?

什么是'edX'呢?有自己的README文件的URL?

想想看,如果你真的需要主机的广播掩码,你就是 最好使用ifconfig的变体。以下是一些例子:

(Solaris 11.x)

enter code here
$ ipadm show-addrprop -p broadcast e1000g0/v4
ADDROBJ           PROPERTY   PERM CURRENT         PERSISTENT      DEFAULT         POSSIBLE
e1000g0/v4        broadcast  r-   192.168.1.255   --              192.168.1.255   --
limoncello:jmcp $ ifconfig e1000g0
e1000g0:  flags=100001100943<UP,BROADCAST,RUNNING,PROMISC,MULTICAST,ROUTER,IPv4,PHYSRUNNING>     mtu 1500 index 2
inet 192.168.1.20 netmask ffffff00 broadcast 192.168.1.255

或者,在linux上(Debian Jessie):

 jmcp@debiant:~$ /sbin/ifconfig eth0
 eth0      Link encap:Ethernet  HWaddr 08:00:27:cd:61:7c  
      inet addr:192.168.1.249  Bcast:192.168.1.255  Mask:255.255.255.0
      inet6 addr: fe80::a00:27ff:fecd:617c/64 Scope:Link
      inet6 addr: 2001:44b8:2188:f000:a00:27ff:fecd:617c/64 Scope:Global
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:258 errors:0 dropped:0 overruns:0 frame:0
      TX packets:208 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:44119 (43.0 KiB)  TX bytes:29635 (28.9 KiB)

在Solaris主机上,我感兴趣的接口的广播地址是192.168.1.255;在Debian vm上,它是一样的。