Set gateway and DNS in shell



  • Hi.

    I'm connected to pfSense over another machine, and trying to define gateway on WAN, so I could get to management interface.

    There is no such option in pfSense shell settings, any idea how to sent the gateway and DNS?

    Thanks.


  • Rebel Alliance Developer Netgate

    Permanently? Not so easy. Temporarily, easy.

    echo "nameserver x.x.x.x" > /etc/resolv.conf
    route add default y.y.y.y
    

    Where x.x.x.x is your DNS and y.y.y.y is your gateway.

    Once you're in the GUI, fix up the settings properly and you're good.



  • @jimp:

    Permanently? Not so easy. Temporarily, easy.

    echo "nameserver x.x.x.x" > /etc/resolv.conf
    route add default y.y.y.y
    

    Where x.x.x.x is your DNS and y.y.y.y is your gateway.

    Once you're in the GUI, fix up the settings properly and you're good.

    Perfect this is exactly what I needed..

    nothing like trying to configure using GUI via super delayed remote console link ugh


Log in to reply