Network Configuration Noob, Having trouble with ch. 7.5
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.
As well as everything else in Ch. 7.5. I'm completely lost, this is all jargon to me.
I ran bash /lib/udev/init-net-rules.sh on the previous page along with cat /etc/udev/rules.d/70-persistent-net.rules
To which the output was:
Code:
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# net device r8169
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="d8:c4:97:5f:f7:35", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="enp2s0f1"
So I understand that the name of my device is enp2s0f1. I know there are easier ways to find it but I hadn't clicked to 7.5 yet. But that's fine.
Anyways, I'm not sure what to input for ANY of the other options here, and I'm feeling a bit overwhelmed. What do I put in for SERVICE? Or GATEWAY or IP? Or BROADCAST?
If I scroll down I see this:
Code:
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
And it's making me even more confused. I'm so lost. Someone please help.
That would depend on how you connect to the network. With a router/gateway? You'd need to know what IP address range it assigns (e.g. 192.168.0.x or 192.168.1.x or whatever it is) and if configuring statically, you would need to choose an IP address that's outside of its DHCP scope for automatically assigning addresses, and choose an address that's not already in use by another device. LIKELY addresses below .50 would be fine, but you'd have to check your router's configuration.
So, if configuring statically, the SERVICE variable would indeed be ipv4-static
If we assume the router uses 192.168.1.x as in the example
ONBOOT=yes
IFACE=eth0 <--- change that to enp2s0f1 if that's what you want to use.
SERVICE=ipv4-static
IP=192.168.1.2 <--- change that if not appropriate
GATEWAY=192.168.1.1
PREFIX=24
BROADCAST=192.168.1.255
If you want your interface to be eth0 (or eth1 or whatever is appropriate if there is more than one adapter in the machine), change your udev rule accordingly, for example:
If you want to use DHCP, you'd have to jump ahead and compile the dhcpcd program and configure it. (you likely only want the client package, dhcpcd not "DHCP")
Then you'd change the SERVICE to dhcpcd as in the example.
P.S. If configuring statically, most routers will allow you to use the router's IP address as a nameserver. Otherwise, use your ISP's nameservers, or OpenDNS's or something. If configuring dynamically, DHCP would take care of that.
Last edited by TheRealGrogan; 12-03-2019 at 06:30 PM.
Reason: Probably no need for the dhcpd server in this use case.
The ifconfig.eth0 file only you can set this for Your network as they are set differently.
In
"ip, gateway, broadcast"
you need the ip address of your router, ( obtain from host) ie 192.168.X.X where X might be differenet to the book i,e 192.168.0.X "0" will be subnet the last X for ip will be the ip address for your machine.
Gatway will be the same subnet as ip "0"(you can get that from router "noramlly 1")
Broadcast again subnet the same 0 but will end 255.
Using ifconfig on host will help with most of addresses. service is stating you are using a static ip addresss
/etc/resolv.conf
nameserver I use 8.8.8.8 which is google and 8.8.4.4 as well google again.
nameserver=8.8.8.8
nameserver=8.8.4.4
I'm trying my best to understand all the new terms being thrown at me. Networking is NOT a field I'm experienced in AT ALL. I've never touched it until today.
What I've understood so far is (and correct me if I'm wrong):
- IP is my router IP address, not anything to do with my computer network card
- Gateway is the router IP address but with a 1 instead of a 0
- Broadcast is router IP address but with 255 instead of 0
- I have IFACE right but I can change it to eth0 (for ease I assume?)
Everything else kind of came out as jargon to me (sorry TheRealGrogan). I seem to just have more networking questions now. What does it mean for it to be static? What's DHCP? What does it mean for it to be dynamic?
I never use a wired network, is that what all this is for, configuring wired network? Or network in general? If it's for wired is there a way for me to setup wireless instead? I'm running this on a laptop (all I have), so it'd be more efficient. What exactly IS a nameserver?
Sorry for the plethora of questions, like I said this is my first time encountering networking and I want to make sure I understand it properly before continuing with anything. Understanding comes before getting this thing booted in my opinion.
wlp3s0 seems to have broadcast, inet and netmask. I think, from what I read earlier this is my wireless network? I found I don't actually have an ethernet port on my laptop so would I have to set up wireless? How do I do that?
IP address is not your router's IP address, but the IP address you want to assign to your network card.
GATEWAY is your router's IP address.
Static means a fixed IP address, not automatically (dynamically) assigned by the router.
Sorry, I don't know what else to tell you. You should probably read up on basic networking concepts.
You might want to skip networking until later, until you have WiFi drivers and related machinery. Once you get X and a graphical environment built (Desktop Environment) you can use Network Manager.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.