How to disable or change GUI Bind address on FreeNAS 11?

Status
Not open for further replies.

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Hi,

I am doing some experimentation on my laptop with FreeNAS 11-U2 before I can start updating my FreeNAS 9.10 server.
I have installed a fresh copy of FreeNAS 11-U2 on my laptop and restored a backup of my server configuration to it.
I have changed the address , but I can't seem to figure out a way to reassign or delete the "WebGUI IPv4 Address" which informs FreeNAS to bind to a specific address.
Because the server is live, I can't reassign the address on the laptop to match the server's address.
Long story short, how can I reassign the bind address for the WebGUI through the shell interface on FreeNAS 11?
 
Last edited by a moderator:

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
I don't quite understand your problem. Where did you install FreeNAS? When FreeNAS boots, don't you see the command menu? There is an option to change it there.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Hi Pschatz100,

I have installed FreeNAS on my laptop (before anybody flares at this setup, this is not going to become a NAS server).
I used the fresh install procedure which requires to load the ISO on a media (one USB) and perform the install to another USB.
Once done, I remotely connected to my laptop via the Web interface. No problem there. Then I uploaded the freenas-FreeNAS-9.10.2-U2 XXXXXXXX.db file and upon reboot, I went to the prompt on the laptop to reinitialize the LAN IP address to match the new network adapter. ( Selecting option 1)
As said earlier, I can't use the same IP address as the server where the freenas-FreeNAS-9.10.2-U2 XXXXXXXX.db originates from.
My server is using WebGUI bind to a specific IP address it currently is assigned to.

Unless I missed something, I have no clue how unbind or override the WebGUI binding address on the laptop using the prompt options or shell (I don't know were to look)?

Do you understand now?
 
Last edited by a moderator:

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
Not really. After you update the FreeNAS configuration and reboot the laptop, the command menu appears on the laptop screen. OK. Why can't you change the IP address from that menu?

Personally, I think you are wasting your time testing on a laptop. Laptops often require proprietary device drivers that FreeNAS (and FreeBSD) won't have. Even if you complete the base install OK, there are likely to be lots of problems actually running the system.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Obviously, you don't seem to understand.
I have changed the IP address from the command shell (Option 1 on the screen).
Once done, I try to access the server on the laptop using the web interface, AKA Firefox connecting to https:\XXX.XXX.XXX.XXX, which by the way is seating on the table. Could it be the reason why this is not working? Just being sarcastic.

Maybe I am wasting my time doing it on the laptop, but I'd rather waste my time doing that than wasting my time trying to do it on my server which might break my server which would be saving even more of my time, for which I will not have enough time to fix in time, maybe after some time maybe, but I think I should leave this idea for another time.

Let me ask you this, are you familiar with "Bind" at all, and how it applies to the web interface?
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Update for myself, so I can get back to this page when the time comes when I need not waste my time looking for the answer to my problem. Or for anybody else who might think I am wasting my time:

So to give some background to the issue at hand:

Problem:

1) I have Freenas web interface using default IP address of let's say 192.168.1.20.
2) System reboots on a different IP address, or I want to install an image copy of by Freenas configuration onto another system on the same network.
3) the new system and the old system are on the same network, but they can't have the same IP address.
4) WebGUI under Freenas Web interface is bond to address 192.168.1.20 and will only reply when it is on that same IP address.
5) On the new system, I reassign the IP address to 192.168.1.30. I can ping the system but I cannot access the web interface by entering 192.168.1.30 due to the binding in place.

Solution:

1) Access the shell on the command menu.
2) I didn't know which file to look for so I searched online and found some information on grep.
3) Using grep with the following syntax lead me to a few files containing the text:

grep -lri "192.168.1.20" /etc

The file of interest is:

/etc/local/smb4.conf

4) I edited "/etc/loacl/smb4.conf" with "nano" using the following command:

nano /etc/local/smb4.conf
5) There are 2 lines of interest I edited, but upon saving the information was not retained.
6) I checked the permission of the files which was not allowing me to write its content. So I used the following command:

ls -lh /etc/local/smb4.conf

By default the permission is set to 644, so I changed it to 777 for the time being:

chmod 777 /etc/local/smb4.conf

7) Now I can edit the file with "nano":

nano /etc/local/smb4.conf

8) Updating "interface = 127.0.0.1 192.168.1.20" to "interface = 127.0.0.1 192.168.1.30"
Updating "bind interfaces only = yes" to "bind interfaces only = no"
9) Save the file and change permission back to what it used to be. In this case 644:

chmod 644 /etc/local/smb4.conf

10) Access Freenas via the Web interface and use 192.168.1.30.

Fin. ( "The end" for the non Francophone)
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Solution:
Alternate solution:
  1. In the web GUI, go to System -> General, and set Web GUI IPv4 Address to 0.0.0.0
  2. Go to Network -> Interfaces and change the IP address.
I have no idea how editing smb4.conf would have had any effect on the web GUI.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Alternate solution:
  1. In the web GUI, go to System -> General, and set Web GUI IPv4 Address to 0.0.0.0
  2. Go to Network -> Interfaces and change the IP address.
I have no idea how editing smb4.conf would have had any effect on the web GUI.
Hi Danb35,

I wish it was that simple.
The solution you are providing relies on having access to the Web GUI, which is not accessible to begin with.
Unless you are saying you are making the changes on the system that is live, then backup the config and install it on the new machine. For sure it will work, but I didn't want to go that route because I didn't want to mess with the server IP address as it might break things without proper reboot.
I found editing smb4.conf to fix the access was strange, but it is the only file I came across which was reffering to "binding", without running a search across the entire system.
Maybe I missed something.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
The only change you'd need to make on the live system would be the GUI binding set to 0.0.0.0. Then you could back up that config (and then change the GUI binding address back if desired), put it on the second machine, and reconfigure the IP via the console.

Alternatively, I'm sure you could work out how to change the GUI binding address directly in the config database using SQLite, but that's getting very hack-ish.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Is binding really necessary to begin with? I was under the impression binding was only required to improve security in the event Freenas would get assigned an IP address that would be exposed to the internet?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Is binding really necessary to begin with?
That's up to you, really. FreeNAS should never be exposed directly to the Internet, but some installations may have a separate management LAN and want the GUI only available on that network. That's the only place where I'd see any value in setting the GUI to anything other than 0.0.0.0.
 
Status
Not open for further replies.
Top