Default route on wrong interface



  • I'm trying to set of a firewall for my Lan.

    The machines on my lan are all on the 209.133.78.0/23 network.
    The default gateway is my ISPs router at 209.133.78.1
    I have pfsense running on a box that has two interfaces, fxp0 which connects to the lan and fxp1 that connects to the WAN.

    Here is the relevant part of config.xml:

    • <interfaces>- <lan><if>fxp0</if>
        <ipaddr>209.133.79.226</ipaddr>
        <subnet>23</subnet>
        <media><mediaopt><bandwidth>100</bandwidth>
        <bandwidthtype>Mb</bandwidthtype>
        <disableftpproxy><bridge>wan</bridge></disableftpproxy></mediaopt></media></lan>
    • <wan><if>fxp1</if>
        <mtu><media><mediaopt><bandwidth>100</bandwidth>
        <bandwidthtype>Mb</bandwidthtype>
        <spoofmac><disableftpproxy><ipaddr>209.133.79.226</ipaddr>
        <subnet>23</subnet>
        <gateway>209.133.78.1</gateway></disableftpproxy></spoofmac></mediaopt></media></mtu></wan></interfaces>

    Anyway, while I've been setting up the box, I've had it set up so that fxp0 can talk to both my LAN and my ISP router by plugging the pfsense's fxp0 into a switch that had both networks connected.

    When I got my configuration pretty much set up, I plugged the ISP's router into fxp1. At that point, the pfsense box could no longer talk to anything outside the 209.133.78.0/23 network. I did a netstat -rn and found out that the 209.133.78.1 gateway was set up on the fxp0 interface. How do I make the default route code to the fxp1 interface?



  • I found the problem or at least an easy work around.
    If I make fxp0 the WAN and fxp1 the LAN. The pfsense automatically assigns the default gateway to the WAN (fxp0).
    It strikes me that this isn't all that intuitive.
    I think one of these options (or something similar) should be done:

    1. Modify the setup pages so they recommend you use fxp0 for the WAN instead of fxp1.
    2. Modify the rc.interfaces_* scripts so that they set explicitly set the interface when running ifconfig for the default gateway to the interface of the WAN.
    3. Modify the UI and the rc.interfaces scripts to explicitly specify the interface for the default gateway.

Locked