ubuntu网卡设置

2023-11-07

UBUNTU网卡配置

主机名修改
hostnamectl set-hostname ubuntu1804
cat /etc/hostname
网卡改名

#修改配置文件为下面形式
vi /etc/default/grub
GRUB_CMDLINE_LINUX="net.ifnames=0"
#生效新的grub.cfg文件
grub-mkconfig -o /boot/grub/grub.cfg 
#或者
update-grub
#重启生效
reboot

修改名称后需要修改配置文件否则没有地址(一般两个缩进)

cat /etc/netplan/01-netcfg.yaml #自动获取
network:
   version: 2
   renderer: networkd
   ethernets:
       eth0:
         dhcp4: yes

 修改后执行
 netplan apply命令生效

添加网卡后 配置静态地址

yuml格式尽量用空格缩进


[root@ubuntu1804||15|netplan]#cd /etc/netplan/
[root@ubuntu1804||16|netplan]#ls
01-netcfg.yaml

[root@ubuntu1804||17|netplan]#cp 01-netcfg.yaml 02-netcfg.yaml
[root@ubuntu1804||18|netplan]#vim 02-netcfg.yaml 

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
 version: 2
 renderer: networkd
 ethernets:
   eth1:
     dhcp4: no   #自动获取
     addresses: [192.168.8.10/24,10.0.0.10/8] #两个地址
     gateway4: 10.0.0.3   #网关
     nameservers:
       search: [magedu.com, magedu.org]  #自动补全
       addresses: [180.76.76.76, 8.8.8.8, 1.1.1.1]   #DNS
                       百度 
netplan apply   #重启网络服务    

查看ip和gateway
root@ubuntu1804:~#ip addr
root@ubuntu1804:~#route -n

查看DNS
root@ubuntu1804:~#ls -l /etc/resolv.conf
lrwxrwxrwx 1 root root 39 Dec 12 11:36 /etc/resolv.conf ->
…/run/systemd/resolve/stub-resolv.conf
root@ubuntu1804:~#systemd-resolve --status #观察DNS信息

配置多卡静态IP #可以用一个文件代替多个

 # This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
 version: 2
 renderer: networkd
 ethernets:
   eth0:
     dhcp4: no
     dhcp6: no
     addresses: [10.0.0.18/16]
     gateway4: 10.0.0.2       网关
     nameservers:
       addresses: [223.6.6.6]       DNS
   eth1:
     dhcp4: no
     dhcp6: no
     addresses: [10.20.0.18/16]
     routes:                            #配置路由
        - to: 10.30.0.0/16               #到达哪个网段
         via: 10.20.0.1                #网关(指向)
        - to: 10.40.0.0/16              
         via: 10.20.0.1
        - to: 10.50.0.0/16
         via: 10.20.0.1
        - to: 10.60.0.0/16
         via: 10.20.0.1


netplan aply 生效
route -n 查看

单网卡桥接

3 4 网卡桥接
[root@ubuntu1804||34|netplan]#cat /etc/netplan/01-netcfg.yaml
 # This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
 version: 2
 renderer: networkd
 ethernets:
   eth1:
     dhcp4: no
     dhcp6: no
    eth2:
     dhcp4: no
   bridges:       #单独列出
    br0:          #设备名
     dhcp4: no
     dhcp6: no
     addresses: [10.0.0.18/16]
     gateway4: 10.0.0.1
     nameservers:
       addresses: [223.6.6.6]
     interfaces:
        - eth1             #要桥接的网卡
        - eth2              


netplan apply     #生效
brctl show        
ifconfig br0

四块网卡桥接

两个桥接

network:
 version: 2
 renderer: networkd
 ethernets:
   eth1:
     dhcp4: no
     dhcp6: no
    eth2:
     dhcp4: no
      eth3:
     dhcp4: no
     dhcp6: no
    eth4:
     dhcp4: no


   bridges:
    br0:
     dhcp4: no
     dhcp6: no
     addresses: [10.0.0.18/16]
     gateway4: 10.0.0.1
     nameservers:
       addresses: [223.6.6.6]
     interfaces:
        - eth1             #要桥接的网卡
        - eth2      


         br1:
     dhcp4: no
     dhcp6: no
     addresses: [10.0.0.18/16]
     gateway4: 10.0.0.1
     nameservers:
       addresses: [223.6.6.6]
     interfaces:
        - eth3            #要桥接的网卡
        - eth4            

brctl stp br1 off #生成树协议
ifconfig br1 down
brctl delbr br1  #删除

多网卡绑定


network:
 version: 2
 renderer: networkd
 ethernets:
   eth0:
     dhcp4: no
     dhcp6: no
   eth1:
     dhcp4: no
     dhcp6: no
 bonds:
   bond0:
     interfaces:
        - eth3
        - eth4
     addresses: [172.160.18/16]
     gateway4: 172.16.0.1
     nameservers:
       addresses: [223.6.6.6,223.5.5.5]
     parameters:
       mode: active-backup
       mii-monitor-interval: 100


ifconfig br0 down  关闭
brctl delbr br1   删除
brctl show

cat /proc/net/bonding/bond0 查看活跃的网卡

 [root@ubuntu1804||34|netplan]#cat /proc/net/bonding/bond0

双卡绑定加桥接

root@ubuntu1804:~# cat /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
  eth0:
    dhcp4: no
    dhcp6: no
  eth1:
    dhcp4: no
    dhcp6: no
bonds:
  bond0:
    interfaces:
       - eth0
       - eth1
    parameters:
      mode: active-backup
      mii-monitor-interval: 100
bridges:
  br0:
    dhcp4: no
    dhcp6: no
    addresses: [10.0.0.18/16]
    gateway4: 10.0.0.1
    nameservers:
      addresses: [223.6.6.6,223.5.5.5]
    interfaces:
      - bond0
root@ubuntu1804:~# netplan apply 
root@ubuntu1804:~# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.96dbd15c1daf no bond0
root@ubuntu1804:~# ifconfig br0
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
      inet 10.0.0.18 netmask 255.255.0.0 broadcast 10.0.255.255
      inet6 fe80::94db:d1ff:fe5c:1daf prefixlen 64 scopeid 0x20<link>
      ether 96:db:d1:5c:1d:af txqueuelen 1000 (Ethernet)
      RX packets 97 bytes 6634 (6.6 KB)
      RX errors 0 dropped 0 overruns 0 frame 0
      TX packets 83 bytes 8286 (8.2 KB)
      TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
root@ubuntu1804:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref   Use Iface
0.0.0.0         10.0.0.1        0.0.0.0         UG    0      0        0 br0
10.0.0.0        0.0.0.0         255.255.0.0     U     0      0        0 br0
root@ubuntu1804:~# ifconfig
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
      ether 2a:20:b7:a8:58:37 txqueuelen 1000 (Ethernet)
      RX packets 2592 bytes 230049 (230.0 KB)
      RX errors 0 dropped 0 overruns 0 frame 0
      TX packets 2826 bytes 318282 (318.2 KB)
      TX errors 0 dropped 1 overruns 0 carrier 0 collisions 0
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
      inet 10.0.0.18 netmask 255.255.0.0 broadcast 10.0.255.255
      inet6 fe80::94db:d1ff:fe5c:1daf prefixlen 64 scopeid 0x20<link>
      ether 96:db:d1:5c:1d:af txqueuelen 1000 (Ethernet)
      RX packets 144 bytes 9890 (9.8 KB)
      RX errors 0 dropped 0 overruns 0 frame 0
      TX packets 117 bytes 12554 (12.5 KB)
      TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
      ether 2a:20:b7:a8:58:37 txqueuelen 1000 (Ethernet)
      RX packets 27 bytes 1990 (1.9 KB)
      RX errors 0 dropped 0 overruns 0 frame 0
      TX packets 0 bytes 0 (0.0 B)
      TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
      ether 2a:20:b7:a8:58:37 txqueuelen 1000 (Ethernet)
      RX packets 2565 bytes 228059 (228.0 KB)
      RX errors 0 dropped 0 overruns 0 frame 0
      TX packets 2826 bytes 318282 (318.2 KB)
      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 1000 (Local Loopback)
      RX packets 1131 bytes 75592 (75.5 KB)
      RX errors 0 dropped 0 overruns 0 frame 0
      TX packets 1131 bytes 75592 (75.5 KB)
      TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

网卡的多组绑定

可以实现网卡的多组绑定,比如:eth0,eth1绑定至bond0,eth2和eth3绑定bond1

root@ubuntu1804:~#cat /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
  eth0:
    dhcp4: no
    dhcp6: no
  eth1:
    dhcp4: no
    dhcp6: no
  eth2:
    dhcp4: no
    dhcp6: no
  eth3:
    dhcp4: no
    dhcp6: no
bonds:
  bond0:
    interfaces:
       - eth0
       - eth1
    addresses: [10.0.0.18/16]
    gateway4: 10.0.0.1
    nameservers:
      addresses: [223.6.6.6,223.5.5.5]
    parameters:
      mode: active-backup
      mii-monitor-interval: 100
  bond1:
    interfaces:
       - eth2
       - eth3
    addresses: [10.10.0.18/16]
    parameters:
      mode: active-backup
      mii-monitor-interval: 100
    routes:
       - to: 10.20.0.0/16
        via: 10.10.0.1
       - to: 10.30.0.0/16
        via: 10.10.0.1
       - to: 10.40.0.0/16
        via: 10.10.0.1
       - to: 10.50.0.0/16
        via: 10.10.0.1
root@ubuntu1804:~# netplan apply 
root@ubuntu1804:~# ifconfig 
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
      inet 10.0.0.18 netmask 255.255.0.0 broadcast 10.0.255.255
      inet6 fe80::2820:b7ff:fea8:5837 prefixlen 64 scopeid 0x20<link>
      ether 2a:20:b7:a8:58:37 txqueuelen 1000 (Ethernet)
      RX packets 273 bytes 23591 (23.5 KB)
      RX errors 0 dropped 0 overruns 0 frame 0
      TX packets 364 bytes 42455 (42.4 KB)
      TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
bond1: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
      inet 10.10.0.18 netmask 255.255.0.0 broadcast 10.10.255.255
      inet6 fe80::c035:83ff:fea1:abbb prefixlen 64 scopeid 0x20<link>
      ether c2:35:83:a1:ab:bb txqueuelen 1000 (Ethernet)
      RX packets 8 bytes 480 (480.0 B)
      RX errors 0 dropped 0 overruns 0 frame 0
      TX packets 10 bytes 796 (796.0 B)
      TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
      ether 2a:20:b7:a8:58:37 txqueuelen 1000 (Ethernet)
      RX packets 4 bytes 240 (240.0 B)
      RX errors 0 dropped 0 overruns 0 frame 0
      TX packets 0 bytes 0 (0.0 B)
      TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
      ether 2a:20:b7:a8:58:37 txqueuelen 1000 (Ethernet)
      RX packets 269 bytes 23351 (23.3 KB)
      RX errors 0 dropped 0 overruns 0 frame 0
      TX packets 364 bytes 42455 (42.4 KB)
      TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth2: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
      ether c2:35:83:a1:ab:bb txqueuelen 1000 (Ethernet)
      RX packets 4 bytes 240 (240.0 B)
      RX errors 0 dropped 0 overruns 0 frame 0
      TX packets 0 bytes 0 (0.0 B)
      TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth3: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
      ether c2:35:83:a1:ab:bb txqueuelen 1000 (Ethernet)
      RX packets 4 bytes 240 (240.0 B)
      RX errors 0 dropped 0 overruns 0 frame 0
      TX packets 10 bytes 796 (796.0 B)
      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 1000 (Local Loopback)
      RX packets 120 bytes 8344 (8.3 KB)
      RX errors 0 dropped 0 overruns 0 frame 0
      TX packets 120 bytes 8344 (8.3 KB)
      TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
root@ubuntu1804:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref   Use Iface
0.0.0.0         10.0.0.1        0.0.0.0         UG    0      0        0 bond0
10.0.0.0        0.0.0.0         255.255.0.0     U     0      0        0 bond0
10.10.0.0       0.0.0.0         255.255.0.0     U     0      0        0 bond1
10.20.0.0       10.10.0.1       255.255.0.0     UG    0      0        0 bond1
10.30.0.0       10.10.0.1       255.255.0.0     UG    0      0        0 bond1
10.40.0.0       10.10.0.1       255.255.0.0     UG    0      0        0 bond1
10.50.0.0       10.10.0.1       255.255.0.0     UG    0      0        0 bond1
root@ubuntu1804:~# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:34:df:9b
Slave queue ID: 0
Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:34:df:91
Slave queue ID: 0
root@ubuntu1804:~# cat /proc/net/bonding/bond1
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth3
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth3
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:34:df:b9
Slave queue ID: 0
Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:34:df:a5
Slave queue ID: 0

网卡多组绑定+多组桥接

oot@ubuntu1804:~# cat /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
 version: 2
 renderer: networkd
 ethernets:
   eth0:
     dhcp4: no
     dhcp6: no
   eth1:
     dhcp4: no
     dhcp6: no
   eth2:
     dhcp4: no
     dhcp6: no
   eth3:
     dhcp4: no
     dhcp6: no
 bonds:
   bond0:
     interfaces:
        - eth0
        - eth1
     parameters:
       mode: active-backup
       mii-monitor-interval: 100
   bond1:
     interfaces:
        - eth2
        - eth3
     parameters:
       mode: active-backup
       mii-monitor-interval: 100
 bridges:
   br0:
     dhcp4: no
     dhcp6: no
     addresses: [10.0.0.18/16]
     gateway4: 10.0.0.1
     nameservers:
       addresses: [223.6.6.6,223.5.5.5]
     interfaces:
        - bond0
   br1:
     dhcp4: no
     dhcp6: no
     interfaces:
        - bond1
     addresses: [10.10.0.18/16]
     routes:
        - to: 10.20.0.0/16
         via: 10.10.0.1
        - to: 10.30.0.0/16
         via: 10.10.0.1
        - to: 10.40.0.0/16
         via: 10.10.0.1
        - to: 10.50.0.0/16
         via: 10.10.0.1
root@ubuntu1804:~# netplan apply         
root@ubuntu1804:~# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.96dbd15c1daf no bond0
br1 8000.9e02ab0faeb0 no bond1
root@ubuntu1804:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref   Use Iface
0.0.0.0         10.0.0.1        0.0.0.0         UG    0      0        0 br0
10.0.0.0        0.0.0.0         255.255.0.0     U     0      0        0 br0
10.10.0.0       0.0.0.0         255.255.0.0     U     0      0        0 br1
10.20.0.0       10.10.0.1       255.255.0.0     UG    0      0        0 br1
10.30.0.0       10.10.0.1       255.255.0.0     UG    0      0        0 br1
10.40.0.0       10.10.0.1       255.255.0.0     UG    0      0        0 br1
10.50.0.0       10.10.0.1       255.255.0.0     UG    0      0        0 br1
root@ubuntu1804:~# ifconfig 
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
       ether 2a:20:b7:a8:58:37 txqueuelen 1000 (Ethernet)
       RX packets 1749 bytes 154597 (154.5 KB)
       RX errors 0 dropped 0 overruns 0 frame 0
       TX packets 1951 bytes 224182 (224.1 KB)
       TX errors 0 dropped 2 overruns 0 carrier 0 collisions 0
bond1: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
       ether c2:35:83:a1:ab:bb txqueuelen 1000 (Ethernet)
       RX packets 441 bytes 43111 (43.1 KB)
       RX errors 0 dropped 0 overruns 0 frame 0
       TX packets 21 bytes 1642 (1.6 KB)
       TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
       inet 10.0.0.18 netmask 255.255.0.0 broadcast 10.0.255.255
       inet6 fe80::94db:d1ff:fe5c:1daf prefixlen 64 scopeid 0x20<link>
       ether 96:db:d1:5c:1d:af txqueuelen 1000 (Ethernet)
       RX packets 164 bytes 11692 (11.6 KB)
       RX errors 0 dropped 0 overruns 0 frame 0
       TX packets 148 bytes 16165 (16.1 KB)
       TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
br1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
       inet 10.10.0.18 netmask 255.255.0.0 broadcast 10.10.255.255
       inet6 fe80::9c02:abff:fe0f:aeb0 prefixlen 64 scopeid 0x20<link>
       ether 9e:02:ab:0f:ae:b0 txqueuelen 1000 (Ethernet)
       RX packets 13 bytes 788 (788.0 B)
       RX errors 0 dropped 0 overruns 0 frame 0
       TX packets 9 bytes 726 (726.0 B)
       TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
       ether 2a:20:b7:a8:58:37 txqueuelen 1000 (Ethernet)
       RX packets 24 bytes 1906 (1.9 KB)
       RX errors 0 dropped 0 overruns 0 frame 0
       TX packets 0 bytes 0 (0.0 B)
       TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
       ether 2a:20:b7:a8:58:37 txqueuelen 1000 (Ethernet)
       RX packets 1725 bytes 152691 (152.6 KB)
       RX errors 0 dropped 0 overruns 0 frame 0
       TX packets 1951 bytes 224182 (224.1 KB)
       TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth2: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
       ether c2:35:83:a1:ab:bb txqueuelen 1000 (Ethernet)
       RX packets 24 bytes 1906 (1.9 KB)
       RX errors 0 dropped 0 overruns 0 frame 0
       TX packets 0 bytes 0 (0.0 B)
       TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth3: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
       ether c2:35:83:a1:ab:bb txqueuelen 1000 (Ethernet)
       RX packets 417 bytes 41205 (41.2 KB)
       RX errors 0 dropped 0 overruns 0 frame 0
       TX packets 21 bytes 1642 (1.6 KB)
       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 1000 (Local Loopback)
       RX packets 793 bytes 53888 (53.8 KB)
       RX errors 0 dropped 0 overruns 0 frame 0
       TX packets 793 bytes 53888 (53.8 KB)
       TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
root@ubuntu1804:~# cat /proc/net/bonding/bond1
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth3
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth3
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:34:df:b9
Slave queue ID: 0
Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: 00:0c:29:34:df:a5
Slave queue ID: 0
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

ubuntu网卡设置 的相关文章

