LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-08-2012, 12:55 AM   #1
waddles
Member
 
Registered: Sep 2012
Posts: 372

Rep: Reputation: 1
cannot ping me as 192.168.2.1


Hi, I am trying to fight a static IP setup so that I can ftp files between the machines. I'm using Slackware 13.37 on 2 desktop machines with an ethernet cable connecting. Hence no router and the gateway in the netconfig setup was empty. I have visually and electrically tested the cable and that is OK. The lights at both ends of the cable are on. I have setup the primary machine with IP=192.168.2.1 and the secondary machine IP=192.168.2.2.
The secondary machine can ping itself and gets a no returned packets when pinging the primary. The primary machine gets not returned packets for either itself or when pinging the secondary.
I have not touched rc.inet1.conf, rc.wireless.conf, or rc.modules.
Have I done good so far ? Do I need to configure any of the rc.* files?
I am fighting wifi and connecting to it but do not think those should effect this. I have read toooooo much and am beginning to transfer logic between the problems, so anything is possible.

Last edited by waddles; 12-08-2012 at 12:57 AM.
 
Old 12-08-2012, 04:03 AM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
IIRC I needed to splice the cable at one end (either end) swapping between the Brown and Red lines for this to work. That's when I connected two boxes DIRECTLY without Switch without Router, and the IPv4 protocol ran over and between the boxes. <That was more than a decade ago ) If you have no Switch nor Router I think you can do the same.

However, if you give much time over "man route" you should be able to set up a static route between them and exchange packets. Just be sure that one box routes its packets to the other and vice versa. Else you should use a router as a gateway between two IPs.

The inet configuration file for Slackware is found at /etc/rc.d/rc.inet1.conf, but be sure to backup the original first

Quote:
cp /etc/rc.d/rc.inet1.conf /etc/rc.d/rc.inet1.conf~
Then right there you can hardcode the Static IP each of the boxes and set the gateway

Quote:
# Config information for eth0:
IPADDR[0]="xxx.xxx.xxx.xxx"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]="no"
DHCP_HOSTNAME[0]="xxx.xxx.xxx.xxx"
........ scroll a bit to lower,

Quote:
# Default gateway IP address:
GATEWAY="xxx.xxx.xxx.xxx"
Then rerun the protocol

Quote:
~# /etc/rc.d/rc.inet1 restart
HOpe that helps.

Good luck.

Last edited by malekmustaq; 12-08-2012 at 04:05 AM.
 
Old 12-08-2012, 05:17 AM   #3
waddles
Member
 
Registered: Sep 2012
Posts: 372

Original Poster
Rep: Reputation: 1
cannot ping me as 192.168.2.1

A VERY BIG THANKS for the response. It has helped to clear away much of the uncertainty/unknown.

I presume by by switching the "brown" and "red" lines you built what is called a crossover cable. That is what I have installed.
I looked at the man page for route which states: "NOTE: The specified gateway must be reachable first. This usually means that you have to set up a static route to the gateway beforehand. If you specify the address of one of your local interfaces, it will be used to decide about the interface to which the packets should be routed to."
Firstly here, I presume this might mean I must go back to netconfig (root) and reconfigure the static IP with a gateway (the instructions said to leave empty for a static IP) furthermore that the gateway for each machine is the other machine. Is that a correct interpretation? I wonder if that isn't redundant because netconfig sets up the gateway then modifying rc.inet1.conf is modified for that gateway and route command creates the route.
Isn't the route command plus the rc.inet1.conf overriding what the netconfig did or didn't do?
I also wonder about rc.modules needs modifying?

I will be staying with a simplistic "static network" simply because it is there and a direct solution to file transfer.

Unless you suggest otherwise it is also my intention to create a rc.inet1.conf.static file like you suggest then I can copy it to rc.inet1.conf and along with a route command to establish routes, in a script which I would run on each machine when I need then change back when finished.

Again thanks <):^)
Oops! made the mistake of looking further here is what I found. "Apparently" there are 2 ways to do this: 1) modify rc.inet1.conf or 2) a script to modify ifconfig settings and change route.
In modifying rc.inet1.conf there seem to be differences:
a) Leaving USE_DHCP[0]="" or ="no" or probably doesn't matter?
b) Leaving GATEWAY="" or ="192.168.2.254" or ="... .1". Any explanations?
Using rc.local and loading it with:
killall dhcpcd
ifconfig eth0 192.168.2.1 netmask 255.255.255.0 up
route add default gateway 192.168.2.1

I am thinking that the latter could be put into a script and run whenever. Is that a possibility?

Last edited by waddles; 12-08-2012 at 03:11 PM.
 
Old 12-10-2012, 07:26 AM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
about dhcpd, why not keeping it from starting with init? Go find the starting link in one of the rc[123456].d directories and move it out of there or rename it or whatever.

And the network configuration, if you expect it to last I'd recommend you leave it on the corresponding sysconfig files.... but that's just cause I love to nag other people with these futilities.

Also, you only care about these two boxes seeing each other? No router involved.
 
Old 12-10-2012, 07:28 AM   #5
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
Oh, and finally, if both boxes are set up with their corresponding IP addresses/netmasks, did you check that there's no netfilter stuff getting in the way?

iptables -L -nv
iptables -t nat -L -nv
 
  


Reply



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
my server can't ping other boxes on private network (192.168.0.0) bweaver Linux - Networking 5 07-28-2011 03:20 PM
[SOLVED] iptables 192.168.1.x server, can't ping by 192.168.0.x momok Linux - Security 2 06-02-2011 01:32 AM
[root@wlxxb ~]# telnet 192.168.192.12 25 Trying 192.168.192.12... telnet problem cnhawk386 Linux - Networking 1 10-10-2007 02:50 PM
What route to access daisy chained 2d router 192.168.1.1 after 192.168.0.1 (subnets?) Emmanuel_uk Linux - Networking 6 05-05-2006 01:47 AM
Is someone on my network?! ::ffff:192.168.0.10:ssh ::ffff:192.168.0.:38201 ESTABLISHE ming0 Linux - Security 4 04-12-2005 01:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

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