LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices



Reply
 
Search this Thread
Old 11-06-2009, 03:59 PM   #1
kexpert
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Rep: Reputation: 0
Unhappy CentOS 3.5 Enterprise Server -- I need to change my Local Static IP address.


I need to change my Local Satic IP address.
My DNS servers:
nameserver 208.67.222.222
nameserver 208.67.220.220

My Dynamic settings:
#INTERNET CONNECTION WORKS
# nVidia Corporation MCP55 Ethernet
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:F1:3E:881:C1
IPV6INIT=yes
IPV6_AUTOCONF=yes
ONBOOT=yes

I have used the ifconfig command to change the IP temporarily and it works great just not Statically.

I have also already googled and tried the fallowing different solutions with no luck:
http://www.wallpaperama.com/forums/h...hat-t1692.html
#DOES NOT WORK NO INTERNET CONNECTION
# File: ifcfg-eth0
#
DEVICE=eth0
IPADDR=192.168.0.100
NETMASK=255.255.255.0
BOOTPROTO=static
ONBOOT=yes

http://www.thewebmasterscafe.net/web...tos-linux.html
#DOES NOT WORK NO INTERNET CONNECTION
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:0C:29E:94:8B
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
NETMASK=255.255.255.0
IPADDR=192.168.0.100
GATEWAY=192.168.0.1


Can somebody please help me.


Thank You
 
Old 11-06-2009, 05:49 PM   #2
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
Leave BOOTPROTO=dhcp and add your IPADDR=. Most routers will allow this. You may want to rethink using the .100 address. Most routers start at the bottom of their range and assign addresses working their way up. This can lead to conflicts if your machine is not the first machine to get attached. You are usually better off (on your static address) starting from the top of your allowed range(router setting) and working your way down. This way you always get the same static address(no conflicts) and you have a pretty good idea the IP address a guest machine will draw(assuming all "normal" machines are static the guest machine will be .100).
 
Old 11-06-2009, 06:45 PM   #3
DrLove73
Senior Member
 
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Blog Entries: 1

Rep: Reputation: 129Reputation: 129
Hi kexpert, welcome to LQ forums.

Setting up Local and Public IP's is the same, there are no differences.

Aa for setting up static IP on the network with DHCP, policy is to totally avoid IP range set on the DHCP server. If DHCP range is 192.168.0.2-192.168.0.199 and 192.168.0.1 is the gateway, then IP range for static assignement is 192.168.0.200-192.168.0.254.

The last configuration looks quite good, so I thing you have problems with routing.

First give us the output of commands "ip address" and "ip route" when you are on Dynamic address, and then when you try your static setting. You have to do it logged as root.

Next thing to know is to run command "service network restart" after each change of the ifcfg-eth0 file.

To test your connection, do following things:

1. Ping you gateway to see if you can. If you do not, then gateway has different IP or IP settings for eth0 are not good. If you can, then next thing to test is routing.

2. Ping public IP address for witch you know the IP. Do not ping the name, but it's IP. Pinging DNS address is easiest. If it does not work, then you have routing issues (gateway IP is wrong or router it self thinks your IP is in some other way, on some other interface.

3. Try pinging hostname of some public server, like www.google.com, www.yahoo.com, etc. If step 2 works, but this one does not, then your DNS setting is not right.

Best way to set network connection on CentOS/RHEL/Fedora is using "system-config-network" command/script. If you are in GUI, a familiar dialog will popup, and if you are in terminal/SSH mode, a simple but functional command prompt dialog screen will appear allowing system utility to do it all for you.
 
Old 11-06-2009, 09:57 PM   #4
kexpert
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Original Poster
Rep: Reputation: 0
When I am connected to dhcp here is the output:
eth0 Link encap:Ethernet HWaddr 00:F1:3E:881:C1
inet addr:192.168.0.3 Bcast:192.168.0.255 Mask:255.255.255.0

When I tried to use "system-config-network" here is the ifcfg-eth0 output:
# nVidia Corporation MCP55 Ethernet
DEVICE=eth0
IPADDR=192.168.0.245
BOOTPROTO=none
HWADDR=00:F1:3E:881:C1
IPV6INIT=yes
IPV6_AUTOCONF=yes
ONBOOT=yes
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
TYPE=Ethernet
 
Old 11-06-2009, 11:56 PM   #5
kexpert
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by lazlow View Post
Leave BOOTPROTO=dhcp and add your IPADDR=. Most routers will allow this. You may want to rethink using the .100 address. Most routers start at the bottom of their range and assign addresses working their way up. This can lead to conflicts if your machine is not the first machine to get attached. You are usually better off (on your static address) starting from the top of your allowed range(router setting) and working your way down. This way you always get the same static address(no conflicts) and you have a pretty good idea the IP address a guest machine will draw(assuming all "normal" machines are static the guest machine will be .100).
I tried the IPADDR= except when I add it the dynamic address 192.168.0.3 is used.
 
Old 11-07-2009, 12:08 AM   #6
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,362

Rep: Reputation: 172Reputation: 172
You did actually fill in the address, right?

edit: Here is mine:

Quote:
# nVidia Corporation CK804 Ethernet Controller
DEVICE=eth0
BOOTPROTO=DHCP
NETMASK=255.255.255.0
IPADDR=10.168.1.149
GATEWAY=192.168.0.1
TYPE=ethernet
USERCTL=no
IPV6INIT=yes
PEERDNS=no
ONBOOT=yes
DNS1=24.217.0.55
DNS2=4.2.2.1
DNS3=199.2.252.10

Last edited by lazlow; 11-07-2009 at 12:14 AM.
 
