Score:0

Static ip address issue

cf flag

I gave a static IP address using following command

network:
        version : 2
        renderer: networkd   ethernets:
    enp0s3:
            dhcp4 : false
            addresses : 192.168.3.244/24
            gateway4 : 192.168.3.1/24   nameservers :   addresses : [ 1.1.1.1, 8.8.4.4]*

when i run the following command "sudo netplan apply"

some sort of error poping up , mentioning below

etc/netplan/00-installer-config.yaml:5:3: Invalid YAML: inconsistent indentation: ethernets:

24601 avatar
in flag
In future, please don't use unrequired bold text - it's not clever, it makes your question difficult to read. If you need to understand how to form a question, please first take the [tour] then read [ask].
user535733 avatar
cn flag
Your YAML does indeed appear to be inconsistent. Are you asking how to fix it?
heynnema avatar
ru flag
Edit your question and show me `ls -al /etc/netplan` and `cat /etc/netplan/*.yaml`. Start comments to me with @heynnema or I'll miss them.
heynnema avatar
ru flag
Status please...
Score:0
ru flag

Your /etc/netplan/*.yaml file should look like this...

network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s3:
      addresses: 192.168.3.244/24
      gateway4: 192.168.3.1/24
      nameservers:
        addresses: [1.1.1.1, 8.8.4.4]

sudo netplan generate

sudo netplan apply

reboot

ru flag
`reboot` is not needed here if `sudo netplan apply` worked.
heynnema avatar
ru flag
@ThomasWard I'm told that for static IPs, a reboot is required. If just an `apply` works then good.
ru flag
according to the several hundred times I've done the `apply` bits, it applies the static IP. The only time it won't apply is if the network is so convoluted that ARP doesn't propagate and the network routes are fubar. But that's rare in modern networks.
Kevin john avatar
cf flag
Hi @heynnema it working fine, thanks
Kevin john avatar
cf flag
@ThomasWard , Thanks man , I appreciate you help
heynnema avatar
ru flag
@Kevinjohn Please remember to accept my answer by clicking on the checkmark icon that appears just to the left of my answer. Thanks!
heynnema avatar
ru flag
@Kevinjohn Status please...
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.