Java 虚拟机中的本地主机地址
我正在服务器上使用虚拟机。 我的虚拟机本地IP是Java 虚拟机中的本地主机地址,java,linux,networking,jmf,Java,Linux,Networking,Jmf,我正在服务器上使用虚拟机。 我的虚拟机本地IP是192.168.1.10 我正在尝试实现一些要求我编辑此链接中提供的/etc/hosts的功能 我的控制台显示,我也有类似的问题 RTP--- :DataAddress: /192.168.1.10 ControlAddress: /192.168.1.10 DataPort: 42050 ControlPort: 42051 java.io.IOException: Local Data AddressDoes not belong to an
192.168.1.10
我正在尝试实现一些要求我编辑此链接中提供的/etc/hosts
的功能
我的控制台显示,我也有类似的问题
RTP--- :DataAddress: /192.168.1.10
ControlAddress: /192.168.1.10
DataPort: 42050
ControlPort: 42051
java.io.IOException: Local Data AddressDoes not belong to any of this hosts local interfaces
java.io.IOException: Local Data AddressDoes not belong to any of this hosts local interfaces
at org.speechforge.cairo.rtp.RTPConsumer.init(RTPConsumer.java:181)
at org.speechforge.cairo.rtp.RTPConsumer.<init>(RTPConsumer.java:95)
at org.speechforge.cairo.rtp.server.RTPStreamReplicator.<init> (RTPStreamReplicator.java:69)
那么,我应该用我的192.168.1.10
或者我应该创建一个别名,比如127.0.0.1/192.168.1.10
或者我应该把192.168.1.10
粘贴到顶部作为
192.168.1.10
127.0.0.1 localhost
127.0.1.1 SparkVM104
感谢您的帮助
关于。关于
/etc/hosts
的格式是
IP_address canonical_hostname [aliases...]
(请参阅),因此要首先列出192.168.1.10,文件/etc/hosts
必须如下所示:
192.168.1.10 SomeHostName SomeOtherHostName
127.0.0.1 localhost
在/etc/hosts中,localhost应该映射到127.0.0.1,而不是别的,外部主机名映射到外部IP地址,而不是别的。某些Linux发行版违反了此规则,它破坏了一切。您的建议与引用不一致。引用中的示例显示了映射到
127.0.0.1
的localhost
,以及映射到外部IP地址的外部主机名。这是有效的配置。你的不会。我重新阅读了手册页,没有找到一段明确指出禁止在环回接口中使用别名的段落。它实际上可以在Ubuntu 11.10和MacOS X 10.7上运行。尽管如此,我还是改变了这个例子,因为我明白你的意思,希望能有一个指向讨论这个问题的某种文档或RFC的指针。快速的谷歌搜索并不是很成功。
192.168.1.10 SomeHostName SomeOtherHostName
127.0.0.1 localhost