I have a Desktop-PC with 2 NIC's
How can I configure it to be able to get on the internet with my laptop (or other pc) (Internetsharing)?
We will show a minimal and simple solution:
- Open a terminal and change to root with "sux" to be able to conduct the following steps.
- Configure the first nic with # netcardconfig to be able to access the internet.
- For the second nic we choose a fixed IP-Address in a private domain, e.g. 192.168.1.1.
Then also configure it with # netcardconfig
Please note: Your IP must be in the same subnet as the IP's that will be assigned by DHCP.
If by mistake a Gateway has been specified while configuring your network-interfaces,you will have to run the script # remove-gateway.
- Setting up DHCP/DNS
You have to edit the file /etc/dnsmasq.conf by adding a line with "dhcp-range=192.168.1.50,192.168.1.150". Leave the rest of the file as is.
- The DHCP-Server on the Desktop-PC can now be started with # /etc/init.d/dnsmasq.
If the clients are now set to DHCP, an IP-Address will be assigned automatically.
- To route the client's request to the Internet you must now run the script# /usr/sbin/masquerade. After this every client should be able to join the internet.
- To have this configuration by default when booting up the Desktop-PC: Activate dnsmasq in the boot-process with
# update-rc.d dnsmasq defaults
- Run the masquerade-script with # echo "/usr/sbin/masquerade" >> /etc/init.d/bootmisc.sh