Depends on what box is connected to the internet:
If the XP box has the modem, the got to Start-> Controll Panel-> Network Connections (in classic view).
Find your internet connection, right click on it, select "Properties" and then under the "Advanced" tab select "Allow other network users to connect through this computer's internet connection" and "Ok".
Now if you go to your network connection, and check the IP (Right click-> Properties-> (Internet Protocol)TCP/IP) you'll see it is set to 192.168.0.1 Subnet: 255.255.255.0
Now the sharing bit is done.
Go to the linux box and change the Linux box IP to: 192.168.0.2 Subnet: 255.255.255.0 and (verry important) Gateway: 192.168.0.1 (the IP of the XP box).
Open a console, su to root, the do the following:
1.
modprobe networkcard (eg: modprobe 3c509)
2.
ifconfig eth0 192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0
(always note that which ever computer has the modem gets the 192.168.0.1 ip)
3.
route add -net default gw 192.168.0.1 netmask 0.0.0.0 metric 1
(this replaces the iptables)
Put this in ur /etc/rc.d/rc.local so it loads at boot, and your network is complete so you can now have great internet sharing with your linux computer.
Do the same in reverse if your linux box has the modem like:
Linux first, su into root, and then;
1.
modprobe networkcard (eg: modprobe 3c509)
2.
ifconfig $IFACE $IPNUM broadcast $BCAST netmask $NMASK
(example for mine: ifconfig eth0 192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0)
3.
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -d 0/0 -j MASQUERADE
(have iptables installed, and use that exact line, you don't have to change anything on it)
(HINT: put the modprobe, the ifconfig and the iptables in one of ur rcscripts so it loads at boot), if u have /etc/rc.d/rc.local put them in there like this...
#----------------------------------------------------------------------------------
modprobe 3c509
ifconfig eth0 192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -d 0/0 -j MASQUERADE
#----------------------------------------------------------------------------------
Now to the Xp box and only change it's IP to 192.168.0.2 SubnetMask 255.255.255.0 and (verry important) Default Gateway: 192.168.0.1 and also Prefered DNS server: 192.168.0.1
That last bit may seem strange, but it makes one's live really easier, just try it!