This article helps to setup network on ubuntu server 12.04 without GUI.
You can also use the same article to setup network on ubuntu desktop 12.04 too.
1. Identifying the interface name
2. Assigning temporary IP
3. DHCP
4. Static
5. Two network cards
By default interface names starts with eth. Issue the below command to identify the interface name.krizna@leela:~$ ifconfig | grep eth
Here eth0 is the interface name .
eth0 Link encap:Ethernet HWaddr 00:0c:29:cf:a2:c9
you can assign temporary ip address, it will last until you restart network service or server.
Step 1 » Assign temporary IP address by typing the below command.krizna@leela:~$ sudo ifconfig eth0 172.27.0.10 netmask 255.255.255.192 up
Step 2 » Assign temporary default gateway.krizna@leela:~$ sudo route add default gw 172.27.0.1 eth0
Step 3 » If you need, you can add DNS server IPs to this file /etc/resolv.conf.nameserver 8.8.8.8
nameserver 4.2.2.1
Step 1 » Add the below lines to /etc/network/interfaces.auto eth0
Step 2 » Restart network service
iface eth0 inet dhcpkrizna@leela:~$ sudo /etc/init.d/networking restart
Step 1 » Add the below lines to /etc/network/interfacesauto eth0
8.8.8.8 and 4.2.2.2 are the DNS server IPs.
iface eth0 inet static
address 172.27.0.10
netmask 255.255.255.192
gateway 172.27.0.1
broadcast 172.27.0.63
dns-search krizna.com
dns-nameservers 8.8.8.8 4.2.2.2
Step 2 » Restart network servicekrizna@leela:~$ sudo /etc/init.d/networking restart
Assigning IPs to two network interfaces.
Step 1 » Identify the interface names .krizna@leela:~$ ifconfig | grep eth
Here eth0 and eth1 are the interfaces .
eth0 Link encap:Ethernet HWaddr 00:0c:29:cf:a2:c9
eth1 Link encap:Ethernet HWaddr 00:0c:29:cf:s5:d9
Step 2 » Add the below lines to /etc/network/interfaces. #interface eth0
You cannot assign two default gateways .
auto eth0
iface eth0 inet static
address 172.27.0.10
netmask 255.255.255.192
gateway 172.27.0.1
broadcast 172.27.0.63
dns-search krizna.com
dns-nameservers 8.8.8.8 4.2.2.2
#interface eth1
auto eth1
iface eth1 inet static
address 172.27.1.20
netmask 255.255.255.192
Step 2 » Restart network servicekrizna@leela:~$ sudo /etc/init.d/networking restart
External Resources:
Ubuntu network configuration
Interfaces man page
Visual Studio Code is a popular code editor which is lightweight and cross platform application.…
MySQL workbench is a GUI tool for managing MySQL database system. It is used by…
Android Studio is a popular development software used especially for developing android applications. It is…
Google chrome is a most popular web browser developed by google. It was developed to…
Zoom is a popular video conferencing software. It is commonly used for conducting online meetings,…
TeamViewer is a popular application for desktop sharing and remote control. It is available for…