Static IP config for Ubuntu Server 18.04 LTS w/ netplan

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












We are trying to get a new server running 18.04 LTS to connect to the internet, but no luck thus far. The router doesn't distribute DHCP, so we have a static IP assigned to the port the server is connected to. We tried following the instructions here: https://www.howtoforge.com/linux-basics-set-a-static-ip-on-ubuntu



That didn't work - still no network connection. Note that there was no file named 01-netcfg.yaml in /etc/netplan. There was another yaml file that was named 50-netcfg.yaml and that's the file we edited.



network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: no
dhcp6: no
addresses: [204.xxx.xxx.108/25]
gateway4: 204.xxx.xxx.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]






share|improve this question

















  • 1




    you should put the yml file in question in your question, so we can have a look at it. (You can mask the IP address with Xs)
    – Sebastian Stark
    Jun 11 at 17:51










  • network: version: 2 renderer: networkd ethernets: eno1: dhcp4: no dhcp6: no addresses: [204.xxx.xxx.xxx/25] gateway4: 204.xxx.xxx.xxx nameservers: addresses: [8.8.8.8,8.8.4.4]
    – Serdar Uckun
    Jun 11 at 17:58











  • Spacing and indentation are very important and we can't proofread it in a comment. Paste the exact file here and give us the link: paste.ubuntu.com
    – chili555
    Jun 11 at 18:01










  • paste.ubuntu.com/p/2xSM5fDgmZ
    – Serdar Uckun
    Jun 11 at 18:03






  • 1




    The gateway should be the router IP address. With a /25 netmask that is 255.255.255.128 which would mean that whatever 204.XXX.XXX.whatever the last three are would have to match. In that mask, 126 would be the last IP of the subnet meaning that 127 is the broadcast IP and 129 would be the start of the next one with 128 being the network and 255 being the broadcast. So, if the gateway is not in the IP address range it will not work. Use subnet-calculator.com/subnet.php?net_class=C for figuring out IP addresses.
    – Terrance
    Jun 11 at 18:16















up vote
0
down vote

favorite












We are trying to get a new server running 18.04 LTS to connect to the internet, but no luck thus far. The router doesn't distribute DHCP, so we have a static IP assigned to the port the server is connected to. We tried following the instructions here: https://www.howtoforge.com/linux-basics-set-a-static-ip-on-ubuntu



That didn't work - still no network connection. Note that there was no file named 01-netcfg.yaml in /etc/netplan. There was another yaml file that was named 50-netcfg.yaml and that's the file we edited.



network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: no
dhcp6: no
addresses: [204.xxx.xxx.108/25]
gateway4: 204.xxx.xxx.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]






share|improve this question

















  • 1




    you should put the yml file in question in your question, so we can have a look at it. (You can mask the IP address with Xs)
    – Sebastian Stark
    Jun 11 at 17:51










  • network: version: 2 renderer: networkd ethernets: eno1: dhcp4: no dhcp6: no addresses: [204.xxx.xxx.xxx/25] gateway4: 204.xxx.xxx.xxx nameservers: addresses: [8.8.8.8,8.8.4.4]
    – Serdar Uckun
    Jun 11 at 17:58











  • Spacing and indentation are very important and we can't proofread it in a comment. Paste the exact file here and give us the link: paste.ubuntu.com
    – chili555
    Jun 11 at 18:01










  • paste.ubuntu.com/p/2xSM5fDgmZ
    – Serdar Uckun
    Jun 11 at 18:03






  • 1




    The gateway should be the router IP address. With a /25 netmask that is 255.255.255.128 which would mean that whatever 204.XXX.XXX.whatever the last three are would have to match. In that mask, 126 would be the last IP of the subnet meaning that 127 is the broadcast IP and 129 would be the start of the next one with 128 being the network and 255 being the broadcast. So, if the gateway is not in the IP address range it will not work. Use subnet-calculator.com/subnet.php?net_class=C for figuring out IP addresses.
    – Terrance
    Jun 11 at 18:16













up vote
0
down vote

favorite









up vote
0
down vote

favorite











We are trying to get a new server running 18.04 LTS to connect to the internet, but no luck thus far. The router doesn't distribute DHCP, so we have a static IP assigned to the port the server is connected to. We tried following the instructions here: https://www.howtoforge.com/linux-basics-set-a-static-ip-on-ubuntu



That didn't work - still no network connection. Note that there was no file named 01-netcfg.yaml in /etc/netplan. There was another yaml file that was named 50-netcfg.yaml and that's the file we edited.



network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: no
dhcp6: no
addresses: [204.xxx.xxx.108/25]
gateway4: 204.xxx.xxx.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]






share|improve this question













We are trying to get a new server running 18.04 LTS to connect to the internet, but no luck thus far. The router doesn't distribute DHCP, so we have a static IP assigned to the port the server is connected to. We tried following the instructions here: https://www.howtoforge.com/linux-basics-set-a-static-ip-on-ubuntu



That didn't work - still no network connection. Note that there was no file named 01-netcfg.yaml in /etc/netplan. There was another yaml file that was named 50-netcfg.yaml and that's the file we edited.



network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: no
dhcp6: no
addresses: [204.xxx.xxx.108/25]
gateway4: 204.xxx.xxx.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]








share|improve this question












share|improve this question




share|improve this question








edited Jun 11 at 18:24
























asked Jun 11 at 17:49









Serdar Uckun

13




