How to rename interface



  • Hi everyone!

    We have two identical machines with pfSense installed. This is done for a failover - if one machine for some reason will not work, we could power-up another one and reconnect all links from one to another in few minutes.

    But I've got a problem - in despite of having identical hardware, first machine and second machine have assigned different interface names for NIC's.
    For example 1'st machine has em0 to NIC1 and em1 to NIC2. Second machine assigned em0 to NIC2 and em1 to NIC1. So now I can't use one configuration for both machines - every time i have to reconfigure interfaces in pfSense GUI.

    So, how can I rename interfaces in pfSense to make one config usable for both machines?

    Thanks.



  • Backup config on firewall2, edit it, swap interfaces em0 <-> em1.

    Then restore changed config and swap cables.

    I suggest you reading about carp and change your config to a full redundand and syncronized setup.
    You may need a switch with vlans to stop cable switching.



  • 2 marcelloc: ok, thanks for idea with CARP! I'l look on it.

    But my question was how to rename interface in system, not in config.
    I tried "ifconfig em0 name em2" - that's work, but untill rebooting only…



  • Yeah! I'v got it!

    In the end of /etc/rc I've added:

    ifconfig em0 name em2 #to release em0 name
    ifconfig em1 name em0 #to change em1 to em0
    ifconfig em2 name em1 #to change ex-em0 to em1

    exit 0

    Renaming is done on every reboot…



  • Everything good, but it isn't help… Ifconfig shows new names of interfaces, but in real they are still assigned to NIC incorrect...


  • Rebel Alliance Developer Netgate

    Renaming like that is a very bad idea. Just swap the cables on the secondary and use the config like you want.



  • Renaming like that is a very bad idea. Just swap the cables on the secondary and use the config like you want.

    If there will be no possibilities to change names, it would be the only way to use it.

    But I still have a hope :)  Maybe I can try to reinstall pfSense in some way, to make correct NIC's naming?


  • Rebel Alliance Developer Netgate

    Why wouldn't changing the cables around "fix" the problem?

    unplug cable from em0
    unplug cable from em1, put it in em0
    plug other cable into em1

    problem solved, now both boxes match what they're using em0 and em1 for.


Log in to reply