zoukankan      html  css  js  c++  java
  • Set up bridge to connect to internet

    Steps to set up bridge

    Target: set up a bridge on the interface which connect to internet. Then we can attach other devices to the bridge to connect to internet.

    1. Find out which interface connected to internet

    ifconfig |grep 10.2
    

    It will show the interface information, you can get the interface connected to internet, such as "enp6s0f0"

    2. Add ifcfg-br0 file

    cd /etc/sysconfig/network-scripts
    vim ifcfg-br0
    

    Edit the file as below

    TYPE=Bridge
    DEVICE=br0
    ONBOOT=yes
    NM_CONTROLLED=no
    BOOTPROTO=dhcp
    HOSTNAME="pengyuan.sh.intel.com"
    

    Note: The hostname is your server's name. You can use the command 'hostname' to check it

    3. Edit ifcfg-enp6s0f0 file

    DEVICE=enp6s0f0
    ONBOOT=yes
    NM_CONTROLLED="no"
    BRIDGE=br0
    

    4. Update interface and bridge

    ifup enp6s0f0
    ifup br0
    

    Then you may lost the ssh session, so go to lab to operate the machine.

    ./ifup-eth br0
    

    Expected result: Determination of IP br0, then there is a dhclient process show that the hostname of br0

    ps –aux|grep dhclient
    

    5. Check brctl, see bridge connect to interface.

    brctl show
    

    Reboot the machine(but still find the issue that br0 not up, no IP connection)

    6. Start the network

    /etc/init.d/rc.d/init.d/ ./network start
    chkconfig –list
    chkconfig –level 2345 network on
    chkconfig –list
    systemctl stop NetworkManager.service
    systemctl disable NetworkManager.service
    killall dhclient
    service restart network
    killall dhclient
    service restart network
    
  • 相关阅读:
    常用 SQL Server 规范集锦
    让Git忽略所有obj和bin目录的同步
    Sql server 存储过程基础语法
    nginx 站点代理,负载均衡
    CentOS7.0安装Nginx-1.12.0
    CentOS7安装GNOME可视化界面和如何配置IP地址
    开发工具资料集合
    NOIP2018总结反思
    NOIP2018考试报告
    STL基础用法
  • 原文地址:https://www.cnblogs.com/lusix/p/9186162.html
Copyright © 2011-2022 走看看