how to config ifcfg-br
时间: 2023-11-03 19:33:37 浏览: 121
To configure the ifcfg-br file, follow these steps:
1. Open a terminal and navigate to the network-scripts directory using the command cd /etc/sysconfig/network-scripts/
2. Create a new file called ifcfg-brX, where X is the number of the bridge interface you want to configure. For example, if you want to configure bridge interface number 0, use the command: sudo vi ifcfg-br0
3. In the ifcfg-brX file, add the following lines:
- DEVICE=brX
- TYPE=Bridge
- BOOTPROTO=none
- ONBOOT=yes
- DELAY=0
4. Next, you need to add the physical network interfaces that will be members of the bridge. To do this, add the following lines to the ifcfg-brX file:
- DEFROUTE=no
- PEERDNS=yes
- PEERROUTES=yes
- IPADDR=<IP address of the bridge>
- NETMASK=<subnet mask>
- GATEWAY=<default gateway>
- DNS1=<primary DNS server>
- DNS2=<secondary DNS server>
- DNS3=<tertiary DNS server>
5. Save the ifcfg-brX file and exit the editor.
6. Finally, restart the network service to apply the changes using the command: sudo systemctl restart network.service
阅读全文