LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Default IP for LocalHost in RedHat 6 (https://www.linuxquestions.org/questions/linux-newbie-8/default-ip-for-localhost-in-redhat-6-a-4175526969/)

e_oneill4 12-01-2014 09:03 AM

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.

jpollard 12-01-2014 09:36 AM

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.

TB0ne 12-01-2014 09:41 AM

Quote:

Originally Posted by e_oneill4 (Post 5277556)
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.

michaelk 12-01-2014 10:07 AM

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.

jefro 12-01-2014 03:20 PM

Hosts file contains localhost number in almost all cases.

John VV 12-01-2014 03:46 PM

Hi

please see TBOne's post

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


All times are GMT -5. The time now is 04:41 PM.