LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-13-2014, 11:47 AM   #1
Jackoalltrades
LQ Newbie
 
Registered: Aug 2014
Distribution: Kubuntu
Posts: 7

Rep: Reputation: Disabled
CentOS 6 Media Server Can't Connect to Internet


Hi,

First post so please excuse any missteps in explaining this issue.

I am running a CentOS6 box on some old hardware to act as a media server. I'm using Plex as my media server. I have configured eth0 to use a static IP address in the 192.168 range. The media server communicates without any problem on my internal network but is unable to communicate beyond my router.

Pings return ping: unknown host

I changed the boot protocol to DHCP and that resolves the issue, but it negates what I'm trying to do with the system. Here is a copy of my ifcfg-eth0 file.

DEVICE=eth0
HWADDR=00:25:22:C9:90:09
TYPE=Ethernet
UUID=4b067d69-eaa4-42f8-b236-4198a0fb3af8
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=dhcp

If a copy of the static IP info is needed, I can provide that. Leaving it as DHCP so I can update the system.

How do I update my network protocol to use a static IP assigned from my router and still have the server access the internet?

Thanks in advance for any help.
 
Old 09-13-2014, 01:55 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Quote:
ping: unknown host
Set your DNS settings correctly. Presumably your router is also a DNS server, and is the one you want this machine to use. Assuming your router's IP is 192.168.1.1, in ifcfg-eth0, set:
DNS1=192.168.1.1
 
1 members found this post helpful.
Old 09-13-2014, 05:01 PM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Code:
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=xx.xx.xx.xx
NETMASK=255.255.255..xx
GATEWAY=64.87.28.xx
format is what I have been using on CentOS release 5.10 (Final)

YMMV on CentOS 6.
 
Old 09-13-2014, 11:18 PM   #4
Jackoalltrades
LQ Newbie
 
Registered: Aug 2014
Distribution: Kubuntu
Posts: 7

Original Poster
Rep: Reputation: Disabled
This is what my ifcfg-eth0 looks like while set up for static:

DEVICE=eth0
HWADDR=xx:xx:xx:xx:xx:xx
TYPE=Ethernet
UUID=blahblah
ONBOOT=yes
NM_CONTROLLER=no
BOOTPROTO=static
IPADDR=192.168.1.21
NETMASK=255.255.255.0
GATEWAY=192.168.1.1

When it's configured that way, I only get access within my network. I can SSH to it, even FTP to it, but oddly, if I try to transfer anything the connection dies (not sure if this problem is related or not, just an observation). This configuration seems to jive with what Habitual said.

Will continue to muck about with that configuration. Will update if I get it working.
 
Old 09-14-2014, 08:44 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Found a CentOS 6.4 host, it may yield a clue:
Code:
less /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
TYPE=Ethernet
UUID=blah blah blah
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
HWADDR=blah blah blah
IPADDR=192.168.23.12
PREFIX=24
GATEWAY=192.168.23.1
DNS1=8.8.8.8
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
My guess at this hour is you need
Code:
DNS1=8.8.8.8
 
1 members found this post helpful.
Old 09-14-2014, 10:21 AM   #6
Jackoalltrades
LQ Newbie
 
Registered: Aug 2014
Distribution: Kubuntu
Posts: 7

Original Poster
Rep: Reputation: Disabled
By George I think that's done it. So far so good at any rate. Restart network service, it picked up the designated IP, system can connect both internally and externally. It even fixed the FTP issues I was seeing.

Thanks so much!
 
Old 09-14-2014, 01:23 PM   #7
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Glad it worked out.
 
  


Reply



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
media server for centos ... recommend one? socalheel Linux - Software 3 10-11-2013 02:37 PM
CentOS 5.6 can connect to internet, but can't display websites or SSH SecurityGate Linux - Newbie 4 05-20-2011 01:00 AM
cannot connect to internet from centos machine mbanwi Linux - Newbie 3 07-08-2009 08:40 PM
Cannot Connect to Internet; CentOS lucknowm62 Linux - Networking 8 08-26-2007 01:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:35 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
Open Source Consulting | Domain Registration