Linux change ip address
Q. How do I change ip address in Linux?
A. There are different ways to change IP address in Linux
(a) Command Line tools
(b) Modify configuration files
(c) Use GUI tools
Task: Display current IP address and setting for network interface called eth0
Use ifconfig command:
# ifconfig eth0
Output:
eth0 Link encap:Ethernet HWaddr 00:30:48:5A:BF:46
inet addr:10.5.123.2 Bcast:10.5.123.63 Mask:255.255.255.192
inet6 addr: fe80::230:48ff:fe5a:bf46/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:728204 errors:0 dropped:0 overruns:0 frame:0
TX packets:1097451 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:62774749 (59.8 MiB) TX bytes:1584343634 (1.4 GiB)
Interrupt:177
Task: Change IP address
You can change ip address using ifconfig command itself. To set IP address 192.168.1.5, enter command:
# ifconfig eth0 192.168.1.5 netmask 255.255.255.0 up
# ifconfig eth0
To make permanent changes to IP address you need to edit configuration file according to your Linux distribution.
Change IP address under RedHat / CentOS / Fedora core Linux
=> Please read - Howto change and setup IP address in Redhat Linux
Change IP address under Debian / Ubuntu Linux
=> Please read - Howto change and setup IP address in Ubuntu / Debian based Linux distros
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- Ubuntu Linux Configure DNS Name Server IP Address ( DNS Client )
- OpenBSD Set / Change Default Gateway
- Linux vmware VPS server routing problem
- PHP Howto Read IP address of remote computer/browser
- Openbsd change, add or display default gateway
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: change_ip_address, command_line_tools, configuration_files, gui_tools, ifconfig_command, Linux, network_interface



May 1st, 2008 at 5:15 pm
Great. Very helpful.