Download Networking Guide - Red Hat Customer Portal

Transcript
⁠Chapt er 6 . Configure Net work Bridging
nmcli> set bri d g e. pri o ri ty 4 0 9 6
nmcli> save
Connection 'bridge-br0' (79cf6a3e-0310-4a78-b759-bda1cc3eef8d)
successfully saved.
nmcli> q ui t
See Section 2.3, “ Using the NetworkManager Command Line Tool, nmcli” for an introduction to
n mcli.
6.3. Using t he Command Line Int erface (CLI)
6.3.1. Check if Bridging Kernel Module is Inst alled
In Red Hat Enterprise Linux 7, the bridging module is loaded by default. If necessary, you can make
sure that the module is loaded by issuing the following command as ro o t:
~]# mo d pro be --fi rst-ti me bri d g e
modprobe: ERROR: could not insert 'bridge': Module already in kernel
To display information about the module, issue the following command:
~]$ mo d i nfo bri d g e
See the mo d pro be(8) man page for more command options.
6.3.2. Creat e a Net work Bridge
To create a network bridge, create a file in the /etc/sysco nfi g /netwo rk-scri pts/ directory
called i fcfg -brN, replacing N with the number for the interface, such as 0 .
The contents of the file is similar to whatever type of interface is getting bridged to, such as an
Ethernet interface. The differences in this example are as follows:
The D EVIC E directive is given an interface name as its argument in the format brN, where N is
replaced with the number of the interface.
The T Y P E directive is given an argument Bri d g e. This directive determines the device type and
the argument is case sensitive.
The bridge interface configuration file is given an IP address whereas the physical interface
configuration file must only have a MAC address (see below).
An extra directive, D ELAY = 0 , is added to prevent the bridge from waiting while it monitors traffic,
learns where hosts are located, and builds a table of MAC addresses on which to base its filtering
decisions. The default delay of 15 seconds is not needed if no routing loops are possible.
Examp le 6 .1. Examp le if cf g - b r0 In t erf ace C o n f ig u rat io n File
The following is an example of a bridge interface configuration file using a static IP address:
DEVICE=br0
TYPE=Bridge
IPADDR=192.168.1.1
117