Old 11-07-2009, 05:36 AM   #7
kexpert
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Question ifcfg-eth0

Quote:
Originally Posted by lazlow View Post
You did actually fill in the address, right?

edit: Here is mine:
Yes, I am sure I filled in ifcfg-eth0 right I am able to ping the router but not yahoo.com. I had to revert back to the my default dynamic IP settings to connect to the internet.
Attached Files
File Type: txt Edit_ifcfg-eth0.txt (239 Bytes, 3 views)
 
Old 11-07-2009, 05:39 AM   #8
kexpert
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Question ifcfg-eth0

# nVidia Corporation MCP55 Ethernet
DEVICE=eth0
BOOTPROTO=DHCP
NETMASK=255.255.255.0
IPADDR=192.168.0.245
GATEWAY=192.168.0.1
TYPE=ethernet
USERCTL=no
IPV6INIT=yes
PEERDNS=no
ONBOOT=yes
DNS1=208.67.220.220
DNS2=208.67.222.222
DNS3=4.2.2.2
 
Old 11-07-2009, 05:57 AM   #9
DrLove73
Senior Member
 
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Blog Entries: 1

Rep: Reputation: 129Reputation: 129
If you used "system-config-network" in terminal (not in GNOME), there was checkbox, something about DHCP. For static IP, you need that checkbox clear. If you used GUI, you were to select and add static IP.

I wrote you exact procedure to follow and what you need to post here so we can help you. If you chose to ignore it, that is fine with me, I will not be trying to help you any more. Just for the record, Last 5 years I run small WISP, and administer one little bigger, so I have experience to quickly help you if you are willing to do as I tell you.
 
Old 11-07-2009, 06:09 PM   #10
kexpert
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Unhappy

Quote:
Originally Posted by DrLove73 View Post
If you used "system-config-network" in terminal (not in GNOME), there was checkbox, something about DHCP. For static IP, you need that checkbox clear. If you used GUI, you were to select and add static IP.

I wrote you exact procedure to follow and what you need to post here so we can help you. If you chose to ignore it, that is fine with me, I will not be trying to help you any more. Just for the record, Last 5 years I run small WISP, and administer one little bigger, so I have experience to quickly help you if you are willing to do as I tell you.
I read your instructions and used "system-config-network" I still was unable to connect to the internet. I was able to login to my router but not the internet. I am going to try a clean install and select static instead of dynamic. I printed out your message and read it several times entered the info and I was unable to connect to the internet.
 
Old 11-07-2009, 07:21 PM   #11
DrLove73
Senior Member
 
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Blog Entries: 1

Rep: Reputation: 129Reputation: 129
there is no need to reinstall.

I told you what test to do. Have you done them?

With what results?

Were you able to ping 208.67.222.222?
 
Old 11-07-2009, 08:58 PM   #12
kexpert
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by DrLove73 View Post
there is no need to reinstall.

I told you what test to do. Have you done them?

With what results?

Were you able to ping 208.67.222.222?
[root@localhost ~]# ping 208.67.222.222
PING 208.67.222.222 (208.67.222.222) 56(84) bytes of data.
64 bytes from 208.67.222.222: icmp_seq=1 ttl=54 time=32.7 ms
64 bytes from 208.67.222.222: icmp_seq=2 ttl=54 time=32.3 ms
64 bytes from 208.67.222.222: icmp_seq=3 ttl=54 time=32.9 ms
64 bytes from 208.67.222.222: icmp_seq=4 ttl=54 time=31.7 ms
64 bytes from 208.67.222.222: icmp_seq=5 ttl=54 time=32.2 ms

[root@localhost ~]# ping yahoo.com
PING yahoo.com (209.191.93.53) 56(84) bytes of data.
64 bytes from b1.www.vip.mud.yahoo.com (209.191.93.53): icmp_seq=1 ttl=52 time=82.6 ms
64 bytes from b1.www.vip.mud.yahoo.com (209.191.93.53): icmp_seq=2 ttl=52 time=82.7 ms
64 bytes from b1.www.vip.mud.yahoo.com (209.191.93.53): icmp_seq=3 ttl=53 time=82.6 ms
64 bytes from b1.www.vip.mud.yahoo.com (209.191.93.53): icmp_seq=4 ttl=52 time=105 ms
64 bytes from b1.www.vip.mud.yahoo.com (209.191.93.53): icmp_seq=5 ttl=52 time=83.8 ms

I noticed the command-line 'system-config-network' that it has an error:
DSN1 <---
DNS2
Tertiary DNS

As you can see about 'DSN' is wrong and should be 'DNS1'.

Anyway thanks for directing me to command-line 'system-config-network' I was finally able to get my network working
 
Old 11-08-2009, 06:33 AM   #13
DrLove73
Senior Member
 
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Blog Entries: 1

Rep: Reputation: 129Reputation: 129
Excelent. GUI dialog can be confusing, and easy to forget about DNS.

As for typo, 99,9% it's just on the label. I am on CentOS 5.4, there's no typo here.

Please mark this post SOLVED. See my signature for how to do it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
setup Static IP address for centOS and access to ssh careykwong Linux - Networking 14 09-23-2009 11:02 PM
permanent static routes on CentOS/Red Hat Enterprise Linux whistl Linux - Networking 4 03-24-2009 01:30 PM
configure server use a static IP address limit_me Linux - Server 3 11-09-2008 12:42 AM
static ip address on local network sloooow... richardg Linux - Networking 6 02-19-2007 01:45 AM
Static IP Address with DHCP server control taylortbb Linux - Networking 1 06-28-2005 02:43 PM


All times are GMT -5. The time now is 12:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration