网卡

激活网卡

  1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87  88  89  90  91  92  93  94  95  96  97  98  99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
vim /etc/sysconfig/network-scripts/ifcfg-eno16777736 TYPE=Ethernet BOOTPROTO=none DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no NAME=eno16777736 UUID=ec77579b-2ced-481f-9c09-f562b321e268 ONBOOT=yes IPADDR0=192.168.10.10 HWADDR=00:0C:29:C4:A4:09 PREFIX0=24 IPV6_PEERDNS=yes IPV6_PEERROUTES=yes systemctl restart network ping -c 4 192.168.10.10 PING 192.168.10.10 (192.168.10.10) 56(84) bytes of data. 64 bytes from 192.168.10.10: icmp_seq=1 ttl=64 time=0.056 ms 64 bytes from 192.168.10.10: icmp_seq=2 ttl=64 time=0.099 ms 64 bytes from 192.168.10.10: icmp_seq=3 ttl=64 time=0.095 ms 64 bytes from 192.168.10.10: icmp_seq=4 ttl=64 time=0.095 ms --- 192.168.10.10 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 2999ms rtt min/avg/max/mdev = 0.056/0.086/0.099/0.018 ms #nmcli 网络配置工具 nmcli connection show NAME UUID TYPE DEVICE eno16777736 ec77579b-2ced-481f-9c09-f562b321e268 802-3-ethernet eno16777736 [root@linuxprobe ~]# nmcli con show eno16777736 connection.id: eno16777736 connection.uuid: ec77579b-2ced-481f-9c09-f562b321e268 connection.interface-name: -- connection.type: 802-3-ethernet connection.autoconnect: yes connection.timestamp: 1487348994 connection.read-only: no connection.permissions: connection.zone: -- connection.master: -- connection.slave-type: -- connection.secondaries: connection.gateway-ping-timeout: 0 ………………省略部分输出信息……………… nmcli connection add con-name company ifname eno16777736 autoconnect no type ethernet ip4 192.168.10.10/24 gw4 192.168.10.1 Connection 'company' (86c71220-0057-419e-b615-38f4014cfdee) successfully added. nmcli connection add con-name house type ethernet ifname eno16777736 Connection 'house' (44acf0a7-07e2-40b4-94ba-69ea973090fb) successfully added. nmcli connection show NAME UUID TYPE DEVICE house 44acf0a7-07e2-40b4-94ba-69ea973090fb 802-3-ethernet -- company 86c71220-0057-419e-b615-38f4014cfdee 802-3-ethernet -- eno16777736 ec77579b-2ced-481f-9c09-f562b321e268 802-3-ethernet eno16777736 nmcli connection up house Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ ActiveConnection/2) ifconfig eno1677773628: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.100.128 netmask 255.255.255.0 broadcast 192.168.100.255 inet6 fe80::20c:29ff:fec4:a409 prefixlen 64 scopeid 0x20<link> ether 00:0c:29:c4:a4:09 txqueuelen 1000 (Ethernet) RX packets 42 bytes 4198 (4.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 75 bytes 10441 (10.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 0 (Local Loopback) RX packets 518 bytes 44080 (43.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 518 bytes 44080 (43.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 vim /etc/sysconfig/network-scripts/ifcfg-eno16777736 TYPE=Ethernet BOOTPROTO=none ONBOOT=yes USERCTL=no DEVICE=eno16777736 MASTER=bond0 SLAVE=yes [root@linuxprobe ~]# vim /etc/sysconfig/network-scripts/ifcfg-eno33554968 TYPE=Ethernet BOOTPROTO=none ONBOOT=yes USERCTL=no DEVICE=eno33554968 MASTER=bond0 SLAVE=yes vim /etc/sysconfig/network-scripts/ifcfg-bond0 TYPE=Ethernet BOOTPROTO=none ONBOOT=yes USERCTL=no DEVICE=bond0 IPADDR=192.168.10.10 PREFIX=24 DNS=192.168.10.1 NM_CONTROLLED=no vim /etc/modprobe.d/bond.conf alias bond0 bonding options bond0 miimon=100 mode=6 systemctl restart network ifconfig bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500 inet 192.168.10.10 netmask 255.255.255.0 broadcast 192.168.10.255 inet6 fe80::20c:29ff:fe9c:637d prefixlen 64 scopeid 0x20<link> ether 00:0c:29:9c:63:7d txqueuelen 0 (Ethernet) RX packets 700 bytes 82899 (80.9 KiB) RX errors 0 dropped 6 overruns 0 frame 0 TX packets 588 bytes 40260 (39.3 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 eno16777736: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500 ether 00:0c:29:9c:63:73 txqueuelen 1000 (Ethernet) RX packets 347 bytes 40112 (39.1 KiB) RX errors 0 dropped 6 overruns 0 frame 0 TX packets 263 bytes 20682 (20.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 eno33554968: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500 ether 00:0c:29:9c:63:7d txqueuelen 1000 (Ethernet) RX packets 353 bytes 42787 (41.7 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 325 bytes 19578 (19.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ping 192.168.10.10 PING 192.168.10.10 (192.168.10.10) 56(84) bytes of data. 64 bytes from 192.168.10.10: icmp_seq=1 ttl=64 time=0.109 ms 64 bytes from 192.168.10.10: icmp_seq=2 ttl=64 time=0.102 ms 64 bytes from 192.168.10.10: icmp_seq=3 ttl=64 time=0.066 ms ping: sendmsg: Network is unreachable 64 bytes from 192.168.10.10: icmp_seq=5 ttl=64 time=0.065 ms 64 bytes from 192.168.10.10: icmp_seq=6 ttl=64 time=0.048 ms 64 bytes from 192.168.10.10: icmp_seq=7 ttl=64 time=0.042 ms 64 bytes from 192.168.10.10: icmp_seq=8 ttl=64 time=0.079 ms ^C --- 192.168.10.10 ping statistics --- 8 packets transmitted, 7 received, 12% packet loss, time 7006ms rtt min/avg/max/mdev = 0.042/0.073/0.109/0.023 ms

浙ICP备11005866号-12