Rename network interface ubuntu on instance boot cloud-init
Clash Royale CLAN TAG#URR8PPP
up vote
-3
down vote
favorite
I have two network interfaces- eth0 and eth1 on the Ubuntu image I am building. I want to create cloud instances from that image. For every cloud instance it creates, every instance will have those two network interfaces. However, the requirement is that, the interfaces are renamed to, say, interface0 and interface1 respectively. How can I configure that using cloud-init on instance boot up?
linux ubuntu cloud cloud-init
add a comment |Â
up vote
-3
down vote
favorite
I have two network interfaces- eth0 and eth1 on the Ubuntu image I am building. I want to create cloud instances from that image. For every cloud instance it creates, every instance will have those two network interfaces. However, the requirement is that, the interfaces are renamed to, say, interface0 and interface1 respectively. How can I configure that using cloud-init on instance boot up?
linux ubuntu cloud cloud-init
add a comment |Â
up vote
-3
down vote
favorite
up vote
-3
down vote
favorite
I have two network interfaces- eth0 and eth1 on the Ubuntu image I am building. I want to create cloud instances from that image. For every cloud instance it creates, every instance will have those two network interfaces. However, the requirement is that, the interfaces are renamed to, say, interface0 and interface1 respectively. How can I configure that using cloud-init on instance boot up?
linux ubuntu cloud cloud-init
I have two network interfaces- eth0 and eth1 on the Ubuntu image I am building. I want to create cloud instances from that image. For every cloud instance it creates, every instance will have those two network interfaces. However, the requirement is that, the interfaces are renamed to, say, interface0 and interface1 respectively. How can I configure that using cloud-init on instance boot up?
linux ubuntu cloud cloud-init
linux ubuntu cloud cloud-init
asked Aug 24 at 1:16
user304255
1
1
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
The docs for cloud-init show the following examples in this section - Networking Config Version 2:
# all cards on second PCI bus
match:
name: enp2*
# fixed MAC address
match:
macaddress: 11:22:33:AA:BB:FF
# first card of driver ``ixgbe``
match:
driver: ixgbe
name: en*s0
So long as the match is specific to a single device, you can use the set-name:
to define whatever name you want for the interface.
set-name: <(scalar)>
When matching on unique properties such as path or MAC, or with additional assumptions such as âÂÂthere will only ever be one wifi deviceâÂÂ, match rules can be written so that they only match one device. Then this property can be used to give that device a more specific/desirable/nicer name than the default from udevâÂÂs ifnames. Any additional device that satisfies the match rules will then fail to get renamed and keep the original kernel name (and dmesg will show an error).
For example:
$ cat /etc/cloud/cloud.cfg.d/custom-networking.cfg
network:
version: 2
ethernets:
interface0:
match:
mac_address: "52:54:00:12:34:00"
set-name: interface0
addresses:
- 192.168.1.10/255.255.255.0
gateway4: 192.168.1.254
On boot, how will the instance have the mac_address information available? I am talking about the case when we want to spin instances from a VM image on a hypervisor. The NIC MAC address information will not be able to be hard coded.
â user304255
Aug 27 at 18:48
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
The docs for cloud-init show the following examples in this section - Networking Config Version 2:
# all cards on second PCI bus
match:
name: enp2*
# fixed MAC address
match:
macaddress: 11:22:33:AA:BB:FF
# first card of driver ``ixgbe``
match:
driver: ixgbe
name: en*s0
So long as the match is specific to a single device, you can use the set-name:
to define whatever name you want for the interface.
set-name: <(scalar)>
When matching on unique properties such as path or MAC, or with additional assumptions such as âÂÂthere will only ever be one wifi deviceâÂÂ, match rules can be written so that they only match one device. Then this property can be used to give that device a more specific/desirable/nicer name than the default from udevâÂÂs ifnames. Any additional device that satisfies the match rules will then fail to get renamed and keep the original kernel name (and dmesg will show an error).
For example:
$ cat /etc/cloud/cloud.cfg.d/custom-networking.cfg
network:
version: 2
ethernets:
interface0:
match:
mac_address: "52:54:00:12:34:00"
set-name: interface0
addresses:
- 192.168.1.10/255.255.255.0
gateway4: 192.168.1.254
On boot, how will the instance have the mac_address information available? I am talking about the case when we want to spin instances from a VM image on a hypervisor. The NIC MAC address information will not be able to be hard coded.
â user304255
Aug 27 at 18:48
add a comment |Â
up vote
0
down vote
The docs for cloud-init show the following examples in this section - Networking Config Version 2:
# all cards on second PCI bus
match:
name: enp2*
# fixed MAC address
match:
macaddress: 11:22:33:AA:BB:FF
# first card of driver ``ixgbe``
match:
driver: ixgbe
name: en*s0
So long as the match is specific to a single device, you can use the set-name:
to define whatever name you want for the interface.
set-name: <(scalar)>
When matching on unique properties such as path or MAC, or with additional assumptions such as âÂÂthere will only ever be one wifi deviceâÂÂ, match rules can be written so that they only match one device. Then this property can be used to give that device a more specific/desirable/nicer name than the default from udevâÂÂs ifnames. Any additional device that satisfies the match rules will then fail to get renamed and keep the original kernel name (and dmesg will show an error).
For example:
$ cat /etc/cloud/cloud.cfg.d/custom-networking.cfg
network:
version: 2
ethernets:
interface0:
match:
mac_address: "52:54:00:12:34:00"
set-name: interface0
addresses:
- 192.168.1.10/255.255.255.0
gateway4: 192.168.1.254
On boot, how will the instance have the mac_address information available? I am talking about the case when we want to spin instances from a VM image on a hypervisor. The NIC MAC address information will not be able to be hard coded.
â user304255
Aug 27 at 18:48
add a comment |Â
up vote
0
down vote
up vote
0
down vote
The docs for cloud-init show the following examples in this section - Networking Config Version 2:
# all cards on second PCI bus
match:
name: enp2*
# fixed MAC address
match:
macaddress: 11:22:33:AA:BB:FF
# first card of driver ``ixgbe``
match:
driver: ixgbe
name: en*s0
So long as the match is specific to a single device, you can use the set-name:
to define whatever name you want for the interface.
set-name: <(scalar)>
When matching on unique properties such as path or MAC, or with additional assumptions such as âÂÂthere will only ever be one wifi deviceâÂÂ, match rules can be written so that they only match one device. Then this property can be used to give that device a more specific/desirable/nicer name than the default from udevâÂÂs ifnames. Any additional device that satisfies the match rules will then fail to get renamed and keep the original kernel name (and dmesg will show an error).
For example:
$ cat /etc/cloud/cloud.cfg.d/custom-networking.cfg
network:
version: 2
ethernets:
interface0:
match:
mac_address: "52:54:00:12:34:00"
set-name: interface0
addresses:
- 192.168.1.10/255.255.255.0
gateway4: 192.168.1.254
The docs for cloud-init show the following examples in this section - Networking Config Version 2:
# all cards on second PCI bus
match:
name: enp2*
# fixed MAC address
match:
macaddress: 11:22:33:AA:BB:FF
# first card of driver ``ixgbe``
match:
driver: ixgbe
name: en*s0
So long as the match is specific to a single device, you can use the set-name:
to define whatever name you want for the interface.
set-name: <(scalar)>
When matching on unique properties such as path or MAC, or with additional assumptions such as âÂÂthere will only ever be one wifi deviceâÂÂ, match rules can be written so that they only match one device. Then this property can be used to give that device a more specific/desirable/nicer name than the default from udevâÂÂs ifnames. Any additional device that satisfies the match rules will then fail to get renamed and keep the original kernel name (and dmesg will show an error).
For example:
$ cat /etc/cloud/cloud.cfg.d/custom-networking.cfg
network:
version: 2
ethernets:
interface0:
match:
mac_address: "52:54:00:12:34:00"
set-name: interface0
addresses:
- 192.168.1.10/255.255.255.0
gateway4: 192.168.1.254
edited Aug 24 at 2:41
answered Aug 24 at 2:31
slmâ¦
238k65494664
238k65494664
On boot, how will the instance have the mac_address information available? I am talking about the case when we want to spin instances from a VM image on a hypervisor. The NIC MAC address information will not be able to be hard coded.
â user304255
Aug 27 at 18:48
add a comment |Â
On boot, how will the instance have the mac_address information available? I am talking about the case when we want to spin instances from a VM image on a hypervisor. The NIC MAC address information will not be able to be hard coded.
â user304255
Aug 27 at 18:48
On boot, how will the instance have the mac_address information available? I am talking about the case when we want to spin instances from a VM image on a hypervisor. The NIC MAC address information will not be able to be hard coded.
â user304255
Aug 27 at 18:48
On boot, how will the instance have the mac_address information available? I am talking about the case when we want to spin instances from a VM image on a hypervisor. The NIC MAC address information will not be able to be hard coded.
â user304255
Aug 27 at 18:48
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
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%2funix.stackexchange.com%2fquestions%2f464537%2frename-network-interface-ubuntu-on-instance-boot-cloud-init%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
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');
);
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');
);
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