linux lan

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

penguinboy
Forum Contributor
Posts: 171
Joined: Thu Nov 07, 2002 11:25 am

linux lan

Post by penguinboy »

How can I set up a lan through linux?

Basically, I have 2 machines (slackware box,win2k box);
connected by an ethernet cable
and I want them to be able to see each other on a lan on something like
slack 172.40.2.1
win 172.40.2.2

[win]===ethernet===[slack]

Where I can send a ping from my slack box to 172.40.2.2
and get a reply from the win2k machine.

I've tried a few settings with ifconfig;
but I can't seem to figure it out.

Thanks for any help.
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

You can send the ping from the terminal (Xterm, Aterm, Eterm, Wterm) by typing ping 172.40.2.2.

And if you're in a real :evil: mood, do 'ping -f 172.40.2.2'.

Err... just kidding... :roll:

Also, what messages are you getting back when you type in ifconfig? And how are you typing in ifconfig? Are you passing it any arguments?

Ultimately, I am not familiar with Slack, but ifconfig should be the same beast as on Red Hat, Mandrake, Suse, and FloppyFW (the distros I've spent the most time with).

Let us know...

Cheers,
BDKR
penguinboy
Forum Contributor
Posts: 171
Joined: Thu Nov 07, 2002 11:25 am

Post by penguinboy »

Hehe, I know how to ping; I mean, my god;
I'm running linux right.. heheh?

I know how to set it up with a real IP;
I just don't know how to set up a LAN IP.

Anyway...

Well, I've tried several different settings with ifconfig.
IP:172.40.2.1
Bcast:172.40.2.255
Subnet:255.255.255.x ?? I've tried x=(0,128)
Gateway:172.40.2.x ?? I've tried x=(254,1,2)


Thanks for the reply.
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

I have tried ethernet to ethernet with almost every distro imaginable. The only thing I have found to work is to use a router or hub , then have ethernet cables from it to the two machines.
penguinboy
Forum Contributor
Posts: 171
Joined: Thu Nov 07, 2002 11:25 am

Post by penguinboy »

Is there anyway to make my linux box act like a router?
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

penguinboy wrote: Hehe, I know how to ping; I mean, my god;
I'm running linux right.. heheh?
Next time, be a little more clear 8O Seriously, what am I supposed to make of this:
penguinboy wrote: Where I can send a ping from my slack box to 172.40.2.2
Anyway,
penguinboy wrote: I know how to set it up with a real IP;
I just don't know how to set up a LAN IP.
What's the difference? Why would you even need an IP (as in address) if you're not going to be on a lan, or at least a network of some sort? Are you talking about routable vs non-routable addresses?
penguinboy wrote: Well, I've tried several different settings with ifconfig.
IP:172.40.2.1
Bcast:172.40.2.255
Subnet:255.255.255.x ?? I've tried x=(0,128)
Gateway:172.40.2.x ?? I've tried x=(254,1,2)
That said, can you ping yourself? Try anyone of those commands then type in ifconfig with no arguments. You should at least see two devices represented. LO for the loopback device and eth0 for you NIC.

You might also want to check to see that networking has been started in general. You can try (remember that I don't use Slackware) typing in

Code: Select all

service network status


Ultimately, if it all gets too bad you can try (as root)

Code: Select all

cd / ; rm -R -d
:twisted:

Err..., perhaps you had better disregard that last suggestion. :wink:

Is there a larger purpose for all of this? As an example, you want to use your Linux box as a Firewall and network gateway to the internet.

Cheers,
BDKR
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

One more thing: PLEASE DON'T RUN THAT COMMAND...

Code: Select all

cd / ; rm -R -d
I was just joking around.

Cheers,
BDKR
penguinboy
Forum Contributor
Posts: 171
Joined: Thu Nov 07, 2002 11:25 am

Post by penguinboy »

BDKR wrote:One more thing: PLEASE DON'T RUN THAT COMMAND...

Code: Select all

cd / ; rm -R -d
I was just joking around.

Cheers,
BDKR
lol, yeah I don't plan on removing my / directory anytime soon
penguinboy
Forum Contributor
Posts: 171
Joined: Thu Nov 07, 2002 11:25 am

Post by penguinboy »

BDKR wrote: Are you talking about routable vs non-routable addresses?
Yeah.
Real IP = routable
LAN IP = non-routable
BDKR wrote: Can you ping yourself?
Try anyone of those commands then type in ifconfig with no arguments. You should at least see two devices represented.
LO for the loopback device and eth0 for you NIC.
Yep, I can ping myself and I do see the loopback and eth0.
BDKR wrote: You might also want to check to see that networking has been started in general. You can try (remember that I don't use Slackware) typing in

Code: Select all

service network status
Hmm, service isn't a slackware command;
but, if I setup a routable IP with(example)

ip=1.1.1.1
subnet=255.255.255.128
bcast=1.1.1.255
gateway=1.1.1.254

I can ping any routable address.
BDKR wrote: Is there a larger purpose for all of this? As an example, you want to use your Linux box as a Firewall and network gateway to the internet.
Basically I want to set up my linux box with a routable IP on eth0
and a non-routable IP on eth1.

And I want to connect my Win2k box(with a non-routable IP) to eth1.

I've found a tutorial on sharing a connection.

I've set up the script, but i can't test it until I can get the machines to talk:
From the tutorial wrote: The above script will work after the following have been already done:

Set up the network on all the computers in the LAN.
Make sure every computer can be reached from another computer by "ping".

On each client computer, set the gateway to the internal IP address of the linux computer that is connected directly to the internet.
linux ip = 172.40.2.1
win2k ip = 172.40.2.2
I've set the win2k box's gateway to 172.40.2.1

But I can't get them to talk.

So I decided to focus on the LAN first and then worry about the script later.

But... I can't get the LAN to work.
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

Um..In my opinion it would be much easier to just buy a router ($50). Just plug the ethernet cable from the cable or dsl modem into the router, and plug the cables from the machines to the router. Most routers require little to no configuring, and I would recommend any and all Linksys routers.
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

Straterra wrote: Um..In my opinion it would be much easier to just buy a router ($50). Just plug the ethernet cable from the cable or dsl modem into the router, and plug the cables from the machines to the router. Most routers require little to no configuring, and I would recommend any and all Linksys routers.
While this is true, it (a cheap little router) is extremely limited and not anywhere near as powerful as putting a linux box there. If you are so inclined, the amount of stuff you can learn from doing this (learning about routing, port forwarding, iptables, intrusion detection, bandwidth throttling, etc...) makes you a good deal more marketable.

What scares me the most about a dumb firewall / gateway is that there is nothing to tell you when something is amiss. At least with the linux box he can watch for certain conditions and write a script to react to whatever those conditions may be.

Cheers,
BDKR
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

Hey Penguinboy,

I am at work right now and about to leave. I'll try to get back at you in an hour or two.

Cheers,
BDKR
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

Yeah well. I merely suggested that so that if he needed them connected like..NOW, he could do it while he tries to figure out to get what he wants to happen to work. And it is true that cheap routers suck..but..I love my Linky! She's all the networking equip I will ever need. :D
penguinboy
Forum Contributor
Posts: 171
Joined: Thu Nov 07, 2002 11:25 am

Post by penguinboy »

Hehe, I figured out the problem...

Needed a crossover instead of a straight through.
Sad.. I know....

Thanks for the help, BDKR.

Anyway, an external router is out of the question;
if this had failed I would've just went with a Mikrotik router.
User avatar
BDKR
DevNet Resident
Posts: 1207
Joined: Sat Jun 08, 2002 1:24 pm
Location: Florida
Contact:

Post by BDKR »

Straterra wrote:Yeah well. I merely suggested that so that if he needed them connected like..NOW, he could do it while he tries to figure out to get what he wants to happen to work. And it is true that cheap routers suck..but..I love my Linky! She's all the networking equip I will ever need. :D
Yeah, I hear what you're saying. As a matter of fact, that's my first suggestion to anybody that does'nt have a linux box anyways.

On the other hand, I make money with Linux and I've used it to do all kinds of firewalling and routing. In our SOHO (My wife and I) I have a firewall / gateway (233 mhz with 40 Megs or ram, which is more powerful than most Cisco routers) that I paid less than $50 for. Though it is extremely flexible and powerful, the learning curve is a bit steep.

Cheers,
BDKR
Post Reply