Static IP instalation

I went through the Rockstor 4 installation build and install process.
When I completed the installation the server had no IP address, because the network doesn’t use DHCP.
The instructions I found for setting static addresses assume that I can access the web interface to change the configuration.
Without an IP assigned to the server, I’m not sure how to do that.

I assume I need to define an IPv4 address, mask, gateway, and DNS address.

What is the process for installing without DHCP?

Thank you,
Greg

You could probably log in and use the ip command to give it an ip address. That would let you then access it via the web interface and you could use the web interface to then configure static ip address ‘correctly’.

https://www.cyberciti.biz/faq/linux-ip-command-examples-usage-syntax/
says:
ip a add {ip_addr/mask} dev {interface}

(im still getting used to ip vrs the old ifconfig)

5 Likes

Thanks DrC.
I was able to manually set IP then get the web interface to set remaining parameters.

Greg

@greg Welcome to the Rockstor community.

Probably the easiest way to do this would have been to use the command line tool nmcli which stands for Network Manager Command Line Tool. We use it ‘under the hood’ so using that tool pretty much does exactly what Rockstor would do to the network anyway.

Good point about this being a chicken-and-egg situation. We should add the nmcli recommendation to the installer doc. I’ll create a GitHub issue for that.

Well done on getting this sorted anyway and for sharing your findings.

1 Like

Sorted:

1 Like

You and a ‘myip’ script. Why not add a ‘setmyip’ script too? You could put it in place of the ip addresses if no network is configured.

Eg,

log in and use setmyip to configure networking

login:

Have it loop though network devices and prompt for ip / netmask and then do the nmcli stuff behind the scenes. Yeah, i know its wrapping one command in another but it might be more user friendly.

Or i guess you could replace the pre login message with nmcli usage suggestions.

1 Like

@DrC Hello again:
Re:

:slight_smile:

That’s a fine idea, potentially: fancy submitting a pull request proof-of-concept for that. It would need to be in the following repository (as I’m sure you realise but just for the general readership):

See our Contributing to Rockstor - Overview Developers subsection: https://rockstor.com/docs/contribute.html#developers

And the associated script might as well sit along side our existing beginner friendly myip script:

i.e. to end up the root users ~/bin directory i.e. /root/bin

I think a shell script wrapper for nmcli that explains it’s own use without parameters would fit nicely. And given that no DHCP is rare we may not want to ‘cloud’ the terminal message as folks who don’t know better may be distracted, i.e. imaging folks having difficulties connecting being mislead thinking that their lack of ability to reach the Web-UI is down to “Whatever this DHCP thing is” and ending up shooting themselves in the foot with a DHCP override. Nmcli is fairly self evident in it’s use but a wrapper may help here. Or the script may even just print out how to setup a static IP via nmcli. But again I’m keen to not distract the vast majority of folks who may missattribute connection difficulties to this strange suggestion on how they can set a static IP. Thinking it’s another hoop to jump through when almost all the time it isn’t. And the folks that know they don’t have DHCP are often very close the the cause/solution anyway so don’t need the hand holding that the myip script grew from.

Hence my suggestion that the install doc could be used to address this usability issue.

Thanks for the suggestion. Always improvements to be made but we must keep things as simple and distraction free for those who are completely unfamiliar with linux/networking etc.

2 Likes