Ubuntu 18.04 配置


Ubuntu 18.04 配置IP-靜態(UB與其他linux os不同)

sudo netplan generate

sudo vim /etc/netplan/50-cloud-init.yaml

需修改以下參數:

network:

  version: 2

  renderer: networkd

  ethernets:

        eno1:

                dhcp4: no

                dhcp6: no

                addresses: [10.240.176.209/24]

                gateway4: 10.240.176.129

                nameservers:

                        addresses: [10.248.2.5,10.239.27.36]

 sudo netplan apply 開機自動配置ip(與其他OS不同)

1、開機自動配置IP

$ sudo vim /etc/network/interfaces

auto eth39

iface eth39 inet manual

auto br0

iface br0 inet static

address 10.240.176.207

netmask 255.255.255.128

gateway 10.240.176.129

dns-nameserver 10.248.2.5

dns-nameserver 10.239.27.36

dns-nameserver 172.17.6.9

bridge_ports eth39

2、重啟網絡服務生效

service systemd-networkd restart

 設置鏡像源 問題:下載包的時候可能會有以下error log,需重新設置鏡像源

Err 1http://cn.archive.ubuntu.com trusty Release.gpg

W: Failed to fetch 1http://cn.archive.ubuntu.com/ubuntu/dists/trusty/InRelease

解決方法:

1、修改源 vim /etc/apt/source.list

2、設置DNS,要不然不能通過域名訪問地址

$ sudo vim /etc/resolv.conf

需修改以下參數:

"nameserver 10.248.2.5

nameserver 10.239.27.36

nameserver 172.17.6.9"

 下載DPDK & DTS前需要設置代理

方法一 終端運行exporthttp_proxy="http://用戶名:密碼@代理IP:代理端口"也可

方法二 sudo vim /etc/apt/apt.conf    需將

“ Acquire::http::proxy "http://proxy-prc.intel.com:911/";

Acquire::https::proxy "https://proxy-prc.intel.com:911/";

Acquire::ftp::proxy "ftp://proxy-prc.intel.com:911/; ”

添加到以下路徑文件中: :/C:\Users\wuchan4x\Documents\OS issue\ubuntu-info\apt.conf


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM