#!/bin/sh #Written by Fandelem. #email: kyle.m.davis@santafe.cc.fl.us #device is either eth0, eth1, ppp, etc.. DEVICE=eth0 #input IP address of the machine you are running script on. #Must be different for each computer! IPADDR=192.168.1.2 #netmask is always 255.255.255.0 for class C addresses #255.255.0.0 for class B addresses #255.0.0.0 for class A addresses #You probably have or want a class C netmask (subnet) address NETMASK=255.255.255.0 #gateway is the IP address of the computer that dials to the ISP! #Or in other words - Your "Server" or computer with the internet #connection. #Note: If you are doing this on your server, then just comment #the gateway section out! It will (or should) be set when you #connect to the internet! GATEWAY=192.168.1.1 #don't worry about this section unless you really know what you're #doing - this tells your computer what network you're on. NETWORK=192.168.1.0 #this is the part where your ethernet card actually gets #configured. ifconfig $DEVICE $IPADDR netmask $NETMASK up ########################################################### #time to add a route to tell this computer what the general #network is! # route add -net $NETWORK netmask $NETMASK $DEVICE ########################################################### ########################################################### # Uncomment next section if you are not primary (server) # computer # (this is one of the steps needed to gain internet access) # (refer back to # http://www.fortunecity.com/skyscraper/tone/1317/linux/linux5-3.html # for the other necessary steps.) # #route add default gw $GATEWAY ###########################################################