How can i share my Internet connection?

Hi
I’ve a home network with 2 PCs, the 1st using openSUSE 11.0, the second using both fedora 9 in side with WinXP

My modem is always connected to the 1st PC with openSUSE via usb (not via Ethernet), And it’s configured for PPPoE using a bridge mode. My modem is Sagem Fast 800 by the way

Any one can help me setting my openSUSE to share the Internet with fedora &/or WinXP? both are configured & ready, They just waiting the share from openSUSE.

Thanks in advance :slight_smile:

Hi bob-work. You probably need what windows users call ICS (internet connection sharing).

Microsoft calls the underlying process Network Address Translation. Its real name is IP masquerading.

Here’s a tutorial for IP masquerading in Linux: openSUSE ICS: Internet Connection Sharing (Linux IP Masquerading) with Suse or Windows Servers

Thank you for your reply, I already applied the steps except one which i encounter my problem, I took the help from openSUSE in this link: ICS - openSUSE
In the “External & Internal Interface” step, I just find my ethernet device (eth0) which i made it as Internal Zone.
But there is no External “my sagem device” as you can see

http://img90.imageshack.us/img90/6263/firewallconfigurationinwr3.png

I’m nearly sure this problem because I didn’t configure my external connection via Yast -> Network Devices -> DSL
it doesn’t work, it does working before when my protocol was pppoa, but now it’s pppoe, so i configure my connection manually

Hello!
Try to do it manually by

/usr/sbin/iptables -P FORWARD ACCEPT
/usr/sbin/iptables -t nat -A POSTROUTING -s <localnetworkaddress>/<netmask> -o <outinterface> -j MASQUERADE

Workstations should have IP address of this machine set as a gateway. Make shure that other iptables rules do not block the traffic.

OK, Let me see if i understood or else tell me what’s wrong! In the second command line, I’ll make it as this one

[left]

/usr/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.1/255.255.255.0 -o ppp0 -j MASQUERADE

[/left]

My eth0 card is configured as follow:
IP Address: 192.168.0.1
Net Mask: 255.255.255.0

And I think the <outinterface> is my external zone which i’m connected to Internet as you mean, don’t you? if this is the case, so my External zone will be ppp0.

And my 2nd PC is configured as follow:
IP Address: 192.168.0.2
Net Mask: 255.255.255.0
DNS Server: 192.168.0.1
Default Gateway: 192.168.0.1

Is all these configurations are well?

Hi again!

/usr/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.1/255.255.255.0 -o ppp0 -j MASQUERADE

Here as <localnetworkaddress> you entered host address, not network. If you want to masq only one host, not all network, according to you configuration you should enter IP of the 2nd PC, not the gateway. So for network it should be:

192.168.0.0/24

for one host:

192.168.0.2/24

That’s well, I’ve just 1 host, so i won’t need to type this at all
[left]

192.168.0.0/24

[/left]
the host’s IP (2nd PC) is 192.168.0.2, so the right command should be
[left]

/usr/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.2/255.255.255.0 -o ppp0 -j MASQUERADE

[/left]
I think that’s it