Ubuntu18.04修改IP地址
⼀、查看并修改IP地址
Ubuntu 18.04使⽤netplan配置⽹络,其配置⽂件是yaml格式的。安装好Ubuntu 18.04之后,在/etc/netplan/⽬录下默认的配置⽂件名是00-installer-config.yaml,我们通过VIM修改它:
# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
inet 192.168.56.11  netmask 255.255.255.0  broadcast 192.168.56.255
inet6 fe80::20c:29ff:feee:97bf  prefixlen 64  scopeid 0x20<link>
ether 00:0c:29:ee:97:bf  txqueuelen 1000  (Ethernet)
RX packets 5431  bytes 465128 (465.1 KB)
RX errors 0  dropped 0  overruns 0  frame 0
TX packets 3321  bytes 411063 (411.0 KB)
TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
# cat /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
ethernets:
ens33:
dhcp4: noubuntu网络配置
addresses: [192.168.56.11/24]
gateway4: 192.168.56.2
nameservers:
addresses: [114.114.114.114]    # dns地址
version: 2
# netplan apply  # 使配置⽂件⽣效

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。