Ubuntu and Debian

Ubuntu Server Networking configuration. DHCP address, Static IP address, Second IP address or Virtual IP address

Configuring DHCP address for your network card

If you want to configure DHCP address you need to edit the /etc/network/interfaces and you need to enter the following lines replace eth0 with your network interface card

sudo nano /etc/network/interfaces

 

auto lo
iface lo inet loopback

# The primary network interface -- use DHCP to find our address
auto eth0
iface eth0 inet dhcp

Configuring Static IP address for your network card

If you want to configure Static IP address you need to edit the /etc/network/interfaces and you need to enter the following lines replace eth0 with your network interface card

sudo nano /etc/network/interfaces
 auto loiface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.3.90
gateway 192.168.3.1
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255
dns-nameservers 192.168.3.254

After entering all the details you need to restart networking services using the following command

sudo /etc/init.d/networking restart

 

Setting up Second IP address or Virtual IP address in Ubuntu

If you need to assign a second ipaddress to your Ubuntu machine.

sudo nano /etc/network/interfaces

# Virtual IP address

auto eth0:1
iface eth0:1 inet static
address 192.168.1.60
netmask 255.255.255.0
network x.x.x.x
broadcast x.x.x.x
gateway x.x.x.x
dns-nameservers 192.168.3.254

You need to enter all the details like address,netmask,network,broadcast and gateways values after entering all the values save this file and you need to restart networking services in debian using the following command to take effect of our new ipaddress.

After entering all the details you need to restart networking services using the following command

sudo /etc/init.d/networking restart

 

Setting your ubuntu stytem hostname

Setting up your hostname upon a ubuntu installation is very straightforward. You can directly query, or set, the hostname with the hostname command.

As an user you can see your current hostname with

sudo /bin/hostname

Example

To set the hostname directly you can become root and run

sudo /bin/hostname newname

When your system boots it will automatically read the hostname from the file /etc/hostname

 

Setting up DNS

When it comes to DNS setup Ubuntu doesn't differ from other distributions.

You can add hostname and IP addresses to the file /etc/hosts for static lookups.

To cause your machine to consult with a particular server for name lookups you simply add their addresses to /etc/resolv.conf.

For example a machine which should perform lookups from the DNS server at IP address 192.168.10.2 would have a resolv.conf file looking like this

sudo nano /etc/resolv.conf

enter the following details

search test.com
nameserver 192.168.10.2

Share this post

Submit to Google BookmarksSubmit to TwitterSubmit to LinkedIn

playbet

playbet.com

H Playbet προσφέρει νόμιμα τις υπηρεσίες της στους παίκτες που κατοικούν στην Ελληνική επικράτεια, έχοντας πραγματοποιήσει έναρξη εργασιών για υπηρεσίες παροχής τυχερών παιγνίων μέσω διαδικτύου, αποκτώντας Ελληνικό ΑΦΜ, και έχοντας ενταχθεί οικειοθελώς στη μεταβατική διάταξη της παραγράφου 12 του άρθρου 50 του ν.4002/2011 (Α180).

Αθηναϊκό Κέντρο Επικοινωνιών Πληροφόρησης ΑΚΕΠ ΑΕ. Πληροφορίες για Διαγωνισμούς Προμηθειών Δημοσίου Δήμων και Κοινοτήτων. Εδώ θα βρείτε έγκυρη, έγκαιρη και αξιόπιστη Ενημέρωση σχετικά με τους διαγωνισμούς του Δημοσίου που αφορούν Προμήθειες, Τεχνικά έργα, Μελέτες, Εκποιήσεις και Εργολαβίες, σε ένα γρήγορο και φιλικό προς το χρήστη περιβάλλον.
Τηλεφωνική γραμμή πληροφόρησης των Πολιτών, σχετικά με τις διαδικασίες και τα πιστοποιητικά της Δημόσιας Διοίκησης.
logo14500Apps
logo14900Small
  • Ζωντανά 24 ώρες το 24ωρο
  • Προγραμματίστε το ραντεβού με Ιατρό στις μονάδες υγείας του ΕΟΠΥΥ
  • Ακυρώστε το ραντεβού σας
  • Ενημερωθείτε αναφορικά με συμβεβλημένους ιατρούς, διαγνωστικά κέντρα, λίστες φαρμάκων και φαρμακείων του ΕΟΠΥΥ
logo14884Small
  • Ζωντανά 24 ώρες το 24ωρο
  • Προγραμματίστε το ραντεβού με Ιατρό στις μονάδες υγείας του ΕΟΠΥΥ
  • Ακυρώστε το ραντεβού σας
  • Ενημερωθείτε αναφορικά με συμβεβλημένους ιατρούς, διαγνωστικά κέντρα, λίστες φαρμάκων και φαρμακείων του ΕΟΠΥΥ