LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   configure hosts (https://www.linuxquestions.org/questions/linux-from-scratch-13/configure-hosts-4175597967/)

zoelee4 01-21-2017 04:31 PM

configure hosts
 
Hello, I am still pretty new to lfs and I am having some trouble configuring the networking. I attempted all of chapter 7.5. However whenever I run wget (from BLFS) I get an error:
Code:

--2017-01-21 23:29:06-- http://google.com/
Resolving google.com ... failed: Temporary failure in name resolution.
wget: unable to resolve host address

I think this is because the network is not correctly configured but I do not know for sure.

Thanks!

frankbell 01-21-2017 09:00 PM

What happens when you do this:

Code:

ping 8.8.8.8
ping google.com

If you can hit 8.8.8.8, but cannot hit google.com, you have an issue with your DNS. If you can't hit either, post the results here and we'll puzzle it out.

zoelee4 01-21-2017 10:37 PM

Nothing happens :(

here is the output of google:
Code:

ping: unknown host
and here is the output of 8.8.8.8:
Code:

PING 8.8.8.8 (8.8.8.8): 56 data bytes
ping: sending packet: Network is unreachable

Thanks for your reply!

spiky0011 01-22-2017 01:58 AM

Your not connected to a network. Are you using eth0 or wireless?

Output
Code:

ip link
Post your ifconfig.eth0 or ifconfig.wlan0.
Any other revelent info?

zoelee4 01-22-2017 12:45 PM

1 Attachment(s)
Here is the output of ifconfig and ip link:
(I am using screenshots because it is in a vm and that is a lot easeyer than having to type everything out. if you want me to type everything out just let me know and I would be happy to).
Attachment 24032

Thanks!

spiky0011 01-22-2017 01:15 PM

Ok you never said if you were using eth0 or wireless?
wireless is not found eth0 is enp0s3

you should have a "ifconfig.eth0"
from this page http://www.linuxfromscratch.org/lfs/...7/network.html

post that file. If you have a wireless you are trying to use, more needs to be done.

FYI to direct a terminal command to a file you could
Code:

ip link > /home/user/ip-link.txt

zoelee4 01-22-2017 03:03 PM

I am using eth0. Here is ifconfig.eth0 file:
Code:

ONBOOT=yes
IFACE=eth0
SERVICE=ipv4-static
IP=192.168.1.2
GATEWAY=192.168.1.1
PREFIX=24
BROADCAST=192.168.1.255

here is the resolv.conf file:
Code:

# Begin /etc/resolv.conf
# domain <Your Domain Name>
nameserver 8.8.8.8
nameserver 8.8.4.4
# End /etc/resolv.conf

and here is the /etc/hosts File:
Code:

# Begin /etc/hosts (network card version)
127.0.0.1 localhost
192.168.1.2 ara.boxjump.xyz ara
# End /etc/hosts (network card version)

thanks for your help!

spiky0011 01-22-2017 03:16 PM

ok eth0 is called enp0s3, so you need to change the name in your ifconf.eth0
Code:

ONBOOT=yes
IFACE=eth0 to IFACE=enp0s3
SERVICE=ipv4-static
IP=192.168.1.2
GATEWAY=192.168.1.1
PREFIX=24
BROADCAST=192.168.1.255

Also I presume you copied the file from lfs book?
That is an example file.
your ip address might not be the same, You will need to get the details from your host system.

ifconfig will help you with that. Look for the part inet addr and the numbers after it.

Edit the file as necessary

zoelee4 01-22-2017 05:00 PM

Sorry if this question is obvious, but what part do I need to replace?

spiky0011 01-22-2017 05:16 PM

change the eth0 part as indicated. Ip addr just change the ip addr in the config file to what yours is

example

IP=192.168.1.2 > 192.168.0.10
GATEWAY=192.168.1.1 > 192.168.0.1
BROADCAST=192.168.1.255 > 192.168.0.255

zoelee4 01-22-2017 05:52 PM

I do not know what is going wrong. I changed the ifconfig for my lfs system. here is my host system ifconfig:

Code:

enxa0cec80353b0 Link encap:Ethernet  HWaddr a0:ce:c8:03:53:b0 
          inet addr:192.168.1.191  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: 2601:602:8780:119b:bfbf:35ec:9aa6:eea7/64 Scope:Global
          inet6 addr: fe80::dec1:cf48:9ec2:9bfa/64 Scope:Link
          inet6 addr: fdc4:cc3f:3b42:0:19f9:4097:7536:9f3c/64 Scope:Global
          inet6 addr: 2601:602:8780:119b:1b8:7270:83ec:bb8b/64 Scope:Global
          inet6 addr: fdc4:cc3f:3b42:0:1b8:7270:83ec:bb8b/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:92902 errors:0 dropped:0 overruns:0 frame:0
          TX packets:63009 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:53764003 (53.7 MB)  TX bytes:11891931 (11.8 MB)

and here is my lfs system:
Code:

enp0s3 Link encap:Ethernet  HWaddr 08:00:27:56:61:F0
          inet addr:192.168.1.191  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:143 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:130  TX bytes:8824

thanks again for you help!

spiky0011 01-23-2017 02:18 AM

So dose it work you didn't say? ip link will show some info
You might have to change the name of the file ifconfig.eth0 > ifconfig.enp0s3 cant remember, but it wont hurt. Just read the note in the book on network page.

can you ping the router ping -c3 192.168.1.2 << presume thats your router ip If not change "GATEWAY=192.168.1.x" to correct

if yes
can you ping google ping -c3 www.google.com or ping -c3 8.8.8.8

When you reply back add any info to what is happening (we cant see)

zoelee4 01-23-2017 07:51 PM

It does not work. I have given you all the info I have. I will continue to play with it and see if I can get anything working.

Thanks for your help!

GentleThotSeaMonkey 01-23-2017 08:56 PM

Is it "UP ... RUNNING" like your ..1.191 computer is?
I'm not sure what the ?service? command is to start networking on LFS.
Yes, you *MUST* name the file ifconfig.enp0s3 (NOT .eth0!)

SERVICE=dhcp might be what you want (remove next/last 4 IP# lines)
Another idea: run a NuTyX (it's from LFS), to compare things with.

zoelee4 01-24-2017 09:41 PM

Thank you all for your help! I finally got it to work (I was so happy that I actually stood up from my desk and did a victory dance)! The problem was that virtualbox uses 10.0.x.x instead of 192.168.x.x so that was messing it up. thanks again for all of your help!


All times are GMT -5. The time now is 12:08 PM.