Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    spoof mac

    Scheduled Pinned Locked Moved General pfSense Questions
    7 Posts 3 Posters 429 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • U
      UClinux
      last edited by

      Net:
      192.168.224.1(Win81) ---- vlan224_pf_Lan_192.168.224.254 -- vlan223_pf_Wan_192.168.223.254 ---- 192.168.223.1_vlan223_(Win81)

      New installation of pf community version 2.7.2 , configuration:

      2024_1101_1727_27.png
      2024_1101_1727_47.png
      2024_1101_1733_22.png

      According to the forum search information, modify the configuration, add the vmx0(spoof_Mac) interface, and set up a new Mac

      2024_1101_1735_34.png
      2024_1101_1735_47.png

      Test network unavailable
      2024_1101_1736_33.png

      How to solve this problem, thanks!

      johnpozJ 1 Reply Last reply Reply Quote 0
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by

        Did the MAC change on the VLAN interface as shown in ifconfig or Status > Interfaces?

        Can you not change the MAC in the hypervisor instead?

        1 Reply Last reply Reply Quote 1
        • johnpozJ
          johnpoz LAYER 8 Global Moderator @UClinux
          last edited by

          @UClinux what exactly are you trying to accomplish? Normally there is little reason to create vlans in psfense on a esxi install, because you can just create a interface in esxi and assign it to pfsense as another interface..

          An intelligent man is sometimes forced to be drunk to spend time with his fools
          If you get confused: Listen to the Music Play
          Please don't Chat/PM me for help, unless mod related
          SG-4860 24.11 | Lab VMs 2.8, 24.11

          1 Reply Last reply Reply Quote 2
          • U
            UClinux
            last edited by

            Recently, I connected to another network, and the uplink port restricted a certain mac address to communicate. So I tried the spoof mac function.

            @stephenw10
            Yes, it has changed.

            @johnpoz
            ^_^, yes, after posting this topic yesterday, I remembered that I could manually specify the mac address on the virtual machine network card to solve this problem directly.

            Let's discuss. If it is a physical machine environment, the spoof mac function is still needed. I did not test it successfully. Knowing more methods means more choices.

            Search the forum to find topics, some successful, some unsuccessful.

            ps:
            I tried a method to modify it and it worked. I modified /etc/inc/interfaces.inc and added
            mwexec ("/sbin/ifconfig vmx0 ether 40:8d:5c:50:25:19"); However, this is not the officially recommended method. The update may be overwritten, which is not elegant enough.

            johnpozJ 1 Reply Last reply Reply Quote 0
            • johnpozJ
              johnpoz LAYER 8 Global Moderator @UClinux
              last edited by

              @UClinux not sure what they changed in esxi - haven't used it in a while.. But I recall just being able to set the mac right in the gui.

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.8, 24.11

              U 1 Reply Last reply Reply Quote 1
              • U
                UClinux @johnpoz
                last edited by

                Yes, to solve my current problem, I directly specify the MAC of the virtual machine network card.

                In my test /etc/inc/interfaces.inc solution, the esxi port group needs to enable three options (Promiscuous Mode, MAC Address Changes, Forged Transmits) to succeed.

                At present, there are no extra vlan switches around me, and the core switch is a bit far from my office, so I can't connect it directly for testing. There is no condition to test the spoof mac function in a physical environment without esxi.

                Thanks @johnpoz @stephenw10

                1 Reply Last reply Reply Quote 0
                • U
                  UClinux
                  last edited by

                  Supplement, for future reference if someone encounters the same problem.

                  I did some tests later and ruled out pf, but the problem was the same.
                  The final result was that the esxi virtual machine would check the mac match by default. If it does not match the mac in the vmx configuration file, the communication will fail. Customizing the mac on the gui can only set a fixed prefix,

                  Reference:

                  https://community.broadcom.com/vmware-cloud-foundation/discussion/custom-mac-address-in-esx-4#bm65eebd63-587b-41e1-8108-b951b7ef03d0
                  

                  And because the new version of esxi parameter definition checkMACAddress is invalid

                  ethernet1.checkMACAddress = "false"
                  

                  I don't want to enable promiscuous mode in the vds port group, so the final solution is to add a network card to modify the vmx configuration of the virtual machine to define two items:

                  ethernet1.addressType = "static"
                  ethernet1.address = "10:2d:3c:40:55:63"
                  

                  Reference:

                  https://docs.vmware.com/en/VMware-vSphere/8.0/vsphere-networking/GUID-F9243FED-F081-498F-B4A9-EF950292AF77.html
                  

                  Of course, modify mac from the system layer,
                  1, such as pfsense, modify /etc/inc/interfaces.inc Add mwexec ("/sbin/ifconfig vmx0 ether 10:2d:3c:40:55:63"); Updates will be overwritten
                  2, Windows system settings network card mac
                  and then enable the three items (Promiscuous Mode, MAC Address Changes, Forged Transmits) on vds. It is feasible and communication is possible. I did not adopt this solution

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.