Change default route/gateway from shell

Status
Not open for further replies.

Lucas Rey

Contributor
Joined
Jul 25, 2011
Messages
180
Hello people,
I need to configure FreeNAS from my personal house LAN and then export it to my work office (with another network).
I can change the IP from root shell using the classic ifconfig:
# ifconfig em0 10.97.2.2 netmask 255.255.255.0 up

Now I need to configure the default route/gateway, but the follwoing command (I used in linux tons of times) doesn't work:

route add default 192.168.1.254 or route add default gw 192.168.1.254

I received as error:
Route bad address default or gw

Could someone help me to setup a default route/gateway? Thanks!
 

survive

Behold the Wumpus
Moderator
Joined
May 28, 2011
Messages
875
Hi Lucas,

Why not just switch it to DHCP and then change the IP back to a static when it gets moved?

You should also be able to change the networking from the console once it's at the new location.

-Will
 

Lucas Rey

Contributor
Joined
Jul 25, 2011
Messages
180
Ciao survive,
unfortunately I don't have DHCP on my work office, so I have to setup manually the network interface.

But I just thinking that if I setup the IP from shell (with the mentioned method) maybe I can access the Web Gui and then setup the default GW from there!!!
Btw, just in case, I would like to know how setup the def GW from shell! ;)
 

survive

Behold the Wumpus
Moderator
Joined
May 28, 2011
Messages
875
Hi Lucas,

I think there's an entry in the console screen menu that will let you change it the "correct" way. You want to do everything through FreeNAS-aware tools so the config database gets updated correctly.

-Will
 
Status
Not open for further replies.
Top