Initial Settings : Network Settings2019/04/22 |
[1] | Change to static IP addres if you use Ubuntu as a server. [ens3] is different on each environment, replace it to your own one. |
root@dlp:~#
vi /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: ens3: dhcp4: no # IP address/subnet mask addresses: [10.0.0.30/24] # default gateway gateway4: 10.0.0.1 nameservers: # name server this host refers addresses: [10.0.0.10,10.0.0.11] dhcp6: no # apply settings root@dlp:~# netplan apply
ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 52:54:00:25:5d:88 brd ff:ff:ff:ff:ff:ff inet 10.0.0.30/24 brd 10.0.0.255 scope global ens2 valid_lft forever preferred_lft forever inet6 fe80::5054:ff:fe25:5d88/64 scope link valid_lft forever preferred_lft forever |
[2] | If you don't need IPv6, it's possible to disable it like follows. |
root@dlp:~# echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
root@dlp:~#
root@dlp:~# sysctl -p net.ipv6.conf.all.disable_ipv6 = 1 ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 2: ens2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 52:54:00:25:5d:88 brd ff:ff:ff:ff:ff:ff inet 10.0.0.30/24 brd 10.0.0.255 scope global ens2 valid_lft forever preferred_lft forever |
Sponsored Link |