Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
R remotebootserver
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 12
    • Issues 12
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • remote-boot
  • remotebootserver
  • Wiki
  • setting static ipv4 to our server

setting static ipv4 to our server · Changes

Page history
marceloonit created page: setting static ipv4 to our server authored Nov 09, 2017 by Marcelo Oliveira's avatar Marcelo Oliveira
Hide whitespace changes
Inline Side-by-side
Showing with 70 additions and 0 deletions
+70 -0
  • setting-static-ipv4-to-our-server.md setting-static-ipv4-to-our-server.md +70 -0
  • No files found.
setting-static-ipv4-to-our-server.md 0 → 100644
View page @ 4495dc63
If you already did it, just jump to the Server packages chapter.
Any server needs a static IP address. Lets configure ours.
Editing /etc/network/interfaces file
[remoteos][command]
root@debian:~# vi /etc/network/interfaces
Below it is how the file comes as default. As you can see we have only one ethernet card declared here, ens3, my server has only one network card, because it isn’t going to be a router, it is going to be just a remote boot server running in the local network.
[whole][file content][/etc/network/interfaces]
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug ens3
iface ens3 inet dhcp
And below it is how the file is after our changes
[whole][file content][/etc/network/interfaces]
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug ens3
iface ens3 inet static
address 192.168.70.5
netmask 255.255.255.0
gateway 192.168.70.1
As listed at the beginning of the tutorial, the server IPv4 address is 192.168.70.5, its network is 192.168.70.0/24 and the network gateway is 192.168.70.1.
Now we are going to set your hostname up.
[remoteos][command]
root@debian:~# hostnamectl set-hostname remoteos
or
[remoteos][command]
root@debian:~# hostnamectl set-hostname remoteos.mylocaldomain.com
The second command, if you have a domain in your local network and want to set a Fully Qualified Domain Name to your server.
And now, just to make sure your server can resolve names properly check your resolv.conf file to see what DNS server is set.
[remoteos][command]
root@remoteos:~# vi /etc/resolv.conf
[file content]
nameserver 8.8.8.8
nameserver 8.8.4.4
The two lines above are the content of my /etc/resolv.conf file. They are DNS servers from Google, if your server isn't reaching names on Internet, just replace your file’s content to match my file’s content and you will be fine.
After all those changes we need to restart network service or reboot the server. The command to restart network in Debian 9 is:
[remoteos][command]
root@debian:~# systemctl restart networking
The command above should restart the server network service and apply the new network configurations. In my experiences it didn't work thus I had to reboot the server, if it also doesn’t work for you, just reboot the server.
\ No newline at end of file
Clone repository
  • conventions
  • Home
  • server and iso details
  • server packages
  • setting static ipv4 to our server