当前位置:网站首页>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
边栏推荐
猜你喜欢
Practice of openvswitch VLAN network
阅读笔记:Meta Matrix Factorization for Federated Rating Predictions
[ES6 quick start]
ebfp编程常用API介绍
Winter combat camp hands-on combat - first understand the cloud foundation, hands-on practice ECS ECS ECS novice on the road to get the mouse cloud Xiaobao backpack shadowless
rdma 编程详解
通过源码探究@ModelAndView如何实现数据与页面的转发
Redis FAQ
ubuntu下搭建mysql环境 & 初识SQL
OVS and OVS + dpdk architecture analysis
随机推荐
冬季实战营 动手实战-MySQL数据库快速部署实践 领鼠标 云小宝
ubuntu下搭建mysql环境 & 初识SQL
基於ECS搭建雲上博客(雲小寶碼上送祝福,免費抽iphone13任務詳解)
异常记录-6
JS performance optimization
JS realizes modal box dragging
How to use DBA_ hist_ active_ sess_ History analysis database history performance problems
rdma 介绍
Ansible basic commands, roles, built-in variables and tests judgment
异常记录-9
High performance gateway for interconnection between VPC and IDC based on dpdk
js 格式化当前时间 日期推算
Typescript (lower)
[OSS file upload quick start]
volatile 关键字的三大特点【数据可见性、指令禁止重排性、不保证操作原子性】
DDOS攻击/防御介绍
异常记录-20
The arithmetic square root of X in leetcode
Memcached source code analysis
ES6 specification details