AWS AMI: Use custom dns nameserver

时间:2018-12-03 13:13:49

标签: amazon-web-services dhcp netplan

I want to create some custom AWS amis.

My base ami is ubuntu 18.04 so I am trying to use netplan to have my ami use my own private dns nameserver.

I am disabling cloud-inits networking configuration

root@ip-10-17-0-12:~# cat /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
network: {config: disabled}

Ι am customizing the netplan configuration:

network:
    version: 2
    renderer: networkd
    ethernets:
        eth0:
            dhcp4: true
            nameservers:
                search: [eu-west-1.compute.internal]
                addresses: [10.1.3.1, 127.0.0.53]

and then performing

$ sudo netplan apply
$ sudo netplan generate

However these configurations are never ingested from my system.

What is more, netplan ip leases eth0 fails as follows:

root@ip-10-17-0-12:~# netplan ip leases eth0
Traceback (most recent call last):
  File "/usr/sbin/netplan", line 23, in <module>
    netplan.main()
  File "/usr/share/netplan/netplan/cli/core.py", line 50, in main
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 130, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/ip.py", line 56, in run
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 130, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/ip.py", line 75, in run
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 130, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/ip.py", line 146, in command_ip_leases
    key, value = keyvalue.strip().split('=')
ValueError: not enough values to unpack (expected 2, got 1)

0 个答案:

没有答案