[SOLVED] facing problem in setting the network configuration in chapter 7.2 in LFS
Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
facing problem in setting the network configuration in chapter 7.2 in LFS
hello guys,
am right now in 7.2 in LFS BOOK and have confusions in entering the details since i have a less knowledge in networking.
the following code showld be run in this chapter (7.2) but i lack in networking knowledge so need help . what all to be filled here.
cat > /etc/resolv.conf << "EOF"
# Begin /etc/resolv.conf
domain <Your Domain Name>
nameserver <IP address of your primary nameserver>
nameserver <IP address of your secondary nameserver>
# End /etc/resolv.conf
EOF
queries are:-
1. what should be replaced in <your domain name>
==================================================================================================== ==========
when i run this command "nm-tool | tail -n 8" i got the following result:-
Address: **.***.**.**
Prefix: 18 (255.255.***.0)
Gateway: **.***.**.*
DNS: 202.53.8.8
DNS: 202.53.8.9
=====================================================================================
and when run this command "cat /etc/resolv.conf" got this result:-
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
=====================================================================================
so what should be replaced with the <your domain name> in the code.
please help......
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150
Rep:
This is my resolv.conf
Code:
# Begin /etc/resolv.conf
domain local
nameserver 192.168.1.66
#nameserver 8.8.8.8
#nameserver 192.168.1.254
# End /etc/resolv.conf
Asyou can see domain is local though if you are mounting windows shares I beleive the default is WORKGROUP, I'm sure someone will correct me if I'm wrong!
The nameserver can be a local machine running a DNS server like mine, a public nameserver like the first commented out one (google) or more usually the server run by your router which is just your router address, the second commented out one.
Multiple nameservers can be used, I could for instance uncomment the nameservers above and they would be queried in order.
Obviously you should select any local ips to match your own.
Last edited by Keith Hedger; 02-16-2014 at 06:49 AM.
as i old earlier that i don't have any knowledge on networking....So it would be nice of you if you guide me through this. I will will be thankful to you if you guide me out of networking part.
queries are:-
1. what should be replaced in <your domain name>
For now, just comment out that domain line in /etc/resolv.conf. It's not really required there since it will get looked up if it's not there. I still have it commented out in mine.
Those nameserver lines are for DNS nameserver addresses. Usually, your ISP will provide those. Or, there are many others that people use (Google, OpenDNS, etc.). If you're using a router that handles that chore, you can sometimes just put the IP of the router there. I like to enter the nameservers provided by my ISP (AT&T). Those two IPs in your first post look like ISP DNS nameservers to me. I looked them up and they belong to a cable system. Probably your Internet service provider. Try those in your resolv.conf file.
So, IMO, this takes care of /etc/resolv.conf. Now create /etc/hosts and a network config file (/etc/sysconfig/ifconfig.<something>. If you are using a common standard wired NIC, then the kernel probably has a driver for it. If you configured the kernel for it, and if you correctly created those files mentioned, then the thing will quietly and automatically connect at boot time. If you are using a wireless connection, then considerable extra work will be needed to get that connected.
In section 7.2.2 in LFS we need to create some file to configure internet.
----------------------------------------------------------------------------------------------------------------------------------
The following command creates a sample file for the eth0 device with a static IP address:
cd /etc/sysconfig/
cat > ifconfig.eth0 << "EOF"
ONBOOT=yes
IFACE=eth0
SERVICE=ipv4-static
IP=192.168.1.1
GATEWAY=192.168.1.2
PREFIX=24
BROADCAST=192.168.1.255
EOF
----------------------------------------------------------------------------------------------------------------------------------
from the page i understood that for each device you need to create this file. But what about the content of the file such as ip address and all. should i change those information for each file or should i keep the same information for both.
Thanks Keith Hedger, Stoat and ReaperX7 for your replies. You made this section clear.
But i have a query on section 7.3 since i am leaving section 7.2.2 (but implementing section 7.2.3), so do i need to skip section 7.3 also or i need to implement it.
If i need to implement the code then which one code should i run first one or second one.
and what what changes should be done in the content of these codes.
eg. hostname.example.org what should i write in place of it.
...so do i need to skip section 7.3 also or i need to implement it.
If i need to implement the code then which one code should i run first one or second one.
and what what changes should be done in the content of these codes.
eg. hostname.example.org what should i write in place of it.
Don't skip the /etc/hosts file. That is where you establish the domain name and aliases of the computer. You can make up any name you want, but a typical standard one is localhost.localdomain. It's not very interesting, but I still use that. Here is an example /etc/hosts showing the IP 127.0.0.1 which is always the local computer's IP, an FQDN (fully qualified domain name) of localhost.localdomain, and an alias of localhost...
Code:
# Begin /etc/hosts (network card version)
127.0.0.1 localhost.localdomain localhost
::1 localhost.localdomain localhost
# End /etc/hosts (network card version)
For this project you shouldn't need to bother with entering a local network IP address in /etc/hosts.
P.S.: There is nothing wrong with the advice to skip the section about creating /etc/sysconfig/ifconfig.eth0 with a static IP and implementing dynamic IP addressing later. However, just be aware that static IP addressing usually is very simple to do. Dynamic IP addressing is a little more complicated and also is an opportunity to get bogged down at this point. After all, that is a BLFS topic. Also, it's a simple matter to switch from static to dynamic later. But everyone should do what they think is best.
Stoat as per your suggestion i am feeling confident to do the section 7 but again have query on it....
In the section 7.2.2 their is the code to set the ifconfig file, I understood that i need to create two files one for Ethernet and one for WiFi. But my worry is about this:-
Of course do what you think is best, but I recommend that you concentrate on just the wired connection for now if the computer can be placed close enough to your router to connect by wire. The wireless connection will involve more effort and more packages from BLFS. It's not difficult to setup the wireless connection, but at this point it is just more opportunity to get bogged down and diverted from finishing the LFS system. As far as I can tell, your system isn't even bootable yet. Anyway, for some ideas about the network config file and what to put in there, see if this post on the subject helps any...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.