Jaime Frutos Morales's blog

20/01/2010

How to configure a network bridge in Red Hat / Fedora

Filed under: Linux, SysAdmin — acidborg @ 14:20

Description: a network bridge is a forwarding technique very useful when you have to deal with virtualization and you want to give your virtual machines direct access to your real network, without using NAT.

In this example, I’m going to use a bridge (br0) to access a wired network interface (eth1). I use eth1 for the bridge instead of eth0 because I prefer to use the first network interface to access the machine using SSH and fix any problems that could appear while configuring the bridge.

Installation:

Use yum to install the packages needed: yum install bridge-utils

Configuration:

  • Edit /etc/sysconfig/network-scripts/ifcfg-eth1 and write this (changing the HWADDR for the MAC address of your network card):

    DEVICE=eth1
    HWADDR=00:11:22:33:44:55
    ONBOOT=yes
    BRIDGE=br0
  • Edit /etc/sysconfig/network-scripts/ifcfg-br0 with this content (change the IP related fields to fit your needs):

    DEVICE=br0
    TYPE=Bridge
    ONBOOT=yes
    DELAY=0
    BOOTPROTO=static
    BROADCAST=192.168.1.255
    IPADDR=192.168.1.100
    NETMASK=255.255.255.0
    NETWORK=192.168.1.0
    GATEWAY=192.168.1.1
  • Add these lines to /etc/sysctl.conf in order to disable packet filtering in the bridge:

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

    This improves the bridge’s performance. I recommend to use packet filtering in the computers which connect through the bridge, but not in the bridge itself.

  • Apply the syscttl changes: sysctl -p /etc/sysctl.conf
  • Restart your network interfaces: service network restart
Advertisements

2 Comments

  1. […] Read the original: How to configure a network bridge in Red Hat / Fedora « Jaime … […]

    Pingback by How to configure a network bridge in Red Hat / Fedora « Jaime … | Just linux! — 20/01/2010 @ 17:02

  2. Another great post.
    Thanks for the tips and help.
    Everyone, bookmark this site.

    Comment by Install Software — 06/02/2010 @ 02:06


RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Create a free website or blog at WordPress.com.

%d bloggers like this: