溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

網(wǎng)絡(luò)測試工具和Ubuntu網(wǎng)絡(luò)配置

發(fā)布時間:2020-10-22 21:04:11 來源:網(wǎng)絡(luò) 閱讀:605 作者:90001丶冷眸 欄目:系統(tǒng)運(yùn)維

測試網(wǎng)絡(luò)工具

  • 在命令行下測試網(wǎng)絡(luò)的連通性
    顯示主機(jī)名
      hostname
    測試網(wǎng)絡(luò)連通性
      ping
    顯示正確的路由表
      ip route
  • 跟蹤路由
      traceroute
      tracepath
      mtr
  • 確定名稱服務(wù)器使用
      nslookup
      host
      dig

Ubuntu網(wǎng)絡(luò)配置

官網(wǎng)文檔:
https://help.ubuntu.com/lts/serverguide/network-configuration.html.zh-CN

配置自動獲取IP

cat /etc/netplan/01-netcfg.yaml
network:
 version: 2
 renderer: networkd
 ethernets:
   ens33:
      dhcp4: yes

修改網(wǎng)卡配置文件后需執(zhí)行命令生效:netplan apply

配置靜態(tài)IP:

cat /etc/netplan/01-netcfg.yaml
network:
   version: 2
   renderer: networkd
   ethernets:
  eth0:
    addresses:
      - 192.168.6.10/24
     - 10.10.10.10/24
   gateway4: 192.168.6.1
   nameservers:
    search: [mydomain, otherdomain]
    addresses: [223.5.5.5, 8.8.8.8, 1.1.1.1]

查看ip和gateway

ip addr
route -n

查看DNS

  • ls -l /etc/resolv.conf
    lrwxrwxrwx 1 root root 39 Dec 12 11:36 /etc/resolv.conf
    \> ../run/systemd/resolve/stub-resolv.conf
  • systemd-resolve --status

修改主機(jī)名

hostnamectl set-hostname ubuntu1904

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI