LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 11-03-2007, 07:22 AM   #1
hate29
Member
 
Registered: Oct 2005
Location: Finland, Tampere
Distribution: Debian
Posts: 47

Rep: Reputation: 15
Windows to net through linux box


I have 2 computers, one with debian, one with xp. I've managed to get windows to internet through debian box but not anymore. Settings are:
Windows box ip: 192.168.0.2
Debian box ip: 192.168.0.1
I can connect putty to debian but nothing else works. So how do I connect my windows box to net?
 
Old 11-03-2007, 10:38 PM   #2
kd5eax
LQ Newbie
 
Registered: Nov 2006
Posts: 27

Rep: Reputation: 15
Post Having similar problems.

I've came across the same problem. Though i have dug a little deeper.

I can ping from linux to windows just fine aka

ping 192.168.0.137
PING 192.168.0.137 (192.168.0.137) 56(84) bytes of data.
64 bytes from 192.168.0.137: icmp_seq=1 ttl=128 time=0.236 ms
64 bytes from 192.168.0.137: icmp_seq=2 ttl=128 time=0.237 ms
64 bytes from 192.168.0.137: icmp_seq=3 ttl=128 time=0.229 ms
64 bytes from 192.168.0.137: icmp_seq=4 ttl=128 time=0.244 ms

--- 192.168.0.137 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3013ms
rtt min/avg/max/mdev = 0.229/0.236/0.244/0.016 ms

But if i try to ping from the windows box ::192.168.0.137::
to my linux box ::192.168.0.1:: i get nada. Zero. Zilch.
However

i can get Smb4K to connect to the windows machine just fine, and i can browse all the shares on the windows machine just fine with full access(i can write to files, add files, and delete files).

See if your windows box can ping your linux box. And if so, your closer to resolving your problem than i am mine.

also, if you CAN ping your linux box from your windows box, try adding

net.ipv4.ip_forward = 1

to /etc/sysctl.conf

Maby this will help you resolve your problem. .. And if anyone has any suggestions on mine, Thnx in advance!
 
Old 11-03-2007, 10:50 PM   #3
edclancy7715
LQ Newbie
 
Registered: Nov 2007
Location: Murder mitten
Posts: 13

Rep: Reputation: 0
Well, first I would try the easy route.. which is get programs that do all the hard iptables configuring work for you.
-FireStarter is an automatic internet connection sharing application that is very simple to setup and run, just choose your internet-able interface and the interface you wish to setup as a gateway. You may also want a DHCP daemon, as it just makes life easy. To manually configure it do the following:
*if you do get FireStarter, which i would recommend, make SURE you disable the firewall it comes with that is enabled by default, it's useless in your scenario anyways

sysctl -w net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1
iptables -t nat -A POSTROUTING -o XXX -j MASQUERADE
*XXX is the adapter connected to the router/internet ex. eth0,eth1,etc*


Then configure both of them with the same subnet mask (255.255.255.0) but make sure they are on DIFFERENT SUBNETS.

ALL Ethernet adapters (eth0, eth1) must be configured with the routers IP address as the default gateway, if you want lookups to work.

To recap, the router and the pc sharing the internet, need to be on the same subnet and network. (192.168.1.1 & 192.168.1.2)

The ethernet card going to your second machine, needs to be on the same subnet and network as the NIC in the second machine. (192.168.2.1 & 192.168.2.2)

Hopefully that helps.

Last edited by edclancy7715; 11-03-2007 at 11:08 PM.
 
Old 11-04-2007, 05:14 PM   #4
kd5eax
LQ Newbie
 
Registered: Nov 2006
Posts: 27

Rep: Reputation: 15
Ok, i got it.

I don't know about you, But i wasn't able to get firestarter working on my distro, im using a 2.6.x.x kernal, and the last stable firestarter was for like, 2.4.x.x kernals. I did have to install a firewall gui though, because when i installed my os the installer automaticly set up the kernal's built in shorewall, and obviously i had to reconfigure firewall rules for the internal network trying to reach the internet(and im not famillar with iptables enough to do it manually). I personally used GuardDog, and set my net.ipv4.ip_forwarding = 1 on the first line in /etc/sysctl.conf, Set my eth0 to 192.168.0.1 subnet mask 255.255.255.0 and default gateway 192.168.0.1, then i rebooted the machine i opened up guard dog and crated a new "zone" called LAN with the ip range of 192.168.0.0\24 (you can also use 192.168.0.0\255.255.255.0) and enabled all clients from LAN to be able to reach services on the Internet zone. Went to the windows box and set 192.168.0.1 as the default gateway, and presto, Google could be pulled up, and Yahoo Messenger logged right online. Hope this helps you out.
 
Old 11-04-2007, 05:19 PM   #5
kd5eax
LQ Newbie
 
Registered: Nov 2006
Posts: 27

Rep: Reputation: 15
also , if your using dialup as the internet connection and using the martian modem packages, you can
sudo rm /dev/modem
sudo ln -s /dev/ttySM0 /dev/modem

and get a graphical dial up utility like KPPP to work by manually selecting the modem,
and pointing it to /dev/modem (for some reason i coulden't get /dev/ttySM0 to show up *shruggs)

Anyways, Good Luck. And hope I've managed to help you out some!
 
Old 11-05-2007, 03:52 AM   #6
hate29
Member
 
Registered: Oct 2005
Location: Finland, Tampere
Distribution: Debian
Posts: 47

Original Poster
Rep: Reputation: 15
Quote:
sysctl -w net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1
iptables -t nat -A POSTROUTING -o XXX -j MASQUERADE
*XXX is the adapter connected to the router/internet ex. eth0,eth1,etc*
This worked fine with me! Thanks alot!
 
Old 11-05-2007, 09:39 AM   #7
edclancy7715
LQ Newbie
 
Registered: Nov 2007
Location: Murder mitten
Posts: 13

Rep: Reputation: 0
Quote:
Originally Posted by hate29 View Post
This worked fine with me! Thanks alot!
NP glad you got it working
 
Old 11-13-2007, 01:17 PM   #8
hate29
Member
 
Registered: Oct 2005
Location: Finland, Tampere
Distribution: Debian
Posts: 47

Original Poster
Rep: Reputation: 15
What can go wrong?

I've used this all time since my last post everyday my windows box in the net succesfully. But now I rebooted my windows and after that it doesn't get connection to linux box. Only connection timed out when I ping or try to use putty. I've booted my windows many times before and everything has worked perfectly so far. From linux I can ping my windows succesfully though. So what migh be the problem?
 
  


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
Troubleshooting Slow Transfer Speed Between Linux Box and Windows Box timswim78 Linux - General 1 10-23-2005 11:45 AM
Windows XP box losing connection to Linux box after 30 sec. NeoZeus Linux - Networking 3 07-21-2005 12:02 AM
Linux box with eth0 to cable modem and eth1 to Windows box videojeff Linux - Networking 23 03-03-2005 07:58 PM
Linux box calling a batch script on a windows box to run? Is it possible? joelhop Programming 8 05-17-2004 04:49 PM
I am a newbie but my linux box isn't directly on the net Loveless Linux - Security 3 02-16-2002 01:30 PM

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

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