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
    
  • 相关阅读:
    9.siverlight中将集合绑定到UI元素
    HTML 小练习(智联注册页)
    开博了
    HTML 小练习(休假申请单)
    HTML 小练习(跨行跨列练习)
    HTML5 小总结2(手打)
    HTML5 小总结1 (手打)
    读《C程序设计语言》笔记9
    读《C程序设计语言》笔记7
    读《C程序设计语言》笔记5
  • 原文地址:https://www.cnblogs.com/lusix/p/9186162.html
Copyright © 2011-2022 走看看