Forcing media and mediaopt with VLANs



  • The scenario is that our connection to the outside world is via Ethernet with two VLANs configured, VLANs 2 and 4. No default VLAN or VLAN 1. Under pfSense, I've configured those VLANs on em0, and one of those VLANs on each of two interfaces, WAN and LAN. Everything works fine, but I noticed that the interfaces are auto-negotiating to 10baseT and half-duplex when they should be 10baseT full-duplex. This happened when we had a Cisco router in the same spot, so I'm not that surprised.

    Forcing it via the command-line (ie. ifconfig em0 medio 10baseT/UTP mediaopt full-duplex) works great, but I would like this to stick after a reboot.

    The GUI doesn't (yet) support forcing media and mediaopt at all. There are documented ways to force it by making changes to a backup of the system and restoring the modified backup. (Just add <media>10baseT/UTP</media> and <mediaopt>full-duplex</mediaopt> to the relevant interface section. Here's the rub: Depending on how you look at it, my configuration either doesn't have an appropriate place to put these or it has two places to put them. I've tried putting them in both the WAN and LAN interfaces and doing a restore, but it has no effect.

    Is there anything else I can try to get these settings to survive a reboot? In any case, I'm looking forward to 2.1 which will hopefully add the ability to force media settings in the GUI.


  • Netgate Administrator

    You have to apply that to em0 not a vlan interface.
    To do that you need to assign em0 to another interface which you will not use. You should then be able to set the media type through the webgui under advanced.

    Steve



  • It's in the GUI in 2.0.x. You have to do it on the parent interface, not the VLAN.



  • It's been a while. Thought I would check on any replies to my past posts and then realised that I still have this problem.

    So yes, the webconfigurator has an option for setting the speed and duplex settings on an interface. Unfortunately, my only choice is the default and autoselect. The interface makes me think that it is trying to sense what options are there, but it only comes up with autoselect.



  • @Rural:

    So yes, the webconfigurator has an option for setting the speed and duplex settings on an interface. Unfortunately, my only choice is the default and autoselect.

    I'm running pfSense 2.01. and have two VLANs on physical interface vr0. If I try to set Speed and duplex on one of the VLAN interfaces the only option I'm given is autoselect. If I try to set Speed and duplex on vr0 I am given the options autoselect, 100baseTX full-duplex, 100baseTX, 10baseT/UTP full-duplex etc.

    This is consistent with CMB's earller reply:@cmb:

    It's in the GUI in 2.0.x. You have to do it on the parent interface, not the VLAN.



  • It auto-detects what the NIC supports, which in the case of a virtual interface like a VLAN, is nothing but auto.

    As I noted above, do it on the parent physical NIC.



  • cmb nailed it…twice. In my case, I don't have an interface associated with the (VLANless) physical interface. That was what was confounding me. Although it irks me a bit to create an interface just to provide an interface to the physical settings underlying my WAN interface (which sits on a VLAN), I can live with that. I've added a WANPHYSICAL interface and configured nothing other than speed and duplex settings (100baseTX full-duplex in my case). Works like a charm.

    Thanks!


  • Netgate Administrator

    Pretty much what I said above then.  ;)
    Glad to know I wasn't wrong.

    Steve


Log in to reply