How to assign a static ip address before eth link running in ubuntu 18.04 LTS?How Assign Static IP using Netplan so isc-dhcp-server doesn't crashHow to assign unique MAC addresses to sub-interfacesissue with dhcp default network fileHow to assign static IP address by MAC addressUbuntu and Static IP AddressHow do I assign a static IP address in Ubuntu 17.04 without rebooting?Netplan error, error on nameserverUbuntu Server 18.04.1 Cannot Keep Static IP Address After AssignedHow Assign Static IP using Netplan so isc-dhcp-server doesn't crash

Mutate my DNA sequence

How can I increase the rate of regeneration in humans without the possibility of tumors developing?

How to write 2**n - 1 as a recursive function?

Why would shrinking TEMPDB log lead to slowness?

How to draw 15-puzzle in LaTeX

Questions about `cs_new:...` and friends and their TeX relatives regarding global, local, long, nopar, protected, expandable and naming

Why is Microwaved mac & cheese burnt where they touch?

Some lesser known open problems/ conjectures in number theory

How to record this drawing effect?

Integrate GA or GA360 with SFMC?

Which are stars and which are noise in this comet photo?

If you have multiple planeswalkers, how many of their loyalty abilities can you use in a single turn?

Are homeless people protected by antidiscrimination laws?

Extract lines from files with names begining with given letter

What is an idiom, phrase or expression for situation such as "throw a pigeon among cats"

Intuition for the derivative of the exponential function

Given small computational resources how navigation was implemented ( Not Samples of old guidance software)

Is there any physical evidence for motion?

What's the short and accented note at the very end of a song called?

Explanation for why nickel turns green in hydrochloric acid

Can you catch the thief?

What's the origin of the trope that dragons used to be common but aren't any more?

Why do the Romance languages use definite articles, when Latin doesn't?

Why is Robin Hood French in Shrek?



How to assign a static ip address before eth link running in ubuntu 18.04 LTS?


How Assign Static IP using Netplan so isc-dhcp-server doesn't crashHow to assign unique MAC addresses to sub-interfacesissue with dhcp default network fileHow to assign static IP address by MAC addressUbuntu and Static IP AddressHow do I assign a static IP address in Ubuntu 17.04 without rebooting?Netplan error, error on nameserverUbuntu Server 18.04.1 Cannot Keep Static IP Address After AssignedHow Assign Static IP using Netplan so isc-dhcp-server doesn't crash






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









1

















I know that if I need to assign a static ip address I will need to use netplan in Ubuntu 18.04, and I have done exactly that and made it work.



Here is my config file:



network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: yes
enp131s0f0:
dhcp4: no
addresses: [10.66.0.1/24]


After I use netplan apply, the ifconfig command shows the ip address of enp131s0f0 set to 10.66.0.1 after I plug the cable into the port for "enp131s0f0". This causes a problem because if I do not plug in the cable to this port, the port itself won't get a static ip address even if the ipaddress is set in netplan, this will cause some services to fail to start (eg, isc-dhcp-server).



For example, if you have 3 ports and you have configured them like so:



network:
version: 2
renderer: networkd
ethernets:
enp131s0f0:
dhcp4: no
addresses: [10.66.0.1/24]
enp131s0f1:
dhcp4: no
addresses: [10.66.1.1/24]
enp131s0f2:
dhcp4: no
addresses: [10.66.2.1/24]
enp131s0f3:
dhcp4: no
addresses: [10.66.3.1/24]


If isc-dhcp-server is installed on all these 3 ports. The isc-dhcp-server will start only if you connect all 3 ports, if you failed to connect your cable to any one port of these 3 ports the isc-dhcp-server will fail to start because the port does not have a static address (without the cable plugged into the port), even if you set the static ip address in netplan.



So I would like to ask how to permanently assign a static address to a net port. To make it have an ipaddress before I plug in the cable... I need this because there are some ports on my server that currently I do not use (the cable is left unplugged), but I need isc-dhcp-server to start...










share|improve this question




























  • Are you using a desktop or server installation?

    – heynnema
    May 29 at 15:24











  • status please...

    – heynnema
    May 30 at 14:05











  • status please...

    – heynnema
    Jun 3 at 13:39

















1

















I know that if I need to assign a static ip address I will need to use netplan in Ubuntu 18.04, and I have done exactly that and made it work.



Here is my config file:



network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: yes
enp131s0f0:
dhcp4: no
addresses: [10.66.0.1/24]


After I use netplan apply, the ifconfig command shows the ip address of enp131s0f0 set to 10.66.0.1 after I plug the cable into the port for "enp131s0f0". This causes a problem because if I do not plug in the cable to this port, the port itself won't get a static ip address even if the ipaddress is set in netplan, this will cause some services to fail to start (eg, isc-dhcp-server).



