大网数据广告活动
服务器运维问答

Configuring 1:1 Nat using Firewalld for VM's

· 52CE 我爱测

I've setup 2 vm's within my server and I'm trying to setup a 1:1 NAT for them with firewalld on CentOS 7. Currently both vm's are behind a virtual bridge (virbr0, vnet0, vnet1) and I've made copies of the NIC for each IP to be us…

问题原文

原帖链接 · dstana · CC BY-SA 3.0

I've setup 2 vm's within my server and I'm trying to setup a 1:1 NAT for them with firewalld on CentOS 7. Currently both vm's are behind a virtual bridge (virbr0, vnet0, vnet1) and I've made copies of the NIC for each IP to be used with them. I would like to set it up like this:

eth0:0 (public IP) -----> vnet0 (internal IP); eth0:1 (public IP) -----> vnet1 (internal IP)

The way I understand it is I'm looking for a 1:1 NAT but I'm not sure how to set it up. I had originally configured everything with a bridge but the hosting provider does not allow for the bridge on the network, the imaginary mac's of the virtual nic's get everything kicked off the network.

I've tried a few things but I'm not super comfortable with firewalld yet.

社区高分解答

原帖链接 · Anthony Fornito · CC BY-SA 3.0

NAT is done at the firewall/router level.

Depending on your firewall/router you can setup 1:1 NAT's the only thing to keep in mind is you can only setup one port to one IP.

So if you have 2 web servers one will have to run a different port (other than 80) for the NAT to work.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-11-08)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。