pingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 20px; color: rgb(79, 79, 79); line-height: 30px; overflow-wrap: break-word; font-variant-ligatures: no-common-ligatures; background-color: rgb(255, 255, 255);">vmware虚拟机局域网内访问互通
需求背景
环境要求
1、获取网关,网段信息
2、开启vmware bridge
3、vmware设置
4、虚拟机设置
cp /etc/sysconfig/network-scripts/ifcfg-ens33 /etc/sysconfig/network-scripts/ifcfg-ens33_bak
IPADDR="192.168.101.114" GATEWAY="192.168.101.1" NETMASK="255.255.255.0" DNS1="114.114.114.114"
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33 TYPE="Ethernet" PROXY_METHOD="none" BROWSER_ONLY="no" BOOTPROTO="static" DEFROUTE="yes" IPV4_FAILURE_FATAL="no" IPV6INIT="yes" IPV6_AUTOCONF="yes" IPV6_DEFROUTE="yes" IPV6_FAILURE_FATAL="no" IPV6_ADDR_GEN_MODE="stable-privacy" NAME="ens33" UUID="75afc16a-1a80-4fe6-bacc-0eccfc202f87" DEVICE="ens33" ONBOOT="yes" IPADDR="192.168.101.114" GATEWAY="192.168.101.1" NETMASK="255.255.255.0" DNS1="114.114.114.114"
systemctl restart network
[root@localhost ~]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:50:56:35:ab:e0 brd ff:ff:ff:ff:ff:ff inet 192.168.101.13/24 brd 192.168.101.255 scope global noprefixroute ens33 valid_lft forever preferred_lft forever inet6 fe80::3078:750b:dcf7:d446/64 scope link noprefixroute valid_lft forever preferred_lft forever
验证
[root@localhost ~]# cat hello.txt hello [root@localhost ~]# scp hello.txt root@192.168.101.13:/root/ 输入密码
[root@localhost ~]# cat hello.txt hello [root@localhost ~]# ip a|grep 13 inet 192.168.101.13/24 brd 192.168.101.255 scope global noprefixroute ens33
本文链接:https://blog.runxinyun.com/post/185.html 转载需授权!
留言0