ProxmoxVE 配置 NAT 网络
1. 升级系统软件包
1$ apt-get update
2$ apt-get dist-upgrade
2. 安装 ifupdown2
使用 ifupdown2 网络管理软件包,还可以实时重新加载网络配置,而无需重新启动。
1$ apt install ifupdown2
3. 配置物理网卡
使用 PVE 的 WEB 管理界面,设置物理网卡的配置。
注意:一定要分配一个静态的IP地址,否则无法正常登录 PVE
节点 > 系统 > 网络:
- address:192.168.10.66/24
- gateway:192.168.10.1
保存后应用配置
4. 配置虚拟网卡
4.1 修改虚拟网卡配置
使用 PVE 提供管理界面进行配置。 删除 vmbr0 设备的所有配置内容。
编辑 /etc/network/interfaces
1$ nano /etc/network/interfaces
加入
1source /etc/network/interfaces.d/*
1# network interface settings; autogenerated
2# Please do NOT modify this file directly, unless you know what
3# you're doing.
4#
5# If you want to manage parts of the network configuration manually,
6# please utilize the 'source' or 'source-directory' directives to do
7# so.
8# PVE will preserve these directives, but will NOT read its network
9# configuration from sourced files, so do not attempt to move any of
10# the PVE managed interfaces into external files!
11
12source /etc/network/interfaces.d/*
13
14auto lo
15iface lo inet loopback
16
17auto enp1s0
18iface enp1s0 inet static
19 address 192.168.10.66/24
20 gateway 192.168.10.1
21
22iface vmbr0 inet manual
23 bridge-ports none
24 bridge-stp off
25 brideg-fd
4.2 新建虚拟网卡配置
创建新的虚拟网卡配置
注意:给虚拟网卡指定一个新的静态地址,是为下一级网络提供NAT服务
1$ nano /etc/network/interfaces.d/vmbr0-nat
配置内容
1auto vmbr0
2# private sub network
3iface vmbr0 inet static
4 address 192.168.100.1/24
5 bridge-ports none
6 bridge-stp off
7 bridge-fd 0
8
9 post-up echo 1 > /proc/sys/net/ipv4/ip_forward
10 post-down echo 0 > /proc/sys/net/ipv4/ip_forward
11 post-up iptables -t nat -A POSTROUTING -s '192.168.100.0/24' -o enp1s0 -j MASQUERADE
12 post-down iptables -t nat -D POSTROUTING -s '192.168.100.0/24' -o enp1s0 -j MASQUERADE
4.3 应用配置
1$ ifup -a
相关专栏文章
- Nuitka 参数列表
- ProxmoxVE 配置 DHCP 网络
- Windows防火墙配置
- 在 CentOS 上部署 NetBIOS
- Tmux 命令
- 配置 CentOS 7 的 CT 容器
- Ncftp 使用手册
- Centos7 安装 Postgresql
- 在CentOS中安装 Laravel 框架
- 虚拟主机安装 Laravel 框架
- snap 设置代理
- Rime输入法设置
- Windows系统配置
- 灌篮高手大结局(全国大赛后) 下
- 灌篮高手大结局(全国大赛后) 上
- VScode 在 Docker 容器内开发
- VSCode 配置 Python 开发环境
- ProxmoxVE 配置 BBR
- ProxmoxVE 关闭订阅提示
- Linux 文本文件操作
- Deepin 使用远程桌面
- Hyper-V 下设置 Deepin 分辨率
- VsCode 使用 Remote SSH 连接 Alpine Linux
- Alpine Linux 安装 Bash
- frp安装配置
- Alpine Linux 配置
- screen 命令
- Systemd 系统工具命令指南
- ProxmoxVE 命令行
- Hyper-V 环境下给 CentOS 磁盘扩容
- Hyper-V 下设置 Ubuntu 分辨率
- Windows 10 家庭版安装 Hyper-V
- Hyper-V 网络设置
- Docker Compose 指令
- 使用 SSH 连接 Github
- Alpine Linux 安装 Docker
- Alpine Linux 网络设置
- 虚拟机安装 Alpine Linux 3.16
- 山克 UPS 安装手册
- Git 命令行
- 使用 Snap 安装 Docker
- (CentOS 7 | Rocky 9) 安装 Docker
- 修复 ProxmoxVE RRD 错误
- FFmpeg脚本
- Yum 版本库管理
- Linux系统内核升级
- iptables 配置
- ProxmoxVE 配置 NAT 网络
- MySQL 数据操作
- 使用 nmcli 配置网络
- 使用 sed 命令操作
- Linux 系统初始化配置
- Github使用Hugo生成Blog
- Docker使用命令
- About
- Search