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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
02-18-2005, 05:11 PM
|
#1
|
Member
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175
Rep:
|
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?
|
|
|
02-18-2005, 06:24 PM
|
#2
|
Senior Member
Registered: Sep 2003
Posts: 3,171
Rep: 
|
are you running a dhcp server on the desktop? If not, what do you have in your hosts file for both computers?
|
|
|
02-18-2005, 06:37 PM
|
#3
|
Member
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175
Original Poster
Rep:
|
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 
|
|
|
02-18-2005, 06:45 PM
|
#4
|
Senior Member
Registered: Sep 2003
Posts: 3,171
Rep: 
|
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
|
|
|
02-18-2005, 09:11 PM
|
#5
|
Member
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175
Original Poster
Rep:
|
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!
|
|
|
02-19-2005, 08:04 AM
|
#6
|
Member
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175
Original Poster
Rep:
|
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?
|
|
|
02-19-2005, 08:22 AM
|
#7
|
Senior Member
Registered: Sep 2003
Posts: 3,171
Rep: 
|
You can use iptables to set up connection sharing or (and this is my preferred solution) use squid, which is a caching proxy server.
|
|
|
02-19-2005, 08:31 AM
|
#8
|
Member
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175
Original Poster
Rep:
|
OK, how would I do it with iptables? I already have it installed on both...
|
|
|
02-19-2005, 09:57 AM
|
#9
|
Senior Member
Registered: Sep 2003
Posts: 3,171
Rep: 
|
http://www.useraddit.com/nat.html
Google is your friend, or would be if it wasn't spying on you.
|
|
|
02-19-2005, 10:55 AM
|
#10
|
Member
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175
Original Poster
Rep:
|
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.
|
|
|
02-19-2005, 11:15 AM
|
#11
|
Member
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175
Original Poster
Rep:
|
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.
|
|
|
02-19-2005, 11:26 AM
|
#12
|
Member
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175
Original Poster
Rep:
|
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?
|
|
|
02-19-2005, 11:35 AM
|
#13
|
LQ Newbie
Registered: Feb 2005
Location: Örebro, Sweden
Distribution: Debian unstable
Posts: 6
Rep:
|
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
|
|
|
02-19-2005, 11:36 AM
|
#14
|
Senior Member
Registered: Sep 2003
Posts: 3,171
Rep: 
|
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.
|
|
|
02-19-2005, 11:47 AM
|
#15
|
Member
Registered: Nov 2003
Location: Canada
Distribution: Debian
Posts: 175
Original Poster
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 12:11 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|