当前位置:网站首页>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
边栏推荐
猜你喜欢

冬季实战营 动手实战-初识上云基础,动手实操ECS云服务器新手上路 领鼠标 云小宝 背包 无影

rdma 介绍

使用prom-label-proxy实现Prometheus Thanos的基于标签的多租户读

surprise库中evaluate函数弃用解决方法

基於DPDK實現VPC和IDC間互聯互通的高性能網關

Introduction to common APIs for EBFP programming

Implementation of leetcode question brushing str ()

Thanos Compact组件测试总结(处理历史数据)

Binary sum of leetcode questions

try catch 不能捕获异步错误
随机推荐
用Future与CountDownLatch实现多线程执行多个异步任务,任务全部完成后返回结果
Build a cloud blog based on ECS (send blessings on the cloud Xiaobao code and draw iphone13 for free)
ubuntu下搭建mysql环境 & 初识SQL
异常记录-13
Oracle性能分析工具:OSWatcher
Ansible基本命令、角色、内置变量与tests判断
Introduction to RDMA
将数组中指定的对象排在数组的前边
Chaos带你快速上手混沌工程
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
volatile 关键字的三大特点【数据可见性、指令禁止重排性、不保证操作原子性】
异常记录-19
Thanos Compact组件测试总结(处理历史数据)
Introduction to DDoS attack / defense
Passerelle haute performance pour l'interconnexion entre VPC et IDC basée sur dpdk
Common views of Oracle database performance analysis
修改Jupyter Notebook样式
异常记录-17
【漏网之鱼】Ansible AWX调用playbook传参问题
Typescript (top)