当前位置:网站首页>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
边栏推荐
- Redis practice notes and source code analysis
- Prometheus Thanos快速指南
- Will restarting the Oracle listener break the existing connection
- [step by step, even thousands of miles] MySQL reports a large number of unauthenticated user connection errors
- How to use DBA_ hist_ active_ sess_ History analysis database history performance problems
- Ansible basic commands, roles, built-in variables and tests judgment
- try catch 不能捕获异步错误
- Oracle性能分析工具:OSWatcher
- Introduction to RDMA network
- 异常记录-22
猜你喜欢
随机推荐
基于ECS搭建云上博客(云小宝码上送祝福,免费抽iphone13任务详解)
将数组中指定的对象排在数组的前边
关于 synchronized、ThreadLocal、线程池、Atomic 原子类的 JUC 面试题
Implementation of leetcode question brushing str ()
virtio 与vhost_net介绍
【Lombok快速入门】
JS performance optimization
MySQL【sql性能分析+sql调优】
Chaos带你快速上手混沌工程
Openvswitch compilation and installation
Web登录小案例(含验证码登录)
[OSS file upload quick start]
Ansible basic commands, roles, built-in variables and tests judgment
rdam 原理解析
TC ebpf practice
基于DPDK实现VPC和IDC间互联互通的高性能网关
你应该知道的 JVM 基础知识
ovs与ovs+dpdk架构分析
Thanos如何为不同租户配置不同的数据保留时长
异常记录-12