LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-22-2004, 05:12 PM   #1
Zaius
Member
 
Registered: Jan 2004
Location: Canada
Posts: 68

Rep: Reputation: 15
ipforwarding no work, but samba does


hey,

i'm not sure what i've done wrong, but samba is running just fine, both computers (Linux and WinXP can see each other over the network), but for some reason the ipforwarding isn't working. i think it may have something to do with my ip settings on WinXP.

winXP:
ip address: 192.168.0.2
subnet: 255.255.255.0
default gateway: 192.168.2.1
dns server: 192.168.0.1

i'm not sure what the dns server should be.. but i also have 192.168.2.1 as an alternative

linux:
eth0: internet connection dynamically assigned by a router

eth1 ip: 192.168.0.1
subnet: 255.255.255.0
default gateway: 192.168.2.1

this is what i'm using for now as a ipforwarding iptable:

# Net Sharing
modprobe iptable_nat
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -A INPUT -i lo -j ACCEPT
#/sbin/iptables -A INPUT -j LOG --log-level 4 --log-prefix "ATTACK"
#/sbin/iptables -A INPUT -j DROP
# Add your additional rules here
/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE

from www.linuxathome.net

i'm not sure what's wrong.. possbily that DNS on winXP, but aside from that /shrug.
 
Old 02-22-2004, 05:26 PM   #2
redcane
Member
 
Registered: Aug 2003
Posts: 31

Rep: Reputation: 15
Set the winxp box to use the linux box as it's gateway. The linux box will get the packets and forward them to it's gateway (the DSL router).... the xp box probably can't find the router on it's network segment since it's on a physically seperate segment...
 
Old 02-22-2004, 05:27 PM   #3
redcane
Member
 
Registered: Aug 2003
Posts: 31

Rep: Reputation: 15
thought of another thing. Most likely both the router and your linux box are trying to use an ip of 192.168.0.1.... You might need to check what the router is using, or use it in bridge mode.
 
Old 02-22-2004, 06:22 PM   #4
Zaius
Member
 
Registered: Jan 2004
Location: Canada
Posts: 68

Original Poster
Rep: Reputation: 15
wow.. i was so rather convinced that the gateway was 192.168.2.1, but changing it to linux's ip made everythign work ..

awesome (Y)
 
Old 02-22-2004, 06:39 PM   #5
redcane
Member
 
Registered: Aug 2003
Posts: 31

Rep: Reputation: 15
excellent.
I think you might have missed the finer detail of the network topology. You effectively have two seperate networks, one is between the Linux box and the DSL, and the other is between the Linux and XP machine. Your XP machine needs a gateway to get off the PC network, and onto the Linux<->DSL network. The linux machine is that gateway :-)
 
  


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
a good ipforwarding guide Zaius Linux - Newbie 1 01-11-2004 06:40 PM
ipforwarding ??? adavila Linux - Networking 1 10-22-2003 08:59 PM
Dual NIC's ipforwarding? TheRealDeal Linux - Networking 2 09-26-2003 01:10 AM
setting up ipforwarding anwar_lpk Linux - Networking 2 05-09-2003 12:05 AM
ipchains ipforwarding in RetHat 7.1 SprinterPD Linux - General 3 09-24-2001 03:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:25 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration