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
    
  • 相关阅读:
    Linux下替换默认版本的protobuf
    论文笔记——NEURAL ARCHITECTURE SEARCH WITH REINFORCEMENT LEARNING
    kafka 学习之初体验
    git命令01
    git 命令02
    SSH远程连接连接其他主机,等待时间过长的原因。
    lsof命令详解
    文本处理命令
    Windows Server 2008 远程桌面连接拒绝
    vim文本编辑工具—修改文件内容
  • 原文地址:https://www.cnblogs.com/lusix/p/9186162.html
Copyright © 2011-2022 走看看