linux设置静态IP并挂载本机文件夹
设置静态ip
1.首先在设置静态IP的时候要先把联网改成桥接模式;
cd etc/sysconfig/network-script/ /进入网卡配置文件包 ip a /查看所有网卡 ethtool enpsX /查看网卡信息,确定可用网卡 vim ifcfg-enpsX /编辑可用网卡配置文件,使用tab键补全 /#
2.将连接方式dhcp改为static
添加以下字段
ONBOOT=yes NETMASK= 255.255.255.0 GATEWAY= 192.168.1.1 IPADDR=192.168.1.X #/
3.修改dns配置文件
vim /etc/resove.conf /进入dns配置文件 添加以下字段 /#nameserver 192.168.1.1 nameserver 8.8.8.8 #/ systemctl restart network /重启网络 测试:ping x
挂载文件夹
2.wmwaretools是在/usr/bin vmware-config-pl 执行./vmware-config.pl即可
3.安装完成后 yum install open-vm-tools4.最后在/mnt/hgfs 后面挂载 mount -t vmhgfs .host:/voyager /mnt/hgfs
上一条可能失效请用这两条实现
5.sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other
6.在 /etc/fstab中加一条 .host:/ /mnt/hgfs fuse.vmhgfs-fuse allow_other 0 0