For example, if you have 3 ports and you have configured them like so:



network:
version: 2
renderer: networkd
ethernets:
enp131s0f0:
dhcp4: no
addresses: [10.66.0.1/24]
enp131s0f1:
dhcp4: no
addresses: [10.66.1.1/24]
enp131s0f2:
dhcp4: no
addresses: [10.66.2.1/24]
enp131s0f3:
dhcp4: no
addresses: [10.66.3.1/24]


If isc-dhcp-server is installed on all these 3 ports. The isc-dhcp-server will start only if you connect all 3 ports, if you failed to connect your cable to any one port of these 3 ports the isc-dhcp-server will fail to start because the port does not have a static address (without the cable plugged into the port), even if you set the static ip address in netplan.



So I would like to ask how to permanently assign a static address to a net port. To make it have an ipaddress before I plug in the cable... I need this because there are some ports on my server that currently I do not use (the cable is left unplugged), but I need isc-dhcp-server to start...










share|improve this question




























  • Are you using a desktop or server installation?

    – heynnema
    May 29 at 15:24











  • status please...

    – heynnema
    May 30 at 14:05











  • status please...

    – heynnema
    Jun 3 at 13:39













1












1








1








I know that if I need to assign a static ip address I will need to use netplan in Ubuntu 18.04, and I have done exactly that and made it work.



Here is my config file:



network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: yes
enp131s0f0:
dhcp4: no
addresses: [10.66.0.1/24]


After I use netplan apply, the ifconfig command shows the ip address of enp131s0f0 set to 10.66.0.1 after I plug the cable into the port for "enp131s0f0". This causes a problem because if I do not plug in the cable to this port, the port itself won't get a static ip address even if the ipaddress is set in netplan, this will cause some services to fail to start (eg, isc-dhcp-server).



For example, if you have 3 ports and you have configured them like so:



network:
version: 2
renderer: networkd
ethernets:
enp131s0f0:
dhcp4: no
addresses: [10.66.0.1/24]
enp131s0f1:
dhcp4: no
addresses: [10.66.1.1/24]
enp131s0f2:
dhcp4: no
addresses: [10.66.2.1/24]
enp131s0f3:
dhcp4: no
addresses: [10.66.3.1/24]


If isc-dhcp-server is installed on all these 3 ports. The isc-dhcp-server will start only if you connect all 3 ports, if you failed to connect your cable to any one port of these 3 ports the isc-dhcp-server will fail to start because the port does not have a static address (without the cable plugged into the port), even if you set the static ip address in netplan.



So I would like to ask how to permanently assign a static address to a net port. To make it have an ipaddress before I plug in the cable... I need this because there are some ports on my server that currently I do not use (the cable is left unplugged), but I need isc-dhcp-server to start...










share|improve this question

















I know that if I need to assign a static ip address I will need to use netplan in Ubuntu 18.04, and I have done exactly that and made it work.



Here is my config file:



network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: yes
enp131s0f0:
dhcp4: no
addresses: [10.66.0.1/24]


After I use netplan apply, the ifconfig command shows the ip address of enp131s0f0 set to 10.66.0.1 after I plug the cable into the port for "enp131s0f0". This causes a problem because if I do not plug in the cable to this port, the port itself won't get a static ip address even if the ipaddress is set in netplan, this will cause some services to fail to start (eg, isc-dhcp-server).



For example, if you have 3 ports and you have configured them like so:



network:
version: 2
renderer: networkd
ethernets:
enp131s0f0:
dhcp4: no
addresses: [10.66.0.1/24]
enp131s0f1:
dhcp4: no
addresses: [10.66.1.1/24]
enp131s0f2:
dhcp4: no
addresses: [10.66.2.1/24]
enp131s0f3:
dhcp4: no
addresses: [10.66.3.1/24]


If isc-dhcp-server is installed on all these 3 ports. The isc-dhcp-server will start only if you connect all 3 ports, if you failed to connect your cable to any one port of these 3 ports the isc-dhcp-server will fail to start because the port does not have a static address (without the cable plugged into the port), even if you set the static ip address in netplan.



So I would like to ask how to permanently assign a static address to a net port. To make it have an ipaddress before I plug in the cable... I need this because there are some ports on my server that currently I do not use (the cable is left unplugged), but I need isc-dhcp-server to start...







networking server network-manager ethernet dhcp






share|improve this question
















share|improve this question













share|improve this question




share|improve this question








edited May 29 at 15:40









Arronical

14.5k10 gold badges54 silver badges102 bronze badges




14.5k10 gold badges54 silver badges102 bronze badges










asked May 29 at 14:47









Reverie MetherlenceReverie Metherlence

61 bronze badge




