Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
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.
Can you ping the default gateway?
Can you run nslookup successfully?
Are you running DHCP? If so, have you checked that your box is handing out the proper DNS, default gateway, and the right range of addresses?
If nslookup doesn't work, can you ping a website by the IP address?
I don't know anything about iptables so I can't help you there.
What does a traceroute tell you going to a website from one of your XP boxes?
I think it's one or more of three problems:
-incorrect setting for addressing (default gateway, DNS, etc)
-connection is not actually being shared at all
-iptables is not letting the XP boxes send traffic.
OK, I'm back, a little late huh , but I was a out last night and u know, found some friends and then..............
Anyway, back to your problem.... the link to the thread bax posted is really really good bro, try doing that and tell us if you have troubles on the way to.
It sure looks obvious from here but I'm not there Since you have made no mention of setting up your own DNS (BIND) what's the point of using using your default gateway as your DNS (192.168.0.1)? Anyway, keep us posted. I'll just go and pet my perfectly functioning OpenBSD frewall/DHCP/NAT box
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
Look, everything is getting confused. This problem is in bad need of simplification. First off, there is a basic misunderstanding about how networking works.
STEP ONE
On the Linux box, eth0 will get it's IP by DHCP, that is good. eth1 will need an IP supplied by the user. ifconfig eth1 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255
STEP TWO
OK, that is DONE. If you do a netstat -rn you should see a route for 0.0.0.0 (or maybe DEFAULT) which points to your external IP on eth0--DO NOT CHANGE THIS. Your default route needs to go to the Internet. When you changed it to 192.168.0.1, you were causing all the traffic from the Linux box to be forwarded to your LAN by default instead of the Internet. Of course that will break your Internet connection!
STEP THREE
On all your Windows boxes, manually assing them (from the first box to the third box) 192.168.0.2, 192.168.0.3, 192.168.0.4. Those are the three IPs, respectively. They should all have a netmask of 255.255.255.0 and a broadcast of 192.168.0.255. The default gateway should be 192.168.0.1--only for the WinXP boxes, not for Linux!
STEP FOUR
Enter the DNS servers from your ISP in the WinXP boxes (don't use 4.2.2.2, that is one of Genuity's servers and it SUCKS--trust me*). Also put your ISPs DNS servers in the /etc/resolv.conf file on Linux. There should be 3 lines:
domain yourISP.com (whatever the domain name of your ISP is)
server 1.2.3.4 (the first DNS server from your ISP)
server 1.2.3.5 (the second DNS server from your ISP)
STEP FIVE
I'm pretty sure you'll need to put the following line in your /etc/network/options file:
ip_forward=yes (might be ipv4_forward=yes, or something similar)
Now you should be able to reach the Internet from your XP boxes. Note: pinging hostnames on your internal network will only work if a) you have each host defined in the /etc/hosts or c:\windows\system32\drivers\etc\hosts file on each computer or b) you were running named on your Linux box and had it configured correctly.
Using hosts files is much more simple. You would need something like this in each system
192.168.0.1 linux-lan
192.168.0.2 winxp-one
192.168.0.3 winxp-two
192.168.0.4 winxp-three
Any machine that had this file would be able to ping the other machines on the network using just the hostname, like $ ping linux-lan
The stuff about smb and nmb is if you want to use the Windows networking with NetBIOS, SMB, etc... It's not necessary just to access the Internet. That's for sharing files and printers with your Windows machines.
Note2: Try simple tests to isolate problems, don't get all convoluted. Simply doing ping 192.168.0.1 would work (assuming the network is setup correctly) even if you didn't have hostnames defined.
*I spent 2 weeks troubleshooting a critical e-mail problem at one of the biggest credit card companies in the world, and it turned out to be they were using Genuity for DNS and Genuity's servers were too swamp to answer. The instant we setup a caching resolver on the company's own network, the e-mail problems miraculously disappeared. That's why I say don't use Genuity. Yes, we tried all three servers (4.2.2.1, 4.2.2.2, 4.2.2.3)--all of them had extremely high query failure rates.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.