[RESOLVED] Setting Static IP

Issues related to configuring your network
Post Reply
TargetOfGravity
Posts: 9
Joined: 2014/07/07 16:50:49

[RESOLVED] Setting Static IP

Post by TargetOfGravity » 2015/04/02 21:50:15

Working on setting a static IP on a new device. I've set the following:

Code: Select all

cat /etc/resolve.conf
namserver ##.#.#.###
nameserver ##.#.#.###
Where # obviously is the associated IP addresses
Then within the within my /etc/sysconfig/network-scripts/ifcfg-eth0 I have the following:

Code: Select all

cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="etho0"
BOOTPROTO="static"
IPADDR=##.#.#.###
NETMASK=255.255.255.0
NM_CONTROLLED=no
HWADDR="0C:C4:7A:31:38:8C
GATEWAY=##.#.#.##
ONBOOT="yes"
TYPE="Ethernet"
Once set I did

Code: Select all

service network restart
and seemed to take. I did an ifconfig -a and it shows as set. I guess being newer and have not setting this before I'm curious what I'm doing incorrectly and or what additional information I should have provided. I'm getting the error Destination Host Unreachable.

scottro
Forum Moderator
Posts: 2556
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

Re: Setting Static IP

Post by scottro » 2015/04/02 22:16:44

Standard troubleshooting is first, can you ping the gateway? If so, can you ping a public IP address, such as ping 4.2.2.2? Once that's established, then it's your DNS--as it is, we don't know if it's DNS or routing.

If you can ping 4.2.2.2 but not google.com, then try first with a public DNS server--that is, set your /etc/resolv.conf as 8.8.8.8 or any other, like opendns, and see if that works.

If so, then the trouble is your DNS server.

It might be firewalls or SELinux though that seems unlikely. Anyway, questions one and two are can you ping your gateway and can you ping a public IP address. Then we know whether it's routing or DNS.
New users should check the FAQ and Read Me First pages

TargetOfGravity
Posts: 9
Joined: 2014/07/07 16:50:49

Re: Setting Static IP

Post by TargetOfGravity » 2015/04/02 22:25:46

Apologies I did try and ping the default gateway, same issue, Destination Host Unreachable.

scottro
Forum Moderator
Posts: 2556
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

Re: Setting Static IP

Post by scottro » 2015/04/03 02:26:49

Ok, so it's not a DNS issue.

Is there a DHCP server that you can use to temporarily get an address?

If you copied exactly, there's a typo in your ifcfg-eth0 file, you have etho0 at one point.

Is this CentOS-6.x or 7.x? If 7.x, you might be better off using the system-config-network-tui tool (which isn't included in the minimal install, they figure you will want to use NetworkManager), but it should be on a larger install DVD, and configure the network with it that way. I vaguely remember someone on Fedora forums commenting that they've made it more complex, with various scripts running in the background, so that manual configuration of one or two files often doesn't work that well, and have found that to happen on later versions of Fedora--or maybe I just typoed the files and didn't typo using the system-config-network tool.

Anyway, I think that's one option--install system-config-network-tui and use it to configure the card. As I said, I think it's on the DVD, or maybe you can temporarily get your card working with DCHP if there's a DHCP server on the network.
New users should check the FAQ and Read Me First pages

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: Setting Static IP

Post by gerald_clark » 2015/04/03 02:48:06

Your DEVICE is NOT etho0. It is eth0.

TargetOfGravity
Posts: 9
Joined: 2014/07/07 16:50:49

Re: [RESOLVED] Setting Static IP

Post by TargetOfGravity » 2015/04/13 16:03:19

Issue resolved, thank you for catching, amazing how easy it is to overlook when your the one doing it :) .

Post Reply