SDB:Internet connection sharing

Jump to: navigation, search

If you have multiple computers and only one internet connection, and you don’t want to buy a dedicated router you can easily set up your SUSE box to share the internet connection with your other computers.

Prologue

This guide assumes you have already set up your network cards with ip addresses, if you have not do this first in the YaST -> Network Devices -> Network Settings - > network card module, a good static IP for your internal NIC would be 192.168.0.254

IP forwarding

You will not be able to perform this step if you are using Network Manager and not Ifup.

Open YaST -> System -> Network Settings -> Routing and check the box marked Enable IP Forwarding

Click Finish

Select the external and internal interfaces

Open YaST - > Security & Users - > Firewall

In the Interfaces section:

Select the network card that you connect to the internet through, click change and set it to External Zone

Select the network card that is connected to the other machine(s) on your internal network that you want to share the internet to and set it to Internal Zone

Enable masquerading

Still in the Firewall YaST Module locate the Masquerading section.

Check the box labelled Masquerade Networks

Click Next and Finish

Masquerading.png

Configuring your other machines

Manually

Your SUSE Linux machine is now set up to share the internet connection with the internal network. In order to get your other machines on the network to use this connection you will need to set their Default Gateway to the internal IP address of your SUSE box which is doing the connection sharing. Give the other machine an IP different from any other machine on your network and set their DNS Server to the IP of your router or modem. A quick google should tell you how to do this for whatever OS these machines are running.

Automatically

If you want your internal machines to automatically get this connection information and also obtain an IP address automatically, you will need to run a DHCP server on your SUSE box.

To do this open YaST - > Network Services - > DHCP server

Should this YaST module not be present, you might want to install yast2-dhcp-server package from YaST -> Software Management or from command line through zypper in.
  • Set the active interface to your internal network card
  • Choose an internal domain name
  • Fill in the name server IPs with the values you can find by running cat /etc/resolv.conf
  • Set the Default Gateway to the IP address of your SUSE box on the internal network

Dhcpserver.png


See also

External links