61 bronze badge















  • Are you using a desktop or server installation?

    – heynnema
    May 29 at 15:24











  • status please...

    – heynnema
    May 30 at 14:05











  • status please...

    – heynnema
    Jun 3 at 13:39

















  • Are you using a desktop or server installation?

    – heynnema
    May 29 at 15:24











  • status please...

    – heynnema
    May 30 at 14:05











  • status please...

    – heynnema
    Jun 3 at 13:39
















Are you using a desktop or server installation?

– heynnema
May 29 at 15:24





Are you using a desktop or server installation?

– heynnema
May 29 at 15:24













status please...

– heynnema
May 30 at 14:05





status please...

– heynnema
May 30 at 14:05













status please...

– heynnema
Jun 3 at 13:39





status please...

– heynnema
Jun 3 at 13:39










1 Answer
1






active

oldest

votes


















0


















Here's a minimal .yaml file for your configuration... this assumes that 10.66.0.2 is an available static address on your network, and that 10.66.0.1 is the proper gateway...



network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: true
enp4s0f0:
addresses: [10.66.0.2/24]
gateway4: 10.66.0.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
optional: true # may or may not be desired, to stop 2 minute boot delay


sudo netplan --debug generate # generate config files



sudo netplan apply # apply configuration



reboot # reboot and verify operation






share|improve this answer




























  • This doesn't seem to address the OP's concerns that having network cables unplugged on various NICs is causing problems. Your config resembles the OP's very closely, is the lack of a gateway address and nameserver what's causing the issue when a cable is unplugged?

    – Arronical
    May 29 at 15:44











  • @Arronical the primary problem is that OP tried to assign a static IP using (probably) the IP of the gateway.

    – heynnema
    May 29 at 15:52











  • That's a good point! I missed that. They're trying to install a DHCP server so perhaps they're trying to create some sort of router? The second example shows different values in the 3rd octet so may be a possibility?

    – Arronical
    May 29 at 16:01











  • @Arronical same problem there... assigning the IP to the gateway address.

    – heynnema
    May 29 at 16:02












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1147147%2fhow-to-assign-a-static-ip-address-before-eth-link-running-in-ubuntu-18-04-lts%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown


























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0


















Here's a minimal .yaml file for your configuration... this assumes that 10.66.0.2 is an available static address on your network, and that 10.66.0.1 is the proper gateway...



network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: true
enp4s0f0:
addresses: [10.66.0.2/24]
gateway4: 10.66.0.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
optional: true # may or may not be desired, to stop 2 minute boot delay


sudo netplan --debug generate # generate config files



sudo netplan apply # apply configuration



reboot # reboot and verify operation






share|improve this answer




























  • This doesn't seem to address the OP's concerns that having network cables unplugged on various NICs is causing problems. Your config resembles the OP's very closely, is the lack of a gateway address and nameserver what's causing the issue when a cable is unplugged?

    – Arronical
    May 29 at 15:44











  • @Arronical the primary problem is that OP tried to assign a static IP using (probably) the IP of the gateway.

    – heynnema
    May 29 at 15:52











  • That's a good point! I missed that. They're trying to install a DHCP server so perhaps they're trying to create some sort of router? The second example shows different values in the 3rd octet so may be a possibility?

    – Arronical
    May 29 at 16:01











  • @Arronical same problem there... assigning the IP to the gateway address.

    – heynnema
    May 29 at 16:02















0


















Here's a minimal .yaml file for your configuration... this assumes that 10.66.0.2 is an available static address on your network, and that 10.66.0.1 is the proper gateway...



network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: true
enp4s0f0:
addresses: [10.66.0.2/24]
gateway4: 10.66.0.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
optional: true # may or may not be desired, to stop 2 minute boot delay


sudo netplan --debug generate # generate config files



sudo netplan apply # apply configuration



reboot # reboot and verify operation






share|improve this answer




























  • This doesn't seem to address the OP's concerns that having network cables unplugged on various NICs is causing problems. Your config resembles the OP's very closely, is the lack of a gateway address and nameserver what's causing the issue when a cable is unplugged?

    – Arronical
    May 29 at 15:44











  • @Arronical the primary problem is that OP tried to assign a static IP using (probably) the IP of the gateway.

    – heynnema
    May 29 at 15:52











  • That's a good point! I missed that. They're trying to install a DHCP server so perhaps they're trying to create some sort of router? The second example shows different values in the 3rd octet so may be a possibility?

    – Arronical
    May 29 at 16:01











  • @Arronical same problem there... assigning the IP to the gateway address.

    – heynnema
    May 29 at 16:02













0














0










0









Here's a minimal .yaml file for your configuration... this assumes that 10.66.0.2 is an available static address on your network, and that 10.66.0.1 is the proper gateway...



