LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 02-18-2005, 05:11 PM   #1
WolfCub
Member
 
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175

Rep: Reputation: 30
Crossover cable


I have a laptop and a desktop both running Debian 3.1. The desktop has dual LAN. I have a DSL modem plugged in to eth0 on the desktop. I have a crossover cable plugged into eth1 on the desktop and eth0 on the laptop. I want to LAN them and share the internet connection. I want to be able to play Quake 3 over the LAN. This is my /etc/network/interfaces file for the desktop:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth1
iface eth1 inet static
address 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255

The file on the laptop looks like this:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255

They will not communicate. What am I doing wrong?
 
Old 02-18-2005, 06:24 PM   #2
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
are you running a dhcp server on the desktop? If not, what do you have in your hosts file for both computers?
 
Old 02-18-2005, 06:37 PM   #3
WolfCub
Member
 
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175

Original Poster
Rep: Reputation: 30
I am NOT running dhcp. My hosts file for my desktop contains:

127.0.0.1 localhost.localdomain localhost debian

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts


And my hosts file for my laptop contains:

127.0.0.1 localhost.localdomain localhost EvoN620

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts


Thanks for the reply! Keem em comin
 
Old 02-18-2005, 06:45 PM   #4
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
without dhcp, you need to make an entry in each hosts file identifying the computers, naming the machines and their domains, and providing IP addresses for them.

You identify IP addresses for each machine; where did these come from?

In any case, in each hosts file place lines like these (change to match your installation) and that should get you going:

192.168.0.1 desktop.localdomain desktop
192.168.0.2 laptop.localdomain laptop
 
Old 02-18-2005, 09:11 PM   #5
WolfCub
Member
 
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175

Original Poster
Rep: Reputation: 30
They can ping each other! I'm so excited!!! Now, how do I allow the laptop to use the Internet through my main computer? And Quake 3 will not LAN with between the two computers, when I set the desktop as the host and try to join I get "CLIENT_UNKNOWN_TO_AUTH" for some reason? Please help!
 
Old 02-19-2005, 08:04 AM   #6
WolfCub
Member
 
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175

Original Poster
Rep: Reputation: 30
I asked someone and he said that sharing the DSL connection is possible, but he doesn't know how. I'm sure it's not too hard, could you give me a few instructions on how to do so?
 
Old 02-19-2005, 08:22 AM   #7
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
You can use iptables to set up connection sharing or (and this is my preferred solution) use squid, which is a caching proxy server.
 
Old 02-19-2005, 08:31 AM   #8
WolfCub
Member
 
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175

Original Poster
Rep: Reputation: 30
OK, how would I do it with iptables? I already have it installed on both...
 
Old 02-19-2005, 09:57 AM   #9
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
http://www.useraddit.com/nat.html

Google is your friend, or would be if it wasn't spying on you.
 
Old 02-19-2005, 10:55 AM   #10
WolfCub
Member
 
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175

Original Poster
Rep: Reputation: 30
I skipped to the last part since I already had them connected and able to ping eachother. Now, I ran:

echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
/sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE


And it's still not working. Did I miss anything? I want the laptop to use the desktop as a gateway to the internet. My resolve.conf files are identical on the laptop and the desktop, they contain:

nameserver 199.166.210.2
nameserver 199.166.210.5

Am I missing anything? Please help.
 
Old 02-19-2005, 11:15 AM   #11
WolfCub
Member
 
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175

Original Poster
Rep: Reputation: 30
Running iptables -L gives:

debian:~# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination
TCPMSS tcp -- anywhere anywhere tcp flags:SYN,RST/SYN tcpmss match 1400:1536 TCPMSS clamp to PMTU

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
debian:~#


Please help.
 
Old 02-19-2005, 11:26 AM   #12
WolfCub
Member
 
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175

Original Poster
Rep: Reputation: 30
OK, I added:

gateway 192.168.0.1

to my interfaces file and now it works. How can I get this to save upon reboot and how can I share files?
 
Old 02-19-2005, 11:35 AM   #13
astroem
LQ Newbie
 
Registered: Feb 2005
Location: Örebro, Sweden
Distribution: Debian unstable
Posts: 6

Rep: Reputation: 0
You should only enable masquerade for the external interface (in your case eth0 on the desktop, if I read you correctly). Delete the rules for eth1 and ppp0.
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
If it still refuses to work, post the output of
iptables -L -n -v -t nat
iptables -L -n -v
cat /proc/sys/net/ipv4/ip_forward
 
Old 02-19-2005, 11:36 AM   #14
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
LOL.

Looks like you are getting there. All you needed was to be pointed in the right direction.

That which you have put into your config files (the lines in hosts and in interfaces) will remain on reboot. The lines setting up iptables will need to be established as a script to run on startup.

Does Debian use the /etc/rc.d/init.d setup to start services and features? If so, does it have an rc5.d directory?

If so, then you would create a script, maybe called IPShare, and place this script into the rc.d directory. Then you would make a link in the rc5.d directory to link to the script. You might also want to do this in the rc3.d directory. The exact prefix you place on that link would dictate where in the startup sequence it was invoked since they are invoked alphabetically; you want to invoke it after the network is running.

If Debian uses some other scheme, make your script work within that scheme.

Oh, with respect to file sharing, you need to set up either NFS or Samba. If/since both boxes are Linux, you can use NFS which is native Unix Network File System. If you wish to share with a Windows box you need to set up SAMBA. You could use SAMBA for Linux to Linux as well; actually this is what I do because I have a heterogeneous Windows/Linux LAN.

Since you have the basics working, you might want to investigate Webmin www.webmin.com because it makes the setup pretty nice.

Last edited by jiml8; 02-19-2005 at 11:49 AM.
 
Old 02-19-2005, 11:47 AM   #15
WolfCub
Member
 
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175

Original Poster
Rep: Reputation: 30
OK, here's what I did, I ran:

echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

and I added:

gateway 192.168.0.1

to my laptop's /etc/network/interfaces file. Then on the desktop I created a shell script called firewall and put it in /root/.kde/Autostart. The shell script contains:

!/bin/sh
echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE


and then I rebooted both computers. Now the laptop's internet laggs like crazy and eventually times out, since the reboot. What am I doing wrong? I've been fighting with this so long and had it working and now it doesn't. I feel like I could cry lol.


The laptop also says ppp_on_boot is depreciated upon boot up now, and that I should use /etc/network/interfaces or something like that. What should I do?


I also ran iptables -L and got:

debian:~# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination
TCPMSS tcp -- anywhere anywhere tcp flags:SYN,RST/SYN tcpmss match 1400:1536 TCPMSS clamp to PMTU

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
debian:~#

Last edited by WolfCub; 02-19-2005 at 12:07 PM.
 
  


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
Getting Internet via Crossover Cable Sleepy_Sentry Linux - Networking 6 08-12-2005 11:36 AM
crossover ethernet cable business ygfperson Linux - Networking 5 07-23-2004 05:07 PM
Crossover cable eggoz Linux - Networking 4 03-14-2004 12:49 PM
network with crossover cable burkie Linux - Newbie 4 01-13-2004 09:29 PM
Network using crossover cable Great Mister Linux - Newbie 7 12-16-2003 07:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:11 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