下一页 上一页 目录

9. 网络参数

我们将建立一个具有以下 IP 配置的 PLIP 点对点网络

您的命名空间中不应已存在这些名称

     $ ping source
     ping: unknown host source
     
     $ ping target
     ping: unknown host target
    

您的网络空间中不应已存在这些 IP 地址

     $ ping  192.168.0.1
     PING 192.168.0.1 (192.168.0.1): 56 data bytes
     ping: sendto: Network is unreachable
     ping: wrote 192.168.0.1 64 chars, ret=-1
     
     --- 192.168.0.1 ping statistics ---
     1 packets transmitted, 0 packets received, 100% packet loss
     
     $ ping 192.168.0.2
     PING 192.168.0.2 (192.168.0.2): 56 data bytes
     ping: sendto: Network is unreachable
     ping: wrote 192.168.0.2 64 chars, ret=-1
     
     --- 192.168.0.2 ping statistics ---
     1 packets transmitted, 0 packets received, 100% packet loss
    

如果这些命令没有报错,请更改名称或地址。

您可以选择其他地址、名称或子网掩码(两侧的子网掩码必须相同)。在本文档的其余部分,我将假设您选择了这些地址和这些名称。

/etc/exports 中添加一行

     #### file /etc/exports ####
     ...
     /cdrom          source(ro) target(ro)
     #### EOF ####
     

由于端口映射器尝试解析 IP 地址,请将 IP 地址和名称添加到 /etc/hosts

     #### file /etc/hosts ####
     ...
     192.168.0.1     target
     192.168.0.2     source
     #### EOF ####
    

验证文件 /etc/nsswitch.conf 中,hosts 搜索列表中是否包含 files

     #### file /etc/nsswitch.conf ####
     ...
     hosts:      files nis dns
     ...
     #### EOF ####
    


下一页 上一页 目录