Network settings

From xotHostWiki
Jump to: navigation, search

When we deliver your server your network is already set up correctly.
This guide is to be used in case you make a change on your configuration which you cannot recover.

Contents

Where to find your server network setting details

For dedicated servers

Network details are given with the welcome email when you receive the server.
Since most probably you will not have SSH access to your server, you need to access yuor VPS via VNC

For VPS

Network details are given with the welcome email when you receive the VPS, and also in the VPS control panel by clicking on your VPS ID and checking the "Notes" box.
In this case you can edit your configuration yourself by logging in to your Control Panel and opening a VNC console.

Network settings per distro

Login to your control panel (as root, or as a designated user under sudo) and open a VNC console.
From there, follow the instructions for your distribution.

ArchLinux

  • Open the file /etc/network.d/ethernet-static with the nano editor, or with the editor of your choice.
[root@remote server ~]# nano /etc/network.d/ethernet-static

Note that "[root@remote server ~]# " is just the shell prompt, and not part of the commands you type. This command opens the file with the nano editor.

  • Edit your it to make it look like this:
CONNECTION='ethernet'
DESCRIPTION='A basic static ethernet connection using iproute'
INTERFACE='eth0'
IP='static'
ADDR='xx.xx.xxx.xx'
#ROUTES=('192.168.0.0/24 via 192.168.1.2')
GATEWAY='xx.xx.xxx.1'
DNS=('208.67.222.222')
  • Replace the "xx" letters by the values given to you with your server.
  • The DNS settings use the OpenDNS for name resolution only. You can replace it with your applicable DNS configuration.
  • When you are finished editting, save the file using Ctrl-O and then exit the editor using Ctrl-X
  • Reload your network:
[root@remote server ~]# systemctl restart network.target

Debian / Ubuntu

  • Open the file /etc/network/interfaces with the nano editor, or with the editor of your choice.
[root@remote server ~]# nano /etc/network/interface

Note that "[root@remote server ~]# " is just the shell prompt, and not part of the commands you type. This command opens the file with the nano editor.

  • Edit your the file to make it look like this:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address xx.xx.xxx.xx
netmask 255.255.255.xxx
gateway xx.xx.xxx.1
  • Replace the "xx" letters by the values given to you with your server.
  • When you are finished editting, save the file using Ctrl-O and then exit the editor using Ctrl-X
  • Now configure DNS with by opening the file /etc/resolv.conf
[root@remote server ~]# nano /etc/resolv.conf
  • Edit your the file to make it look like this:
nameserver 208.67.222.222
  • The DNS settings use the OpenDNS for name resolution only. You can replace it with your applicable DNS configuration.
  • Reload your network:
[root@remote server ~]# /etc/init.d/networking restart

CentOS / Fedora / Scientific Linux / OpenSUSE

  • Open the file /etc/sysconfig/network-scripts/ifcfg-eth0 with the nano editor, or with the editor of your choice.
[root@remote server ~]# nano /etc/sysconfig/network-scripts/ifcfg-eth0

Note that "[root@remote server ~]# " is just the shell prompt, and not part of the commands you type. This command opens the file with the nano editor.

  • Edit your the file to make it look like this:
DEVICE=eth0
BOOTPROTO=static
BROADCAST=xx.xx.xxx.255
IPADDR=xx.xx.xxx.xx
NETMASK=255.255.255.xxx
NETWORK=xx.xx.xxx.0
ONBOOT=yes
  • Replace the "xx" letters by the values given to you with your server. On the "NETWORK" part, change the last digits with 255
  • When you are finished editting, save the file using Ctrl-O and then exit the editor using Ctrl-X

Edit the file /etc/sysconfig/network to look like this

[root@remote server ~]# nano /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=server.domain.com
GATEWAY=xx.xx.xxx.1
  • Now configure DNS with by opening the file /etc/resolv.conf
[root@remote server ~]# nano /etc/resolv.conf
  • Edit your the file to make it look like this:
nameserver 208.67.222.222
  • The DNS settings use the OpenDNS for name resolution only. You can replace it with your applicable DNS configuration.
  • Reload the network:
[root@remote server ~]# service network restart

FreeBSD

  • Check the network card name by issuing the following command:
% ifconfig
  • Edit the file /etc/rc.conf by including the following information:
hostname="server.example.com"
ifconfig_em0="inet xx.xx.xxx.xx
netmask 255.255.255.xxx"
defaultrouter="xx.xx.xxx.1"
  • To setup DNS edit the file /etc/resolv.conf to look like this:
nameserver 208.67.222.222
  • The DNS settings use the OpenDNS for name resolution only. You can replace it with your applicable DNS configuration.
  • Reload your network:
# /etc/rc.d/netif restart

Check if you are Connected

  • To check that your settings are correct, from your local machine, issue the following command:
[user@local-machine ~]$ ping -c3 xx.xx.xxx.xx
  • Where xx.xx.xxx.xx is the IP address of your server
  • You should see something like this:
PING xx.xx.xxx.xx (xx.xx.xxx.xx) 56(84) bytes of data.
64 bytes from xx.xx.xxx.xx: icmp_seq=1 ttl=52 time=261 ms
64 bytes from xx.xx.xxx.xx: icmp_seq=2 ttl=52 time=260 ms
64 bytes from xx.xx.xxx.xx: icmp_seq=3 ttl=52 time=260 ms
--- xx.xx.xxx.xx ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 260.293/260.896/261.730/0.737 ms
  • Now, to check that your server is connected to the internet, login to it via SSH and issue the following command:
[user@remote-server ~]$ ping -c3 google.com
  • You should see something like:
PING google.com (173.194.36.14) 56(84) bytes of data.
64 bytes from bom04s01-in-f14.1e100.net (173.194.36.14): icmp_seq=1 ttl=54 time=43.1 ms
64 bytes from bom04s01-in-f14.1e100.net (173.194.36.14): icmp_seq=2 ttl=54 time=41.9 ms
64 bytes from bom04s01-in-f14.1e100.net (173.194.36.14): icmp_seq=3 ttl=54 time=41.3 ms
--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 41.390/42.155/43.105/0.712 ms

If all went well, your server is back to the state it was when it was delivered by xotHost.com.


Back to Main Page
Go to xotHost.com

Personal tools
Namespaces

Variants
Actions
Navigation
Tools