network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: true
enp4s0f0:
addresses: [10.66.0.2/24]
gateway4: 10.66.0.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
optional: true # may or may not be desired, to stop 2 minute boot delay


sudo netplan --debug generate # generate config files



sudo netplan apply # apply configuration



reboot # reboot and verify operation






share|improve this answer
















Here's a minimal .yaml file for your configuration... this assumes that 10.66.0.2 is an available static address on your network, and that 10.66.0.1 is the proper gateway...



network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: true
enp4s0f0:
addresses: [10.66.0.2/24]
gateway4: 10.66.0.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
optional: true # may or may not be desired, to stop 2 minute boot delay


sudo netplan --debug generate # generate config files



sudo netplan apply # apply configuration



reboot # reboot and verify operation







share|improve this answer















share|improve this answer




share|improve this answer








edited May 29 at 16:32

























answered May 29 at 15:19









heynnemaheynnema

27.2k3 gold badges29 silver badges73 bronze badges




27.2k3 gold badges29 silver badges73 bronze badges















  • This doesn't seem to address the OP's concerns that having network cables unplugged on various NICs is causing problems. Your config resembles the OP's very closely, is the lack of a gateway address and nameserver what's causing the issue when a cable is unplugged?

    – Arronical
    May 29 at 15:44











  • @Arronical the primary problem is that OP tried to assign a static IP using (probably) the IP of the gateway.

    – heynnema
    May 29 at 15:52











  • That's a good point! I missed that. They're trying to install a DHCP server so perhaps they're trying to create some sort of router? The second example shows different values in the 3rd octet so may be a possibility?

    – Arronical
    May 29 at 16:01











  • @Arronical same problem there... assigning the IP to the gateway address.

    – heynnema
    May 29 at 16:02

















  • This doesn't seem to address the OP's concerns that having network cables unplugged on various NICs is causing problems. Your config resembles the OP's very closely, is the lack of a gateway address and nameserver what's causing the issue when a cable is unplugged?

    – Arronical
    May 29 at 15:44











  • @Arronical the primary problem is that OP tried to assign a static IP using (probably) the IP of the gateway.

    – heynnema
    May 29 at 15:52











  • That's a good point! I missed that. They're trying to install a DHCP server so perhaps they're trying to create some sort of router? The second example shows different values in the 3rd octet so may be a possibility?

    – Arronical
    May 29 at 16:01











  • @Arronical same problem there... assigning the IP to the gateway address.

    – heynnema
    May 29 at 16:02
















This doesn't seem to address the OP's concerns that having network cables unplugged on various NICs is causing problems. Your config resembles the OP's very closely, is the lack of a gateway address and nameserver what's causing the issue when a cable is unplugged?

– Arronical
May 29 at 15:44





This doesn't seem to address the OP's concerns that having network cables unplugged on various NICs is causing problems. Your config resembles the OP's very closely, is the lack of a gateway address and nameserver what's causing the issue when a cable is unplugged?

– Arronical
May 29 at 15:44













@Arronical the primary problem is that OP tried to assign a static IP using (probably) the IP of the gateway.

– heynnema
May 29 at 15:52





@Arronical the primary problem is that OP tried to assign a static IP using (probably) the IP of the gateway.

– heynnema
May 29 at 15:52













That's a good point! I missed that. They're trying to install a DHCP server so perhaps they're trying to create some sort of router? The second example shows different values in the 3rd octet so may be a possibility?

– Arronical
May 29 at 16:01





That's a good point! I missed that. They're trying to install a DHCP server so perhaps they're trying to create some sort of router? The second example shows different values in the 3rd octet so may be a possibility?

– Arronical
May 29 at 16:01













@Arronical same problem there... assigning the IP to the gateway address.

– heynnema
May 29 at 16:02





@Arronical same problem there... assigning the IP to the gateway address.

– heynnema
May 29 at 16:02


















draft saved

draft discarded















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1147147%2fhow-to-assign-a-static-ip-address-before-eth-link-running-in-ubuntu-18-04-lts%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown









Popular posts from this blog

Tamil (spriik) Luke uk diar | Nawigatjuun

Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

Training a classifier when some of the features are unknownWhy does Gradient Boosting regression predict negative values when there are no negative y-values in my training set?How to improve an existing (trained) classifier?What is effect when I set up some self defined predisctor variables?Why Matlab neural network classification returns decimal values on prediction dataset?Fitting and transforming text data in training, testing, and validation setsHow to quantify the performance of the classifier (multi-class SVM) using the test data?How do I control for some patients providing multiple samples in my training data?Training and Test setTraining a convolutional neural network for image denoising in MatlabShouldn't an autoencoder with #(neurons in hidden layer) = #(neurons in input layer) be “perfect”?