Defining Static IP addresses for Multiple NIC adapters

Clash Royale CLAN TAG#URR8PPP up vote
0
down vote
favorite
Just would like to understand how you define static IP addresses for Ubuntu 17.10 server with multiple NIC adapters (i.e.eth0 and eth1) using the /etc/netplan directory. (basically a continuance from this post Ubuntu 17.10 will not accept static IP and thanks to everyone who answered this also)
here's an example of my new /etc/netplan/01-netcfg.yaml which works a treat.
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
dhcp6: no
addresses: [192.168.10.254/24]
gateway4: 192.168.10.1
nameservers:
addresses: [192.168.10.1,192.168.10.252]
how would I define eth1 so it could be on a different subnet (e.g 192.168.20.10/24)?
thanks in advance also!
networking 17.10 ip-address netplan
add a comment |Â
up vote
0
down vote
favorite
Just would like to understand how you define static IP addresses for Ubuntu 17.10 server with multiple NIC adapters (i.e.eth0 and eth1) using the /etc/netplan directory. (basically a continuance from this post Ubuntu 17.10 will not accept static IP and thanks to everyone who answered this also)
here's an example of my new /etc/netplan/01-netcfg.yaml which works a treat.
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
dhcp6: no
addresses: [192.168.10.254/24]
gateway4: 192.168.10.1
nameservers:
addresses: [192.168.10.1,192.168.10.252]
how would I define eth1 so it could be on a different subnet (e.g 192.168.20.10/24)?
thanks in advance also!
networking 17.10 ip-address netplan
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Just would like to understand how you define static IP addresses for Ubuntu 17.10 server with multiple NIC adapters (i.e.eth0 and eth1) using the /etc/netplan directory. (basically a continuance from this post Ubuntu 17.10 will not accept static IP and thanks to everyone who answered this also)
here's an example of my new /etc/netplan/01-netcfg.yaml which works a treat.
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
dhcp6: no
addresses: [192.168.10.254/24]
gateway4: 192.168.10.1
nameservers:
addresses: [192.168.10.1,192.168.10.252]
how would I define eth1 so it could be on a different subnet (e.g 192.168.20.10/24)?
thanks in advance also!
networking 17.10 ip-address netplan
Just would like to understand how you define static IP addresses for Ubuntu 17.10 server with multiple NIC adapters (i.e.eth0 and eth1) using the /etc/netplan directory. (basically a continuance from this post Ubuntu 17.10 will not accept static IP and thanks to everyone who answered this also)
here's an example of my new /etc/netplan/01-netcfg.yaml which works a treat.
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
dhcp6: no
addresses: [192.168.10.254/24]
gateway4: 192.168.10.1
nameservers:
addresses: [192.168.10.1,192.168.10.252]
how would I define eth1 so it could be on a different subnet (e.g 192.168.20.10/24)?
thanks in advance also!
networking 17.10 ip-address netplan
networking 17.10 ip-address netplan
asked Feb 25 at 21:51
Josho
153
153
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
The simple way, just duplicate another stanza like you have right now for your eth0, but call it eth1. Note, this assumes your cards are named 'eth0' and 'eth1' reliably:
# <<Existing config from question goes here>>
eth1:
# Note, "dhcp4/6: no" not needed
addresses: [192.168.20.10/24]
gateway4: 192.168.20.1
nameservers:
addresses: [192.168.20.1,192.168.20.252]
Complete Example:
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
eth0:
# Note, "dhcp4/6: no" not needed
addresses: [192.168.10.254/24]
gateway4: 192.168.10.1
nameservers:
addresses: [192.168.10.1,192.168.10.252]
eth1:
# Note, "dhcp4/6: no" not needed
addresses: [192.168.20.10/24]
gateway4: 192.168.20.1
nameservers:
addresses: [192.168.20.1,192.168.20.252]
If you find that your cards /dev/<ifname> gives you fits, you can also match the stanza on mac address, or other properties. Adding something like the following under the correct device stanza will help. See netplan(5) for more information:
match:
macaddress: 00:11:22:33:44:55
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
The simple way, just duplicate another stanza like you have right now for your eth0, but call it eth1. Note, this assumes your cards are named 'eth0' and 'eth1' reliably:
# <<Existing config from question goes here>>
eth1:
# Note, "dhcp4/6: no" not needed
addresses: [192.168.20.10/24]
gateway4: 192.168.20.1
nameservers:
addresses: [192.168.20.1,192.168.20.252]
Complete Example:
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
eth0:
# Note, "dhcp4/6: no" not needed
addresses: [192.168.10.254/24]
gateway4: 192.168.10.1
nameservers:
addresses: [192.168.10.1,192.168.10.252]
eth1:
# Note, "dhcp4/6: no" not needed
addresses: [192.168.20.10/24]
gateway4: 192.168.20.1
nameservers:
addresses: [192.168.20.1,192.168.20.252]
If you find that your cards /dev/<ifname> gives you fits, you can also match the stanza on mac address, or other properties. Adding something like the following under the correct device stanza will help. See netplan(5) for more information:
match:
macaddress: 00:11:22:33:44:55
add a comment |Â
up vote
1
down vote
accepted
The simple way, just duplicate another stanza like you have right now for your eth0, but call it eth1. Note, this assumes your cards are named 'eth0' and 'eth1' reliably:
# <<Existing config from question goes here>>
eth1:
# Note, "dhcp4/6: no" not needed
addresses: [192.168.20.10/24]
gateway4: 192.168.20.1
nameservers:
addresses: [192.168.20.1,192.168.20.252]
Complete Example:
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
eth0:
# Note, "dhcp4/6: no" not needed
addresses: [192.168.10.254/24]
gateway4: 192.168.10.1
nameservers:
addresses: [192.168.10.1,192.168.10.252]
eth1:
# Note, "dhcp4/6: no" not needed
addresses: [192.168.20.10/24]
gateway4: 192.168.20.1
nameservers:
addresses: [192.168.20.1,192.168.20.252]
If you find that your cards /dev/<ifname> gives you fits, you can also match the stanza on mac address, or other properties. Adding something like the following under the correct device stanza will help. See netplan(5) for more information:
match:
macaddress: 00:11:22:33:44:55
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
The simple way, just duplicate another stanza like you have right now for your eth0, but call it eth1. Note, this assumes your cards are named 'eth0' and 'eth1' reliably:
# <<Existing config from question goes here>>
eth1:
# Note, "dhcp4/6: no" not needed
addresses: [192.168.20.10/24]
gateway4: 192.168.20.1
nameservers:
addresses: [192.168.20.1,192.168.20.252]
Complete Example:
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
eth0:
# Note, "dhcp4/6: no" not needed
addresses: [192.168.10.254/24]
gateway4: 192.168.10.1
nameservers:
addresses: [192.168.10.1,192.168.10.252]
eth1:
# Note, "dhcp4/6: no" not needed
addresses: [192.168.20.10/24]
gateway4: 192.168.20.1
nameservers:
addresses: [192.168.20.1,192.168.20.252]
If you find that your cards /dev/<ifname> gives you fits, you can also match the stanza on mac address, or other properties. Adding something like the following under the correct device stanza will help. See netplan(5) for more information:
match:
macaddress: 00:11:22:33:44:55
The simple way, just duplicate another stanza like you have right now for your eth0, but call it eth1. Note, this assumes your cards are named 'eth0' and 'eth1' reliably:
# <<Existing config from question goes here>>
eth1:
# Note, "dhcp4/6: no" not needed
addresses: [192.168.20.10/24]
gateway4: 192.168.20.1
nameservers:
addresses: [192.168.20.1,192.168.20.252]
Complete Example:
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
eth0:
# Note, "dhcp4/6: no" not needed
addresses: [192.168.10.254/24]
gateway4: 192.168.10.1
nameservers:
addresses: [192.168.10.1,192.168.10.252]
eth1:
# Note, "dhcp4/6: no" not needed
addresses: [192.168.20.10/24]
gateway4: 192.168.20.1
nameservers:
addresses: [192.168.20.1,192.168.20.252]
If you find that your cards /dev/<ifname> gives you fits, you can also match the stanza on mac address, or other properties. Adding something like the following under the correct device stanza will help. See netplan(5) for more information:
match:
macaddress: 00:11:22:33:44:55
answered Feb 25 at 23:44
dpb
4,90911545
4,90911545
add a comment |Â
add a comment |Â
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%2f1009747%2fdefining-static-ip-addresses-for-multiple-nic-adapters%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