Centos7网络

2017-07-02  本文已影响26人  尘曦的雨
采用传统的命名方式
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet "   此行后面追加net.finames=0 保存退出
GRUB_DISABLE_RECOVERY="true"
修改主机名

nmcli 网络设置工具

列出主机上所有的配置文件

[root@chenxi ~]# nmcli connection show 列出主机上所有的配置文件

NAME         UUID                                  TYPE            DEVICE 
eth0-y       4527c59d-507b-409a-a9f5-6527afeaf9cf  802-3-ethernet  eth0   
eth1         a4b11117-b4cc-3460-897c-754185b03959  802-3-ethernet  eth1   
virbr0       d348629e-63a8-493d-9dcc-2e4171b03d70  bridge          virbr0 
2修改配置文件的名字

[root@chenxi ~]# nmcli connection show

NAME         UUID                                  TYPE            DEVICE 
eth0         7bb5f655-fe1d-31c3-bff1-9804e4d82844  802-3-ethernet  eth0   
eth1         a4b11117-b4cc-3460-897c-754185b03959  802-3-ethernet  eth1   
virbr0       d348629e-63a8-493d-9dcc-2e4171b03d70  bridge          virbr0 
eth0-chenxi  a81f7ea2-fb75-43a9-b3dc-fde6cd7a0328  802-3-ethernet  --     
eth0-y       4527c59d-507b-409a-a9f5-6527afeaf9cf  802-3-ethernet  --     
eth1-yun     8cacc601-aec0-4265-8d27-c39ed6ea4070  802-3-ethernet  --  
NAME         UUID                                  TYPE            DEVICE 
eth0         7bb5f655-fe1d-31c3-bff1-9804e4d82844  802-3-ethernet  eth0   
eth1         a4b11117-b4cc-3460-897c-754185b03959  802-3-ethernet  eth1   
virbr0       d348629e-63a8-493d-9dcc-2e4171b03d70  bridge          virbr0 
eth0-chenxi  a81f7ea2-fb75-43a9-b3dc-fde6cd7a0328  802-3-ethernet  --     
eth0-p       4527c59d-507b-409a-a9f5-6527afeaf9cf  802-3-ethernet  --     
eth1-yun     8cacc601-aec0-4265-8d27-c39ed6ea4070  802-3-ethernet  --    

3 创建新的网络的配置文件
NAME         UUID                                  TYPE            DEVICE 
eth0         7bb5f655-fe1d-31c3-bff1-9804e4d82844  802-3-ethernet  eth0   
eth1         a4b11117-b4cc-3460-897c-754185b03959  802-3-ethernet  eth1   
virbr0       d348629e-63a8-493d-9dcc-2e4171b03d70  bridge          virbr0 
eth0-chenxi  a81f7ea2-fb75-43a9-b3dc-fde6cd7a0328  802-3-ethernet  --     
eth0-fh      ffa21739-6f17-4745-98eb-101e0ddffff6  802-3-ethernet  --     
eth0-p       4527c59d-507b-409a-a9f5-6527afeaf9cf  802-3-ethernet  --     
eth1-yun     8cacc601-aec0-4265-8d27-c39ed6ea4070  802-3-ethernet  --     
NAME         UUID                                  TYPE            DEVICE 
eth0         7bb5f655-fe1d-31c3-bff1-9804e4d82844  802-3-ethernet  eth0   
eth0-fh      ffa21739-6f17-4745-98eb-101e0ddffff6  802-3-ethernet  eth1    网络物理设备
virbr0       d348629e-63a8-493d-9dcc-2e4171b03d70  bridge          virbr0 
eth0-chenxi  a81f7ea2-fb75-43a9-b3dc-fde6cd7a0328  802-3-ethernet  --     
eth0-p       4527c59d-507b-409a-a9f5-6527afeaf9cf  802-3-ethernet  --     
eth1         a4b11117-b4cc-3460-897c-754185b03959  802-3-ethernet  --     
eth1-yun     8cacc601-aec0-4265-8d27-c39ed6ea4070  802-3-ethernet  --     
一个绑定多个IP地址
eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:af:1a:36 brd ff:ff:ff:ff:ff:ff
    inet 192.168.25.1/24 brd 192.168.25.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet 192.168.56.7/24 brd 192.168.56.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet 192.168.88.99/24 brd 192.168.88.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::3bc0:d8a:b783:ba27/64 scope link 
多网卡绑定bond的设备
NAME         UUID                                  TYPE            DEVICE 
bond0        e04ce09a-49a2-44ab-b7cd-85fb208d9f66  bond            bond0  
eth0         7bb5f655-fe1d-31c3-bff1-9804e4d82844  802-3-ethernet  eth0   
eth0-fh      ffa21739-6f17-4745-98eb-101e0ddffff6  802-3-ethernet  eth1   
virbr0       d348629e-63a8-493d-9dcc-2e4171b03d70  bridge          virbr0 
网络组
多种方式runner     broadcast       roundrobin       activebackup     loadbalance    lacp
上一篇下一篇

猜你喜欢

热点阅读