Static IP config for Ubuntu Server 18.04 LTS w/ netplan
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
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]
networking server ethernet static-ip netplan
 |Â
show 12 more comments
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]
networking server ethernet static-ip netplan
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
 |Â
show 12 more comments
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]
networking server ethernet static-ip netplan
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]
networking server ethernet static-ip netplan
edited Jun 11 at 18:24
asked Jun 11 at 17:49
![](https://lh5.googleusercontent.com/-XzHeaOuXuJw/AAAAAAAAAAI/AAAAAAAAAAA/ZG_UORESXno/photo.jpg?sz=32)
![](https://lh5.googleusercontent.com/-XzHeaOuXuJw/AAAAAAAAAAI/AAAAAAAAAAA/ZG_UORESXno/photo.jpg?sz=32)
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
 |Â
show 12 more comments
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
 |Â
show 12 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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