LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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


Reply
  Search this Thread
Old 02-16-2014, 05:24 AM   #1
dragonprasad
Member
 
Registered: Dec 2013
Location: INDIA
Distribution: Ubuntu, windows, Android
Posts: 80
Blog Entries: 3

Rep: Reputation: Disabled
Exclamation 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......
 
Old 02-16-2014, 06:47 AM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
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.
 
Old 02-16-2014, 10:23 AM   #3
dragonprasad
Member
 
Registered: Dec 2013
Location: INDIA
Distribution: Ubuntu, windows, Android
Posts: 80

Original Poster
Blog Entries: 3

Rep: Reputation: Disabled
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.
 
Old 02-17-2014, 05:33 PM   #4
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Quote:
Originally Posted by dragonprasad

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.
 
Old 02-18-2014, 01:21 AM   #5
dragonprasad
Member
 
Registered: Dec 2013
Location: INDIA
Distribution: Ubuntu, windows, Android
Posts: 80

Original Poster
Blog Entries: 3

Rep: Reputation: Disabled
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.
 
Old 02-18-2014, 04:10 AM   #6
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Actually if you skip 7.2.2 you can later use dhcp-client or dhcpcd to manage the network using DHCP rather than static IP addressing.

I normally use this for 7.2.3 section:

Code:
cat > /etc/resolv.conf << "EOF"
# Begin /etc/resolv.conf

domain home.org
nameserver 8.8.4.4
nameserver 8.8.8.8

# End /etc/resolv.conf
EOF
I don't think you have to use a FQDN for the domain but often it will help.

DHCP-Client can be looked into here:

http://www.linuxfromscratch.org/blfs...cnet/dhcp.html
 
Old 02-18-2014, 05:16 AM   #7
dragonprasad
Member
 
Registered: Dec 2013
Location: INDIA
Distribution: Ubuntu, windows, Android
Posts: 80

Original Poster
Blog Entries: 3

Rep: Reputation: Disabled
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.
 
Old 02-18-2014, 07:48 AM   #8
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Quote:
Originally Posted by dragonprasad

...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.

Last edited by stoat; 02-18-2014 at 07:57 AM.
 
Old 02-18-2014, 09:07 AM   #9
dragonprasad
Member
 
Registered: Dec 2013
Location: INDIA
Distribution: Ubuntu, windows, Android
Posts: 80

Original Poster
Blog Entries: 3

Rep: Reputation: Disabled
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:-


"IP=192.168.1.1
GATEWAY=192.168.1.2
PREFIX=24
BROADCAST=192.168.1.255 "


do i need to change any of this. Or do i need to keep them same for both the files. Or something else?
please help
 
Old 02-18-2014, 02:24 PM   #10
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
The LAN file will be .eth0 and the wireless will be .wlan0 respectively.
 
Old 02-19-2014, 04:31 AM   #11
dragonprasad
Member
 
Registered: Dec 2013
Location: INDIA
Distribution: Ubuntu, windows, Android
Posts: 80

Original Poster
Blog Entries: 3

Rep: Reputation: Disabled
Exclamation

Quote:
Originally Posted by ReaperX7 View Post
The LAN file will be .eth0 and the wireless will be .wlan0 respectively.
ReaperX7 thanks for help but i knew that, i have query on the content of these files.
 
Old 02-19-2014, 10:11 AM   #12
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
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...

http://www.linuxquestions.org/questi...0/#post4872607
 
  


Reply

Tags
lfs, netwoking



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
[SOLVED] LFS 7.3 Chapter 7.2.2 Creating Network Interface Configuration Files DeeGee Linux From Scratch 23 07-03-2013 11:59 PM
[SOLVED] Help with network configuration in Chapter 7.2.2 of LFS 7.1 engineer Linux From Scratch 9 01-21-2013 08:11 PM
LFS chapter-by-chapter complete commands with notes DrinkinHomeBrew Linux From Scratch 6 03-16-2012 01:57 AM
[SOLVED] Setting FQDN in network with only some public-facing servers Gerard Lally Linux - General 2 09-02-2011 04:40 AM
LFS 6.3, messed up somewhere prior to chapter 6.12 (gcc), how to restart chapter 6? Funkster Linux From Scratch 2 12-24-2008 06:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 05:19 AM.

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