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

Configuration of network bridge for KVM on CentOS 7.4

· 52CE 我爱测

I'm new to KVM on CentOS 7.4, but I have experience with using VirtualBox on the Mac OS. There I was able to select in the options to have a bridged network instead of a NAT, and it worked. The instance running can be easily acce…

问题原文

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

I'm new to KVM on CentOS 7.4, but I have experience with using VirtualBox on the Mac OS. There I was able to select in the options to have a bridged network instead of a NAT, and it worked. The instance running can be easily accessed from the LAN, and it has an IP address which looks like it got it DHCP from the router.

On KVM/CentOS 7.4, I've not been successful yet. Is there an option like that in virt-manager to configure it for a Bridged network like it is in VirtualBox/Mac?

What I have done so far to ssh into the KVM instance is use ssh -t, to tunnel in there and that works. But I really need it to work without tunneling. And I need to be able to run Apache and serve some pages from this instance too.

Is the solution in some settings in virt-manager to make the network bridge work as I described like it does in VirtualBox/Mac? Or is there a more complicated that is needed to accomplish this? If so, what is it?

已采纳解答

原帖链接 · Jaroslav Kucera · CC BY-SA 3.0

Bridging works fine, all you need is to have the same IP segment on the bridge and in the VM.

As you mentioned virt-manager, there is screenshot from NIC definition of one of our working VMs (bothy hypervisor/VM are RHEL 7 nodes).

EDIT1:

Maybe you're missing following sysctl deffinitions:

net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0

EDIT2:

In the discussion we've identifide the problem. There are no bridge (br0/br1 etc.) interfaces defined on top of physical NICs. It's necessary to create it first. There is short, but most probably, sufficient howto:

https://ervikrant06.wordpress.com/2014/06/06/how-to-configure-software-bridge-in-rhel-7/

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

资料来源与适用范围

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

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

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