LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 03-04-2013, 06:43 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,225

Rep: Reputation: 49
LAN and static IPs again.


Hi: My ISP gives me DHCP. I have two computers connected in LAN. The cable modem is connected to the coaxial cable provided by the ISP and to a router. From this, one cable goes to one computer and another to the other computer. Until today I had internet in both computers and each computer talked to the other one. The relevant files contents were (one computer shown):

/etc/rc.d/rc.inet1.conf:
Code:
# Config information for eth0:
IPADDR[0]="192.168.0.2"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""

# Default gateway IP address:
GATEWAY="192.168.0.1"
This one maybe is not relevant but I list it anyways:
/etc/hosts:
Code:
127.0.0.1		localhost
192.168.0.2             server.DN1 server
192.168.0.3             local.DN2  local
OK. As I have determined to switch to another company, today the technician from the new ISP came and made the new installation. So the cable modem is a new one. When the serviceman left, I had windows with internet in both machines. As to Linux, I thought I had not anything to touch. But I could not connetct to the internet. Notice how, in the setup, I had chosen static IPs for the two machines. In this new scenario, what I did was to write a new /etc/rc.d/rc.inet1.conf:
Code:
# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]="yes"
DHCP_HOSTNAME[0]=""


# Default gateway IP address:
GATEWAY="192.168.0.1"
And now I have internet. But this is only a provisional rc.inet1.conf, so that I can post the present post. I arrived at the old software setup after many days of reading information sources, and trial and error. Furthermore, that setup was working. So, I do not want to change it.

The (static) IPs, 192.168.0.2 and 192.168.0.3 for the machines were arbitrarily chosen by me, within the allowed range. And the gateway has still to be 192.168.0.1. No need to change these. The file /etc/hosts only assigns names to IPs. Perhaps running netconfig again? What does netconfig do, apart from writing a new /etc/hosts and running ifconfig. By the way, at present ifconfig gives:
Code:
root@server:/etc/rc.d# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.100  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::922b:34ff:feb8:78cf  prefixlen 64  scopeid 0x20<link>
        ether 90:2b:34:b8:78:cf  txqueuelen 1000  (Ethernet)
        RX packets 664  bytes 325273 (317.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 762  bytes 122005 (119.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 42  base 0x2000  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 8  bytes 480 (480.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8  bytes 480 (480.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@server:/etc/rc.d#
This is the state as of this writing, i.e., with internet connectivity. Could you tell me what is the thing I am omitting?

Last edited by stf92; 03-04-2013 at 06:44 PM.
 
Old 03-04-2013, 06:51 PM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,334

Rep: Reputation: Disabled
Apparently your old router had a network IP range or 192.168.0.0/255.255.255.0 while the new router has 192.168.1.0/255.255.255.0.
Therefore your old configuration with static IP addresses and a gateway address of 192.168.0.1 would not get your traffic across the router.
That new router obviously is running a DHCP server and you should learn how to configure it so that it will give each computer its own permanent IP address (based on MAC address).

Really, using DHCP is the safest and easiest way to provide network connectivity out of the box.

If you want to stick to static IP's, just change the third tuple from "0" to "1". I am assuming that the new default gateway is "192.168.1.1" but that does not show from your post. Try running "route -n" to find out what the router's default gateway address is and add that to your computers' rc.inet1.conf files.

And finally, start reading the fine manuals please. You will certainly profit from a reading bit of network basics.

Eric
 
Old 03-04-2013, 06:52 PM   #3
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,590

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Did you login to your new router and assign the static IP reservations? thats your problem, the router wants to use DHCP to assign a random IP and the system wants to use a specific one. The router won't let it use a specific one unless it has a reservation for that MAC address.

Just do a quick google on your router model number and static IP reservations. It took me about 20 seconds to set up on my Cisco router at home.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Production server with static IPs on eth0 and eth0:1 - need private LAN on eth1 stardotstar Linux - Networking 8 07-03-2010 01:27 AM
Using static IPs with wpa_supplicant jgombos Debian 6 08-23-2009 01:35 PM
2WIRE need bridge for static lan ips gjmwalsh Linux - Networking 5 06-27-2007 08:48 AM
Problem with static IPs Outerlimit Linux - Networking 2 02-15-2006 04:35 PM
Using static ips with a router jclu Linux - Hardware 2 07-31-2005 06:35 PM


All times are GMT -5. The time now is 09:02 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration