LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-01-2014, 10:03 AM   #1
e_oneill4
LQ Newbie
 
Registered: Dec 2014
Posts: 1

Rep: Reputation: Disabled
Default IP for LocalHost in RedHat 6


New to Linux, so please be patient.
Have installed RedHat v6 on a Desktop PC at home ( just to get a feel for Linux & using Unix bash shell scripting ). all is working ok, except id like to set up an FTP app. My Localhost on Redhat returns an IP = 127.0.0.1 ( via an ifconfig command )

have looked at numerous links where i can edit the ifcfg-eth0 file within /etc/sysconfig/ & it seems straightforward.

My question is "what IP do i assign it?"

Note: Im connected via a standard Wireless router.
 
Old 12-01-2014, 10:36 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Very likely, your wireless is a NAT device - thus blocking any incoming connections for a service.

A second issue with wireless is that the IP number is usually dynamically assigned (via DHCP during setup). This makes knowing what the IP number is rather hard. The USUAL solution (barring being blocked by NAT) is to use 0.0.0.0 for the address, which allows the service to respond to ANY network connection (even using the localhost IP).

Localhost references are by definition 127.0.0.1 for IPv4. This address is not really for a network device. It is used for supporting services for the local host only, and never goes outside.
 
Old 12-01-2014, 10:41 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,952

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by e_oneill4 View Post
New to Linux, so please be patient.
Have installed RedHat v6 on a Desktop PC at home ( just to get a feel for Linux & using Unix bash shell scripting ).
If I was you, I'd stop right where you are, and load something else. First, unless you plan on PAYING for RHEL, you will not get updates/patches/security fixes, and will wind up with an insecure/unstable system. You will also have a MUCH harder time loading software, since you won't have access to online repositories. Second, Red Hat Enterprise 6 is old...if you're going to pay for RHEL, at least load the latest version, which is 7. And third, and most important...WHY are you using RHEL??? It's not really suited for 'consumer' hardware, and for learning purposes, pretty much ANY Linux distro will be able to give you Linux experience, and ALL are suitable for bash scripting. If you want to stay within the Red Hat ecosystem, load the latest version of Fedora.
Quote:
all is working ok, except id like to set up an FTP app. My Localhost on Redhat returns an IP = 127.0.0.1 ( via an ifconfig command )
Right...127.0.0.1 is EVERYONES localhost address, on EVERY computer. Windows, Mac, Linux, and everything else uses it. It's a loopback address, and you don't change/modify it at all, ever.
Quote:
have looked at numerous links where i can edit the ifcfg-eth0 file within /etc/sysconfig/ & it seems straightforward. My question is "what IP do i assign it?" Note: Im connected via a standard Wireless router.
You leave localhost alone. For eth0, you assign it whatever address you want, or is available on your network...we can't tell you what you have available. Normally, most home routers have DHCP enabled, and will just hand out an address upon connection. Have you tried just plugging a cable in and see what it does? Are you using wireless or wifi?

Again, I'd STRONGLY suggest you load Fedora, which will probably be MUCH easier to load, maintain, and work better with consumer hardware. RHEL is for SERVERS...things that typically don't have wifi, bluetooth, sound, webcams, or even MONITORS and KEYBOARDS most of the time. Support for such devices can be challenging.
 
Old 12-01-2014, 11:07 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,957

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
Welcome to LinuxQuestions.

In addition. There really isn't a default IP address. If your connected assumed wired- and everything works then would also assume your computer is being assigned an IP address via DHCP by the router. If you look at the output of the command:
/sbin/ifconfig you should something like
Quote:
eth0 Link encap:Ethernet HWaddr ab:cd:ef:12:34:56
inet addr:192.168.0.100 Bcast:192.168.0.255 Mask:255.255.255.0
....
The actual address depends on the router configuration. You do not have to do anything. However, since the address is dynamic it could change. If you want to ftp from another computer you would use this address. In addition you might need to allow ftp traffic through the firewall if running.

Typically you would use a fixed IP address for a server. In some cases I find it useful to configure the router to always assign the same address vs setting a static address on the machine itself.
 
Old 12-01-2014, 04:20 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,394

Rep: Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207Reputation: 2207
Hosts file contains localhost number in almost all cases.
 
Old 12-01-2014, 04:46 PM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,825

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
Hi

please see TBOne's post

he said what i was going to but MUCH better than i would have .
 
  


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
Localhost pointing to default page if I don't specify the port number in the address rajaoLQ Linux - Server 6 08-24-2009 03:52 PM
apache2 + mod-ssl keeps loading the default localhost.xxxxxx cert STEBEL Linux - Newbie 3 11-26-2005 08:49 AM
Redhat - localhost login Onimoto Linux - Software 1 05-15-2004 11:35 AM
rename localhost in redhat 9 soonerdm Linux - Networking 23 01-12-2004 07:53 AM
Can not access localhost from local machine - RedHat 9 acepukas Linux - Networking 3 12-09-2003 02:17 PM


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