Configure static IP address on Ubuntu 13.04 12.10 12.04 Debian

Howto configure static IP address on Ubuntu 13.04 12.10 12.04 Debian

eth0

 

 

1. Present we are using DHCP to receive IP automatically

root@ubuntu:~# cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopbackauto eth0
iface eth0 inet dhcp
root@ubuntu:~#

2. Configure static IP Address on Ubuntu/Debian

root@ubuntu:~# nano /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopbackauto eth0
iface eth0 inet static
address 192.168.129.163
netmask 255.255.255.0
network 192.168.129.0
broadcast 192.168.129.255
gateway 192.169.129.2
root@ubuntu:~#

3. Configure DNS Server for Ubuntu/Debian

http://ithelpblog.com/os/linux/bashandscripts/configure-dns-client-nameserver-on-linux-centos-redhat-rhel-ubuntu/

4. Restart network and check Static IP Address on Ubuntu/Debian

root@ubuntu:~# /etc/init.d/networking restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service networking restartSince the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop networking ; start networking. The restart(8) utility is also available.
networking stop/waiting
networking start/running
root@ubuntu:~#
root@ubuntu:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
link/ether 00:0c:29:17:b1:f4 brd ff:ff:ff:ff:ff:ff
inet 192.168.129.163/24 brd 192.168.129.255 scope global eth0
inet6 fe80::20c:29ff:fe17:b1f4/64 scope link
valid_lft forever preferred_lft forever
root@ubuntu:~#

That’s all. Thanks for using IThelpblog.com.

 

 

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>