13







  • 1




    you should put the yml file in question in your question, so we can have a look at it. (You can mask the IP address with Xs)
    – Sebastian Stark
    Jun 11 at 17:51










  • network: version: 2 renderer: networkd ethernets: eno1: dhcp4: no dhcp6: no addresses: [204.xxx.xxx.xxx/25] gateway4: 204.xxx.xxx.xxx nameservers: addresses: [8.8.8.8,8.8.4.4]
    – Serdar Uckun
    Jun 11 at 17:58











  • Spacing and indentation are very important and we can't proofread it in a comment. Paste the exact file here and give us the link: paste.ubuntu.com
    – chili555
    Jun 11 at 18:01










  • paste.ubuntu.com/p/2xSM5fDgmZ
    – Serdar Uckun
    Jun 11 at 18:03






  • 1




    The gateway should be the router IP address. With a /25 netmask that is 255.255.255.128 which would mean that whatever 204.XXX.XXX.whatever the last three are would have to match. In that mask, 126 would be the last IP of the subnet meaning that 127 is the broadcast IP and 129 would be the start of the next one with 128 being the network and 255 being the broadcast. So, if the gateway is not in the IP address range it will not work. Use subnet-calculator.com/subnet.php?net_class=C for figuring out IP addresses.
    – Terrance
    Jun 11 at 18:16













  • 1




    you should put the yml file in question in your question, so we can have a look at it. (You can mask the IP address with Xs)
    – Sebastian Stark
    Jun 11 at 17:51










  • network: version: 2 renderer: networkd ethernets: eno1: dhcp4: no dhcp6: no addresses: [204.xxx.xxx.xxx/25] gateway4: 204.xxx.xxx.xxx nameservers: addresses: [8.8.8.8,8.8.4.4]
    – Serdar Uckun
    Jun 11 at 17:58











  • Spacing and indentation are very important and we can't proofread it in a comment. Paste the exact file here and give us the link: paste.ubuntu.com
    – chili555
    Jun 11 at 18:01










  • paste.ubuntu.com/p/2xSM5fDgmZ
    – Serdar Uckun
    Jun 11 at 18:03






  • 1




    The gateway should be the router IP address. With a /25 netmask that is 255.255.255.128 which would mean that whatever 204.XXX.XXX.whatever the last three are would have to match. In that mask, 126 would be the last IP of the subnet meaning that 127 is the broadcast IP and 129 would be the start of the next one with 128 being the network and 255 being the broadcast. So, if the gateway is not in the IP address range it will not work. Use subnet-calculator.com/subnet.php?net_class=C for figuring out IP addresses.
    – Terrance
    Jun 11 at 18:16








1




1




you should put the yml file in question in your question, so we can have a look at it. (You can mask the IP address with Xs)
– Sebastian Stark
Jun 11 at 17:51




you should put the yml file in question in your question, so we can have a look at it. (You can mask the IP address with Xs)
– Sebastian Stark
Jun 11 at 17:51












network: version: 2 renderer: networkd ethernets: eno1: dhcp4: no dhcp6: no addresses: [204.xxx.xxx.xxx/25] gateway4: 204.xxx.xxx.xxx nameservers: addresses: [8.8.8.8,8.8.4.4]
– Serdar Uckun
Jun 11 at 17:58





network: version: 2 renderer: networkd ethernets: eno1: dhcp4: no dhcp6: no addresses: [204.xxx.xxx.xxx/25] gateway4: 204.xxx.xxx.xxx nameservers: addresses: [8.8.8.8,8.8.4.4]
– Serdar Uckun
Jun 11 at 17:58













Spacing and indentation are very important and we can't proofread it in a comment. Paste the exact file here and give us the link: paste.ubuntu.com
– chili555
Jun 11 at 18:01




Spacing and indentation are very important and we can't proofread it in a comment. Paste the exact file here and give us the link: paste.ubuntu.com
– chili555
Jun 11 at 18:01












paste.ubuntu.com/p/2xSM5fDgmZ
– Serdar Uckun
Jun 11 at 18:03




paste.ubuntu.com/p/2xSM5fDgmZ
– Serdar Uckun
Jun 11 at 18:03




1




1




The gateway should be the router IP address. With a /25 netmask that is 255.255.255.128 which would mean that whatever 204.XXX.XXX.whatever the last three are would have to match. In that mask, 126 would be the last IP of the subnet meaning that 127 is the broadcast IP and 129 would be the start of the next one with 128 being the network and 255 being the broadcast. So, if the gateway is not in the IP address range it will not work. Use subnet-calculator.com/subnet.php?net_class=C for figuring out IP addresses.
– Terrance
Jun 11 at 18:16





The gateway should be the router IP address. With a /25 netmask that is 255.255.255.128 which would mean that whatever 204.XXX.XXX.whatever the last three are would have to match. In that mask, 126 would be the last IP of the subnet meaning that 127 is the broadcast IP and 129 would be the start of the next one with 128 being the network and 255 being the broadcast. So, if the gateway is not in the IP address range it will not work. Use subnet-calculator.com/subnet.php?net_class=C for figuring out IP addresses.
– Terrance
Jun 11 at 18:16
















active

oldest

votes











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',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
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%2f1045682%2fstatic-ip-config-for-ubuntu-server-18-04-lts-w-netplan%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1045682%2fstatic-ip-config-for-ubuntu-server-18-04-lts-w-netplan%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491