Red Hat This forum is for the discussion of Red Hat Linux. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
11-06-2009, 03:59 PM
|
#1
|
LQ Newbie
Registered: Nov 2009
Posts: 12
Rep:
|
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:88 1: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:29 E: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
|
|
|
11-06-2009, 05:49 PM
|
#2
|
Senior Member
Registered: Jan 2006
Posts: 4,363
Rep:
|
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).
|
|
|
11-06-2009, 06:45 PM
|
#3
|
Senior Member
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Rep:
|
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.
|
|
|
11-06-2009, 09:57 PM
|
#4
|
LQ Newbie
Registered: Nov 2009
Posts: 12
Original Poster
Rep:
|
When I am connected to dhcp here is the output:
eth0 Link encap:Ethernet HWaddr 00:F1:3E:88 1: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:88 1:C1
IPV6INIT=yes
IPV6_AUTOCONF=yes
ONBOOT=yes
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
TYPE=Ethernet
|
|
|
11-06-2009, 11:56 PM
|
#5
|
LQ Newbie
Registered: Nov 2009
Posts: 12
Original Poster
Rep:
|
Quote:
Originally Posted by lazlow
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.
|
|
|
11-07-2009, 12:08 AM
|
#6
|
Senior Member
Registered: Jan 2006
Posts: 4,363
Rep:
|
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.
|
|
|
11-07-2009, 05:36 AM
|
#7
|
LQ Newbie
Registered: Nov 2009
Posts: 12
Original Poster
Rep:
|
ifcfg-eth0
Quote:
Originally Posted by lazlow
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.
|
|
|
11-07-2009, 05:39 AM
|
#8
|
LQ Newbie
Registered: Nov 2009
Posts: 12
Original Poster
Rep:
|
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
|
|
|
11-07-2009, 05:57 AM
|
#9
|
Senior Member
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Rep:
|
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.
|
|
|
11-07-2009, 06:09 PM
|
#10
|
LQ Newbie
Registered: Nov 2009
Posts: 12
Original Poster
Rep:
|
Quote:
Originally Posted by DrLove73
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.
|
|
|
11-07-2009, 07:21 PM
|
#11
|
Senior Member
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Rep:
|
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?
|
|
|
11-07-2009, 08:58 PM
|
#12
|
LQ Newbie
Registered: Nov 2009
Posts: 12
Original Poster
Rep:
|
Quote:
Originally Posted by DrLove73
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
|
|
|
11-08-2009, 06:33 AM
|
#13
|
Senior Member
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 10:10 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|