当前位置:网站首页>How does VirtualBox modify the IP network segment assigned to the virtual machine in the "network address translation (NAT)" network mode
How does VirtualBox modify the IP network segment assigned to the virtual machine in the "network address translation (NAT)" network mode
2022-04-23 07:04:00 【A sunny afternoon】
stay NAT In mode , Assigned to the virtual machine IP Address defaults to 10.0.x.0/24. among x Is the network card number +1, For example 1 The network card is enabled NAT Pattern , Is assigned to the virtual machine by default IP The address is 10.0.2.15, Gateway is 10.0.2.2.
If you need to modify the default network segment , You can use the following command :
cd "C:\Program Files\Oracle\VirtualBox"
.\VBoxManage.exe list vms
"k8s-master" {bdd664c6-4292-4c05-89ff-c09219bf0bfa}
"k8s-worker1" {6e83cf63-597b-4c03-8836-11311deb04ac}
"k8s-worker2" {8b2e1124-84fc-47a6-8466-e6adc57bf82e}
"k8s-worker3" {b2fd6bc9-01c0-4873-bd87-ca9183de6edd}
# modify k8s-worker3 Of the first network card NAT Subnet segment
.\VBoxManage modifyvm "k8s-worker3" --natnet1 "172.0.0.0/24"
# modify k8s-worker3 Of the second network card NAT Subnet segment , And so on
.\VBoxManage modifyvm "k8s-worker3" --natnet2 "172.0.0.0/24"
Restart the virtual machine after modification , You can see that the network card address has changed to the network segment we defined :
enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.0.0.15 netmask 255.255.255.0 broadcast 172.0.0.255
inet6 fe80::8758:99e2:303e:7f4 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:af:ed:37 txqueuelen 1000 (Ethernet)
RX packets 130 bytes 13622 (13.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 162 bytes 20843 (20.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Reset to the default value if necessary , Then specify the network segment again as default that will do :
.\VBoxManage modifyvm "k8s-worker3" --natnet1 default
.\VBoxManage modifyvm "k8s-worker3" --natnet2 default
版权声明
本文为[A sunny afternoon]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230600558925.html
边栏推荐
猜你喜欢
SQL学习|窗口函数
基於ECS搭建雲上博客(雲小寶碼上送祝福,免費抽iphone13任務詳解)
阅读笔记:Meta Matrix Factorization for Federated Rating Predictions
High performance gateway for interconnection between VPC and IDC based on dpdk
SQL学习|复杂查询
Prometheus的relabel_configs和metric_relabel_configs解释及用法示例
Kids and COVID: why young immune systems are still on top
实践使用PolarDB和ECS搭建门户网站
Construire un blog Cloud basé sur ECS (bénédiction sur le Code Cloud Xiaobao, explication détaillée de la tâche iphone13 gratuite)
使用prom-label-proxy实现Prometheus Thanos的基于标签的多租户读
随机推荐
使用百度智能云人脸检测接口实现照片质量检测
异常记录-17
Prometheus监控influxdb的方法及指标释义
Passerelle haute performance pour l'interconnexion entre VPC et IDC basée sur dpdk
Prometheus Thanos与Cortex组件比较
Redis FAQ
Oracle net service: listener and service name resolution method
BCC installation and basic tool instructions
用Future与CountDownLatch实现多线程执行多个异步任务,任务全部完成后返回结果
SSM项目在阿里云部署
阅读笔记:Meta Matrix Factorization for Federated Rating Predictions
冬季实战营 动手实战-初识上云基础,动手实操ECS云服务器新手上路 领鼠标 云小宝 背包 无影
Kubernetes CoreDNS常见问题资料参考
How to use tiup to deploy a tidb V5 0 cluster
rdma 编程详解
MySQL【ACID+隔离级别+ redo log + undo log】
异常记录-9
异常记录-14
异常记录-5
Winter combat camp hands-on combat - cloud essential environment preparation, hands-on practical operation, quickly build lamp environment, lead mouse cloud Xiaobao backpack without shadow