I have two computers installed with Debian Sarge. The first computer has two ethernet ports and one of the port is connected to an ADSL modem. The other ethernet port of the first computer is connected to the second computer via a crossover ethernet cable. The first computer can have access to the internet but not the second computer.
In Debian Sarge, how should I set both computer up so that the second computer can share the internet access as well as the printer service of the first computer? (the first computer is connected to a printer via the USB port, has both CUPS server and client installed and can print successfully)
Thanks!
Tony
Can you ping the 1st computer
Can you ping the 1st computer from 2nd computer?
Have you setup the gateway of the 2nd computer?
Now I have everything sought
Now I have everything sought out. I installed the ipmasq (for ip masquading), assigned the IP address of 192.168.0.1 and netmask of 255.255.255.0 and Broadcast address of 192.168.0.255 to the internal NIC (the ethernet port connecting to the second computer) of the first computer, then I assigned the IP address of 192.168.0.2, netmask 255.255.255.0 and gateway 192.168.0.1 to the second computer. Then both the first and second computer received the internet and I could ping the first computer from the second computeer and vice versa.
For the CUPS, I have installed CUPS client and server to both computer, then I changed the /etc/cups/cupsd.conf of the first computer so that it broadcasts its service to other local computers and allows access of its printer from other computers, then the second printer could also print from the first computer's printer.
Internet sharing
I'm not using Debian but Fedora. I also doing similar connection.
In 1st PC(etho-ISP, eth1-192.168.0.1): setup NAT (iptables) & DHCP
echo "1" > /proc/sys/net/ipv4/ip_forward
modprobe ip_tables
modprobe ip_nat_ftp
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ip_conntrack_irc
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j MASQUERADE
Then 2nd PC plug-in, will get ip & shareing (w/o DHCP, u have to assign ip + dns to 2nd PC network.
Hope helpful to u.
Samuel Chan