How To Change Ip Address Static Dynamic Linux Fedora Core Red Hat
Posted On Mon Jul 09, 2007 By hostman In Linux Forums And Topics Discussions For Wallpaper Websites Running On Linux Servers Forums
today, i just installed a new OS on a computer. i installed fedora 7 and now because i had to take a trip, i can only ssh into my server and i have to change my ip adress, Originally when i installed the os, i set it to DHCP, but now i want to change it to a static ip. so if you are in the same situation as i am, maybe you can learn from this on how you can change your ip address remotely..
these are the steps i took to make it happen
1. login as root
2. get your current IP address with this command:
The OUTPUT will look someting like this:
OR you can also get the ip from the network configuration file wit this command:
COMMAND to show configuration:
THe OUTPUT will look like this (i have it set to DHCP)
OUTPUT for static IP (example)
3. Ok, on step 3 we are going to change from DHCP to static ip. so send this command to edit the /etc/sysconfig/network-scripts/ifcfg-eth0 file: (im using nano, but you can use vi if you want)
Change from this:
TO this:
4. now save your changes and reboot your server.
these are the steps i took to make it happen
1. login as root
2. get your current IP address with this command:
ifconfig
The OUTPUT will look someting like this:
[root@host ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:D0:BC:08:09:BC
inet addr:70.238.17.69 Bcast:255.255.255.255 Mask:255.255.255.248
inet6 addr: fe80::2d0:b7ff:fe08:9bb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7174 errors:0 dropped:0 overruns:0 frame:0
TX packets:2305 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5339910 (5.0 MiB) TX bytes:170109 (166.1 KiB)
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:16436 Metric:1
RX packets:34 errors:0 dropped:0 overruns:0 frame:0
TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4275 (4.1 KiB) TX bytes:4275 (4.1 KiB)
eth0 Link encap:Ethernet HWaddr 00:D0:BC:08:09:BC
inet addr:70.238.17.69 Bcast:255.255.255.255 Mask:255.255.255.248
inet6 addr: fe80::2d0:b7ff:fe08:9bb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7174 errors:0 dropped:0 overruns:0 frame:0
TX packets:2305 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5339910 (5.0 MiB) TX bytes:170109 (166.1 KiB)
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:16436 Metric:1
RX packets:34 errors:0 dropped:0 overruns:0 frame:0
TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4275 (4.1 KiB) TX bytes:4275 (4.1 KiB)
OR you can also get the ip from the network configuration file wit this command:
COMMAND to show configuration:
cat /etc/sysconfig/network-scripts/ifcfg-eth0
THe OUTPUT will look like this (i have it set to DHCP)
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:D0:B7:08:09:BB
ONBOOT=yes
BOOTPROTO=dhcp
HWADDR=00:D0:B7:08:09:BB
ONBOOT=yes
OUTPUT for static IP (example)
#
# File: ifcfg-eth0
#
DEVICE=eth0
IPADDR=192.168.1.100
NETMASK=255.255.255.0
BOOTPROTO=static
ONBOOT=yes
#
# The following settings are optional
#
BROADCAST=192.168.1.255
NETWORK=192.168.1.0
# File: ifcfg-eth0
#
DEVICE=eth0
IPADDR=192.168.1.100
NETMASK=255.255.255.0
BOOTPROTO=static
ONBOOT=yes
#
# The following settings are optional
#
BROADCAST=192.168.1.255
NETWORK=192.168.1.0
3. Ok, on step 3 we are going to change from DHCP to static ip. so send this command to edit the /etc/sysconfig/network-scripts/ifcfg-eth0 file: (im using nano, but you can use vi if you want)
nano /etc/sysconfig/network-scripts/ifcfg-eth0
Change from this:
# Intel Corporation 82557/8/9 [Ethernet Pro 100]
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:D0:B7:08:09:BB
ONBOOT=yes
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:D0:B7:08:09:BB
ONBOOT=yes
TO this:
# File: ifcfg-eth0
#
DEVICE=eth0
IPADDR=192.168.1.100
NETMASK=255.255.255.248
BOOTPROTO=static
ONBOOT=yes
#
DEVICE=eth0
IPADDR=192.168.1.100
NETMASK=255.255.255.248
BOOTPROTO=static
ONBOOT=yes
4. now save your changes and reboot your server.
Ben Thu Nov 17, 2011
Reboot?
That looks like Windows user!!
You only need restart the network service
/etc/init.d/netwo restart
That looks like Windows user!!
You only need restart the network service
/etc/init.d/netwo restart
Vinodh Tue Mar 01, 2011
I can't change to manual IP address even followed your instruction. After restart system, following settings are configured automatically. Any idea....?
eth0 Link encap:Ethernet HWaddr 00:11:D8:4C:FE:F6
inet addr:169.254.22.18 Bcast:169.254.255.255 Mask:255.255.0.0
inet6 addr: fe80::211:d8ff:fe4c:fef6/ Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1196 errors:0 dropped:0 overruns:0 frame:0
TX packets:107 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:117164 (114.4 KiB) TX bytes:16839 (16.4 KiB)
Interrupt:20 Base address:0xc000
eth0 Link encap:Ethernet HWaddr 00:11:D8:4C:FE:F6
inet addr:169.254.22.18 Bcast:169.254.255.255 Mask:255.255.0.0
inet6 addr: fe80::211:d8ff:fe4c:fef6/ Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1196 errors:0 dropped:0 overruns:0 frame:0
TX packets:107 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:117164 (114.4 KiB) TX bytes:16839 (16.4 KiB)
Interrupt:20 Base address:0xc000
Lewis Sun Apr 18, 2010
Im trying to setup my network settings for 2 class rooms. maybe you could help me out.
T114 and T115 lab classes have identical hardware configuration but different network addresses. Write a script that sets up/changes your network settings based on the lab class you are in. It can be a menu-driven utility or a fully automated script called by rc.local.
T114 and T115 lab classes have identical hardware configuration but different network addresses. Write a script that sets up/changes your network settings based on the lab class you are in. It can be a menu-driven utility or a fully automated script called by rc.local.
Nethaji Fri Apr 16, 2010
Hi, Thanks for sharing your thoughts. I am new to LINUX, i got some info from you friends.
Khattak Mon Feb 22, 2010
Thanks alot!
i wanted to ask you that if i want to manipulate/change the IP in a Packet then how can i do it with C in fedora11. can you guide me. i am making a code for it.
waiting for your reply.....
i wanted to ask you that if i want to manipulate/change the IP in a Packet then how can i do it with C in fedora11. can you guide me. i am making a code for it.
waiting for your reply.....
Danniel Mon Jul 06, 2009
thank you so much for the sharing!
Chetan Thu Apr 30, 2009
i think the only thing which is missing from modifying the /etc/ifcfg-eth0 file above is mentioning the gateway.
put this line along with what already in there and restart the networking servinces and you should be good to go:
# gateway is your routers ip address generally.
gateway=192.168.0.1
put this line along with what already in there and restart the networking servinces and you should be good to go:
# gateway is your routers ip address generally.
gateway=192.168.0.1
Rajesh Wed Jul 30, 2008
thanq frnd.. this helped me a lot..
Howard Mon Jul 21, 2008
instead of rebooting you can just run:
/etc/init.d/network restart
/etc/init.d/network restart
Nate Tue Apr 08, 2008
i tried both methods listed here, but when i restart my computer, or restart the network service, i get my old dhcp-assigned ip address.
initially, my /etc/sysconfig/network-scripts/ifcf file did not have the bootproto directive. i added that, and set it to static. my entire /etc/sysconfig/network-scripts/ifcf file now looks like this:
peerdns=yes
hwaddr=
initially, my /etc/sysconfig/network-scripts/ifcf file did not have the bootproto directive. i added that, and set it to static. my entire /etc/sysconfig/network-scripts/ifcf file now looks like this:
peerdns=yes
hwaddr=
interface Tue Jan 22, 2008
yeah, its better to just restart the network instead of rebooting the machine. thanks for your tutorial. helped me alot
spen Thu Sep 20, 2007
this is very helpful!
i would like to comment that you can restart the network service instead of rebooting..
on fedora.. /etc/init.d/network restart
:)
i would like to comment that you can restart the network service instead of rebooting..
on fedora.. /etc/init.d/network restart
:)
hostman Mon Jul 09, 2007
thanks, that was much easier.
Related Content
Information
Forums »
Linux Forums And Topics Discussions For Wallpaper Websites Running On Linux Servers »
How To Change Ip Address Static Dynamic Linux Fedora Core Red Hat
Linux Forums And Topics Discussions For Wallpaper Websites Running On Linux Servers »
How To Change Ip Address Static Dynamic Linux Fedora Core Red Hat
Title: How To Change Ip Address Static Dynamic Linux Fedora Core Red Hat
Description: How To Change Ip Address Static Dynamic Linux Fedora Core Red Hat
Tags: how ,to ,change ,ip ,address ,static ,dynamic ,linux ,fedora ,core ,red ,hat
Info: This Post Has Been Viewed 0 Times Since
Date: Mon Jul 09, 2007
Author hostman Received 20 Replies #2964
Date: Mon Jul 09, 2007
Author hostman Received 20 Replies #2964
Share
URL: 

Embed: 

To embed this topic, just copy the code from the "Embed" box. Once you've copied the code, just paste it into your website or blog to embed it
BBCODE:: 

BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums
wallpaperama | Wallpapers | Forums | Terms Of Service
copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5
copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5