随机推荐

  • Mysql-DDL(数据定义语言)

    show databases 查看所有数据库 create databse 数据库名 创建数据库 use database 数据库名 使用数据库 删除表格如果存在 drop table if exists mumber1 create TA
  • Angular快速上手--创建Hero类

    0 前言 真实的英雄当然不止一个名字 在 src app 文件夹中为 Hero 类创建一个文件 并添加 id 和 name 属性 1 操作 src app app component ts复制并修改内容 export class Hero
  • ensp设计校园网,期末作业,课程设计报告

    1 实现功能 基本实现如下网络核心功能 1 三层架构设计 本课题按照三层网络结构 接入层 汇聚层 核心层 进行设计和规划 接入层要求提供较多的网络入口 汇聚层实现对接入层网络的互联 核心层完成校园内部和外部数据的交换 并实现路由和安全功能
  • 怎么查看vue源码

    有很多同学和我一样使用一段时间 vue 框架后 对它的源码就有了兴趣 但是不知道在哪里找 vue js 源码 随意创建一个vue项目 或者已有项目 找到根路径平级的 node modules 文件夹 往下拉 拉多一下 在文件夹尾巴一截的地方
  • SpringBoot笔记

    目录 开发准备 导出 常用注解 导出excel到指定位置 导出excel到指定web 导入 将指定位置Excel导入并显示至web 使用ExcelWriter基于模板导出 开发准备 1 导入依赖
  • Bar函数--Matplotlib

    函数Bar 用于绘制柱状图 使用bar绘制柱状图的过程中涉及到中文字体的显示问题 使用动态参数配置方法 指定了中文黑体 import matplotlib as mpl mpl rcParams font sans serif SimHei
  • web端播放m3u8视频流注意事项

    项目上有一个播放实时视频 直播 的需求 后端童鞋直接传过来一个类似 https live m3u8的视频流地址 让我自行播放 拿到地址的我一脸懵逼 下面开始我的探索 baidu 之路 HLS HTTP Live Streaming 介绍 m
  • Meta发布「分割一切」AI 模型,CV或迎来GPT-3时刻

    demo地址 Segment Anything Meta AI Meta 表示 这是第一个致力于图像分割的基础模型 自此 CV 也走上了 做一个统一某个 某些 全部 任务的全能模型 的道路 在此之前 分割作为计算机视觉的核心任务 已经得到广
  • java属性值注解

    查询条件开始时间 DateTimeFormat pattern yyyy MM dd HH mm ss JsonFormat pattern yyyy MM dd HH mm ss timezone GMT 8 private Date t
  • C# VS2010 Winform 查找链表的近邻值

    实现在类似数组中查找最接近目标值的数值 定义链表 定义链表 private List
  • 架构师进阶之路

    选择的范围太广 可以读的书太多 往往容易无所适从 我想就我自己读过的技术书籍中挑选出来一些 按照学习的先后顺序 推荐给大家 特别是那些想不断提高自己技术水平的Java程序员们 一 Java编程入门类 对于没有Java编程经验的程序员要入门
  • 随机森林建模

    在看datacastle的建模大赛 用r写了随机森林的二分类 上次代码用py跑的 这里想用交叉验证 但是跑了一天一夜也木有出来 还是把代码先保留下来吧 希望看到的人指正 rm list ls setwd D competitions dat
  • Android获取本地相册中图片视频

    权限
  • Linux多进程:exit——进程退出函数

    子进程结束释放自己的用户区数据 内核区数据由其父进程回收释放 pcb fd 等 进程退出函数 void exit int status status 是进程退出时的一个状态信息 父进程在回收子进程资源时可以获取 include
  • 求Sn=1!+2!+3!+4!+5!+…+n!之值,其中n是一个数字(n不超过20)。

    这个是一个比较坑的题 但也是一个极其能查缺补漏的题 题目描述 求Sn 1 2 3 4 5 n 之值 其中n是一个数字 n不超过20 输入 n 输出 Sn的值 样例输入 5 样例输出 153 在这里插入代码片 乍一看很简单 一下就打好了 但开
  • C++ 结构体转json

    FdogSerialize FdogSerialize是一个用于C 序列化的开源库 采用非入侵方式 无需在原有结构体上进行修改 目前支持基础类型 基础类型数组 结构体 以及vector list map等数据类型的序列化 支持JSON和XM
  • SHA-256算法实现

    SHA 256 算法输入报文的最大长度不超过2 64 bit 输入按512 bit 分组进行处理 产生 的输出是一个256 bit 的报文摘要 该算法处理包括以下几步 STEP1 附加填充比特 对报文进行填充使报文长度与448 模512 同
  • JSR303校验的全局错误处理

    实现一个全局处理类 并对异常进行判断处理 方法有如下几种 1 实现HandlerExceptionResolver接口 实现其中的resolveException 方法 public class GlobalExceptionResolve
  • 自上而下的企业级数据分析应用 更好地满足业务部门需求

    2016年5月26日 由亦策软件和Qlik原厂联合主办的 汽车行业大数据沙龙 在上海巴黎春天新世界酒店召开 与会嘉宾踏着小雨纷至而来 一起围绕着汽车行业目前数据分析的瓶颈 企业发展的局限 以及对未来的构想建设等话题展开了精彩的分享和热切的探
  • ubuntu网卡设置

    UBUNTU网卡配置 主机名修改 hostnamectl set hostname ubuntu1804 cat etc hostname 网卡改名 修改配置文件为下面形式 vi etc default grub GRUB CMDLINE