1

In short I have 1 physical NIC, I would need to simulate a 2nd (virtual) interface (different MAC, BOOTPROTO, etc..) which would be connected to the same subnet as the physical NIC.

I've tried many different setup but unsuccessfully so far. How can I achieve this?

3
  • You meant eth0:1 with different MAC.You should use MACChanger to change MAC address.Actually you can create eth0:1 using command line and put it on /etc/rc.d/rc.local.
    – supriady
    Dec 31, 2016 at 0:21
  • MACChanger is more a trick than an actual solution. Anyway, I've found a suitable solution
    – Syffys
    Jan 1, 2017 at 12:44
  • When you created virtual interface.You didnt need to change MAC address.Virtual interface still works fine with Same MAC address.Changing MAC address just wanted to cheat network security. Some switches L3 can block it based on MAC address.
    – supriady
    Jan 1, 2017 at 12:56

1 Answer 1

1

I have found how to setup fully virtual interfaces here. Hence

Create both ifup-macvlan and ifdown-macvlan scripts at /etc/sysconfig/network-scripts Create your ifcfg-veth0 (with the name you want)

DEVICE="veth0"
DEVICETYPE="macvlan"
TYPE="macvtap"
BOOTPROTO="dhcp"
ONBOOT="yes"
NM_CONTROLLED="no"
MACADDR="AB:CD:EF:GH:IJ:KL"
MACVLAN_PARENT="enp0s31f6"

Then

  • customize BOOTPROTO to static/dhcp
  • set MACADDR to the dummy value you want
  • set MACVLAN_PARENT to the proper physical interface
3
  • You are funny.Because you created virtual interface as dhcp client.So DHCP server should provide 2 IP addresses to your network interface.You used it for what's purpose?
    – supriady
    Jan 1, 2017 at 13:09
  • My original goal is as in this question: to setup an all-in-one openstack platform, it is needed to have 2 physical NIC, which I do not have. Hence, I can simulate this 2nd NIC this way. The dhcp was just there as an example, but I do not even need to have an IP address on this interface, I use it with BOOTPROTO="none". Unfortunatelly, it's not sufficient to get my Openstack install to work as expected...
    – Syffys
    Jan 1, 2017 at 17:13
  • BOOTPROTO="static" when you used static IP address.
    – supriady
    Jan 1, 2017 at 17:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .