Find the answer to your Linux question:
Results 1 to 8 of 8
Hi all, I'm trying to setup a CentOS 5.5 with 1 NIC to have several IP addresses on same subnet, each with different MAC addresses. I tried macvlan and multimac ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2007
    Posts
    6

    Pls help: multiple MAC/IP address per NIC


    Hi all,

    I'm trying to setup a CentOS 5.5 with 1 NIC to have several IP addresses on same subnet, each with different MAC addresses. I tried macvlan and multimac but both gives same MAC address (the one of physical NIC) for all IP addresses configured in ARP table on remote hosts. Is it possible to send the 'right' MAC address in ARP requests of corresponding IP address?

    Thanks a lot.
    /ST Wong

  2. #2
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    I would guess: No, unless your hardware supports it.

  3. #3
    Just Joined!
    Join Date
    Mar 2007
    Posts
    6
    Thanks, but I just wonder if I can do something like VMware or Xen, on which different guest OSes have publish different MAC addresses through the same physical NIC...

  4. #4
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    You aren't allowed to publish invented MAC addresses.

    Unlike in IPv4 where "private" subnets exist as defined in RFC 1918 and RFC 4193 (10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/12) the MAC address ranges are all limited and used by the NIC manufactors. One therefore should NEVER try to invent one himself as that could result in really strange network behaviour once two NICs with the same MAC coexist unless you bought a NIC and use that MAC address, but then you can even plug it into the xen host.

    We always used NAT routing between the xen host and the xen instances to let them communicate with the world through a real (existing) network interface controller or we provided a second network interface controller that was exclusively used by a single xen instance. But the exact configuration would depend completely on the specific usecase / requirements.

  5. #5
    Just Joined!
    Join Date
    Jan 2011
    Posts
    3
    Asking if how to give a device more MAC addresses makes absolutely no sense and show's how little you know about networking. Go learn about ARP and ethernet.

    Multiple IP addresses makes sense however and can be done by using ifconfig's alias option. Check it's manpage for details.

  6. #6
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Quote Originally Posted by mharv87 View Post
    Asking if how to give a device more MAC addresses makes absolutely no sense and show's how little you know about networking. Go learn about ARP and ethernet.
    This was WAY out of line!

    Multiple MAC's are used all the time when hosting VM's.

    Multiple IP addresses makes sense however and can be done by using ifconfig's alias option. Check it's manpage for details.
    Actually you can have more then one MAC on an interface. The tool for this is Multimac.

    As you have stated:
    ... show's how little you know....
    Maybe you should go learn about that tool also?

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  7. #7
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    Agreed and +1 to blame mharv87 for being rude. But still nowadays it makes more sense to just plug in another NIC as they come cheaper and cheaper every day. Also in the multimac project there is no activity since 2 years and not many use it cause in real life applications only few need it (namely in the case when one ran out of PCI and all other slots where you can attach a NIC).

  8. #8
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    It really depends on what you are doing. Some times another NIC is the answer but when slots are not free or you need to do some testing then working in a VM might be a better answer.

    As to that project I am not following it.

    And you can have more then one MAC per NIC

    Code:
    ~ $ ip neigh show
    192.168.15.1 dev eth0 lladdr 00:14:bf:91:21:56 nud reachable
    192.168.2.100 dev eth2 lladdr 00:0b:db:c0:6e:97 nud reachable
    192.168.1.100 dev eth1 lladdr 48:5b:39:2a:07:d5 nud reachable
    192.168.1.101 dev eth1 lladdr 54:52:00:6d:34:88 nud reachable
    1.100 and 1.101 are the same machine. The above is from my linux box router.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •