LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Having internet with USE_DHCP="" in rc.inet1.conf possible? (https://www.linuxquestions.org/questions/slackware-14/having-internet-with-use_dhcp%3D-in-rc-inet1-conf-possible-4175450762/)

Alien Bob 02-19-2013 04:06 PM

Had you read http://docs.slackware.com/start?id=s...e_your_network then this whole thread would not have been necessary.

Eric

tronayne 02-20-2013 12:13 PM

Quote:

Originally Posted by stf92 (Post 4895111)
Yes, I did that. I also reset the modem, the router and the machines several times: no use. I in A I do

ifconfig eth0 192.168.0.2

then all is fine. But when I reboot, I am again 192.168.0.100!

Don't forget to take the "ifconfig" out of your file in /etc/rc.d -- if you don't, it may come back to haunt you sooner or later...

Martinus2u 02-20-2013 01:25 PM

Just to complicate matters further, it is totally possible to continue to use dhcpcd (the DHCP Client Daemon) and assign static IP addresses. You just have to configure /etc/dhcpcd.conf accordingly. I have found that approach superior to /etc/rc.d/rc.inet1.conf on at least one occasion.

eloi 02-23-2013 04:35 PM

Check router ip range
 
@stf92

I know that this thread is marked as solved but I have the impression that some
concepts are not clear enough.

I assume you've already understood that the dynamic IP provided by your ISP is
the external IP. What you are configuring is your LAN.

Router web interfaces are a bit confusing. You should not disable dhcp in your
router. Just do not use it (client) in your machines. Your router will use
dhcp client to connect to your ISP and dhcp server to assign IPs to your LAN
machines. Perhaps it will let you pre define some "static leases" where you
associate the MAC address of each network interface with a static IP (mine let
me add the host name of each machine too).

Take in care that routers generally ask you to define a "range" of ips to
assign, so if that range is 192.168.0.100 - 192.168.0.200 and you put
192.168.0.2 in rc.inet1.conf it will not work (probably what happened to
you).

What you showed on your first post for rc.inet1.conf is OK (unless 192.168.0.2
is not in the router's pre defined range like I've explained above).

You can add to /etc/resolv.conf:

Code:

search local
nameserver 192.168.0.1

to ask names to your router or:

Code:

nameserver 8.8.8.8
nameserver 8.8.4.4

if you want your machine uses google's. Should work in both cases.

You can add to /etc/hosts in both machines (I have a
linux embeded in my router so I ssh access it and edit /etc/hosts with the same
values).

Code:

127.0.0.1        localhost
192.168.0.1        routername.local        routername
192.168.0.100        machine1.local                machine1
192.168.0.101        machine2.local                machine2


Your router configuration is what you should investigate first.

-


All times are GMT -5. The time now is 11:47 AM.