Advanced network Configuration

Source: Internet
Author: User

Advanced Network configuration:
1. Configure Network bridging
Bridging action enables your virtual machine and real machine to use the same network device
#brctl Show
#brctl Delif br0 eth0
#brctl addif br0 eth0
#vim/etc/sysconfig/network-scripts/ifcfg-eth0
Device=eth0
Onboot=yes
Bootproto=none
Peerdns=no
Bridge=br0
Vim/etc/sysconfig/network-scripts/ifcfg-br0
Device=br0
Onboot=yes
Bootproto=none
ipaddr=172.25.254.100
netmask=255.255.255.0
Peerdns=no
Type=bridge
#systemctl Restart Network//start twice
Brctl
# # # Bridge Management commands
–show # # # Display
–ADDBR # # # Add a bridge
–DELBR # # # Delete a network bridge
–ADDIF # # # Add a bridge connection
–delif # # # Delete a bridge connection
2,bond Network Configuration
(1), using the command configuration is temporary configuration
NMCLI Connect Add type Bond con-name BOND0 ifname bond0 mode active-backup ip4 172.25.254.100/24 gw4 172.25.254.250//build bindings Interface Bond0
NMCLI connection Add type Bond-slave con-name eth0 ifname eth0 Master bond0//Establish Slave interface eth0
NMCLI connection Add type Bond-slave con-name eth1 ifname eth1 Master bond0//Establish Slave interface eth1
Monitoring Watch-n 1/proc/net/bonding/bond0
Need to turn off #systemctl stop NetworkManager
troubleshooting, sometimes unsuccessful, requires NMCLI connection Show/delete/add
(2),
To establish a binding interface bond0 configuration file:
#vim/etc/sysconfig/network-scripts/ifcfg-bond0
Device=bond0
Name=bond0
Type=bond
Bootproto=none
ipaddr=172.25.254.100
Prefix0=24
Onboot=yes
bonding_opts= "Mode=1 miimon=50"
#vim/etc/sysconfig/network-scripts/ifcfg-eth0
Type=ethernet
Name=eth0
Device=eth0
Onboot=yes
Master=bond0
Slave=yes
#############
#vim/etc/sysconfig/network-scripts/ifcfg-eth1
Type=ethernet
Name=eth1
Device=eth1
Onboot=yes
Master=bond0
Slave=yes
#vim/etc/modprobe.d/bonding.conf
Alias Bond0 Bonding
Systemctl Restart Network
Cat/proc/net/bonding/bond0
View bonding Status
Bond supports two NICs by default, and team supports 8 NICs by default
3. Configure the Team network
Configuring the Team Interface
#nmcli connection Add type team con-name TEAM0 ifname team0 config ' {"runner": {"name": "Activebackup"}} ' Ip4 172.25.254.1 XX gw4 172.25.254.250
#nmcli connection Add con-name eth0 ifname eth0 type Team-slave Master TEAM0
#nmcli connection Add con-name eth1 ifname eth1 type Team-slave Master TEAM0
#systemctl Restart Network
#teamdctl Team0 State
#ifconfig eth0 Down
#teamdctl Team0 State
#ifconfig eth0 up
#teamdctl Team0 State











This article is from the "Love You in Time" blog, please be sure to keep this source http://solongcc.blog.51cto.com/8979378/1630466

Advanced network Configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.