Results 1 to 4 of 4
hi all. i have been having lots of trouble getting a static ip working on my system... from what I undderstand from the research ive done, the secret is in ...
- 01-06-2011 #1Just Joined!
- Join Date
- Jul 2005
- Location
- Colorado
- Posts
- 84
help with static ip
hi all. i have been having lots of trouble getting a static ip working on my system... from what I undderstand from the research ive done, the secret is in my ifcfg-eth0 file. SO here it is.
this file works just fine to get a dhcp address. however, i switch bootproto to "static" and uncomment the last 3 lines, and suddenly I can't access any websites. I can ping the router and other computers on the network, but cant view any sites. I just need a static ip to work on this computerCode:# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller DEVICE=eth0 HWADDR=A4:BA:DB:FB:44:51 TYPE=Ethernet DEFROUTE=yes IPV4_FAILURE_FATAL=yes IPV6INIT=no NAME="System eth0" UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03 ONBOOT=yes PEERDNS=yes PEERROUTES=yes # below this line are static ip settings BOOTPROTO=dhcp #IPADDR=192.168.0.22 #NETMASK=255.255.255.0 #GATEWAY=192.168.0.1
by the way, all the settings on here were default from installation, including bootproto even though i moved it down below that comment line, and I commented the 3 lines i added.
- 01-06-2011 #2
OK you must be doing something right if you can ping
the router and other local computers. Maybe since you
change it from DHCP to static it is no longer getting
a name server automatically.
Your name server is configured in /etc/resolv.conf
Edit the file manually with a name server provided by your
ISP. Check the configuration of your router for this, or try
the router's address, since most routers run a name server.
- 01-09-2011 #3Just Joined!
- Join Date
- Jan 2011
- Location
- london
- Posts
- 8
Hi,
Do you have the setup command on your system?
if so open it and configure your static IP, save and then restart the network
then compare the new ifcfg-eth0 file to the previous one and you should see the problem
Thanks
- 01-09-2011 #4
Not sure you need everything that is in that confg file. Looks like it was generated with NetworkManager. I would make sure it isn't running when you switch to static addresses. You can check it as follows:
If it is running then you can stop it with:Code:service NetworkManager status
And you can permanently turn it off with:Code:service NetworkManager stop
some will say you can use NetworkManager to control the interface but what more are you really going to want to do then up and down the interface?Code:chkconfig --level 2345 NetworkManager off
Here is a cleaned up version of your file
I suggest always making a copy of any file(s) you are going to edit before you edit them. I would suggest you backup the eth0 config file to your home directory before you make any changes to it so that is something goes south you can just copy it back and your system should return the state it was in before you made any changes to the interface. Before restarting the interface make a backup of your /etc/resolv.conf file just in case it changes so you have a copy of the DNS server that you use. resolv.conf gets updated automatically every time dhcp is used.Code:DEVICE=eth0 BOOTPROTO=static BROADCAST=192.168.0.255 HWADDR=A4:BA:DB:FB:44:51 IPADDR=192.168.0.22 NETMASK=255.255.255.0 NETWORK=192.168.0.0 ONBOOT=yes


Reply With Quote