How to assign Static/Manul IP Address in Ubuntu/Linux Mint

IP Address Details

IP Address: 10.10.1.7
Subnet Mask: 255.255.192.0
Gateway IP: 10.10.1.1
DNS: 8.8.8.8
Interface Name: eth0

Edit file to configure Ip address and save.
shahzad@ThinkCentre-E73 ~ $ sudo vim.tiny /etc/network/interfaces

Current status
auto eth0
iface eth0 inet dhcp
Chnage with below syntax
auto eth0
iface eth0 inet static
address 10.10.1.7
netmask 255.255.192.0
gateway 10.10.1.1
dns-nameserver 8.8.8.8

Restart Network service

shahzad@ThinkCentre-E73 ~ $sudo /etc/init.d/networking restart

Commnd to show IP Address

shahzad@ThinkCentre-E73 ~ $ ifconfig
eth0 Link encap:Ethernet HWaddr d8:cb:8a:65:03:40
inet addr:10.10.1.7 Bcast:10.10.63.255 Mask:255.255.192.0
inet6 addr: fe80::dacb:8aff:fe65:340/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:871485 errors:0 dropped:4 overruns:0 frame:0
TX packets:83840 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:219685693 (219.6 MB) TX bytes:16334462 (16.3 MB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:4152 errors:0 dropped:0 overruns:0 frame:0
TX packets:4152 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:565570 (565.5 KB) TX bytes:565570 (565.5 KB)

Test Networking
shahzad@ThinkCentre-E73 ~ $ ping google.com
PING google.com (173.194.36.70) 56(84) bytes of data.
64 bytes from del01s06-in-f6.1e100.net (173.194.36.70): icmp_seq=1 ttl=57 time=39.7 ms
64 bytes from del01s06-in-f6.1e100.net (173.194.36.70): icmp_seq=2 ttl=57 time=37.4 ms


Share on Google Plus

About Penguin Technology

I am a passionate cloud and DevOps professional specializing in Linux and open-source solutions. Through this blog, I share my knowledge and experience with the community, offering tips and insights on cloud technologies and DevOps practices.
    Blogger Comment

0 comments:

Post a Comment