Windows XP Internet Connection Sharing with Linux

On the XP box, you need to enable Internet Connection Sharing. This should be in your network connections, and probably in the properties of your Dial Up connection. Once this is done, then you need to make sure that both computers have network cards installed and working. After enabling ICS, it should set your Network card to a static IP address of 192.168.0.1 . This is a private IP (doesn't get routed over the internet) and is used for internal networks.

The next step is to configure your linux box. You need to have router or a share hub, but if you only have 2 computers and wanted to connect them up and share the internet connection, you need to use the twisted/cross cable to connect them up. Then configure the network information as follows:

IP Address: 192.168.0.x (where x is any number between 2 and 254)
Subnet Mask: 255.255.255.0
Gateway: 192.168.0.1

The gateway is very important as it tells the linux how to find the route through to the internet.

In your linux shell prompt type the below:

#ifconfig eth0 192.168.0.2 netmask 255.255.255.0
#route add -net default gw 192.168.0.1

To make sure that the two machines are networked, you can go to a command line and type 'ping 192.168.0.1' and press enter. Press CTRL+C to cancel the ping command.

However you still won't be able to type an address into your browser and have it find the internet. You need to go to your ISP's homepage or contact their support to find their DNS settings. You will need to enter the two (Primary and Secondary DNS) in your linux box (/etc/resolv.conf on redhat). Now your linux machine should be able to:

1. find the route to the internet and
2. resolve names to IP addresses in order to search the internet.

On the other hand, if you are currently on cable/dsl and still want to go through the linux box, you can still do the same thing. However, you have to have two network cards in your XP box and one in your linux box. Configure the first card for your cable/dsl connection, then share the connection. The second card should be assigned IP 192.168.0.1 .

If you are using ZoneAlarm, ICS is not supported in the free version. The way around it is to set the internet and trusted zone to medium.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

It worked for me. Thank you

It worked for me. Thank you very much and keep it up.

internet sharing

thanks for the help.
finally got it working!

share network

good tutorial, very help full.

thanks

Permanently add static IP and default gateway

Red Hat Linux has made it fairly easy to set up network so that it will start automatically. There are a series of scripts in /etc/sysconfig/network-scripts that will do most of the work.

1. Binding IP address

In "/etc/sysconfig/network-scripts/ifcfg-eth0", add your IPADDR (IP address), NETMASK, NETWORK and BROADCAST address

 
DEVICE=eth0
ONBOOT=yes
IPADDR=192.168.0.x
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255

2. Adding Default Gateway

In "/etc/sysconfig/network" add your default gateway.

GATEWAY=192.168.0.1

You can now restart your network:

#/etc/sysconfig/network-scripts/ifdown eth0
#/etc/sysconfig/network-scripts/ifup eth0

or in redhat:

#service network restart 

Check your "/sbin/route" (routing) to verify everything is in place and restarting your computer should hold your new settings.

Comment