change nic name ?

13 views
Skip to first unread message

Mathew Abraham

unread,
Dec 1, 2017, 7:07:55 AM12/1/17
to Vagrant
Hi guys,

Is it possible to change the nic name to custom one using vagrantfile ?  i.e instead of  'enp0s8'  could I specify 'ens100' ?

      c.vm.network :public_network, ip: 192.17.28.180 , netmask: '255.255.255.0'


[vagrant@ansible ~]$ ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255
        inet6 xxxxxxxxxxxxxxx  prefixlen 64  scopeid 0x20<link>
        ether 09:00:30:1f:gc:83  txqueuelen 1000  (Ethernet)
        RX packets 45752  bytes 63057452 (60.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 7547  bytes 558118 (545.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.17.28.180  netmask 255.255.255.0  broadcast 192.17.28.255
        inet6 xxxxxxxxxxxxxx  prefixlen 64  scopeid 0x20<link>
        ether 09:00:30:gc:dc:92  txqueuelen 1000  (Ethernet)
        RX packets 86  bytes 8543 (8.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 55  bytes 8108 (7.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Thanks,
Mathew

Alvaro Miranda Aguilera

unread,
Dec 2, 2017, 10:37:32 AM12/2/17
to vagra...@googlegroups.com
hello

Why you need that?

The nic name is generated by linux based on thinks like pci port.

What requirement you have that relies on the nic name?

alvaro.


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/dfda4d37-4f2f-427b-abc0-d0ad5eda9ba7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mathew Abraham

unread,
Dec 3, 2017, 3:40:03 PM12/3/17
to Vagrant
Hi Alvaro,

Thanks, I was trying to keep the  nic name same for all the developers as my Ansible job configure the VM system  based on the nic name provided. If it differs for each VM then I have to make is as a parameter via data vars. I was just trying to reduce that parameter if possible.

Thanks,
Mathew

Alvaro Miranda Aguilera

unread,
Dec 3, 2017, 5:13:09 PM12/3/17
to vagra...@googlegroups.com
if you disable the new predictable naming you can end with eth0/eth1 etc

you may need to repackage the box or create one from iso.

check about net.ifnames=0 on boot kernel parameter.



--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/0274468b-314c-4de3-b5ff-a1ec1c9bafdc%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages