Академический Документы
Профессиональный Документы
Культура Документы
on Linux
Edmund Ochieng’
April 7, 2010
Abstract
With only one IP address from your Internet Service Provider(ISP)
and multiple PCs, it may appear impossible to share Internet; a router
may become handy in mapping the public address to multiple internal
addresses to be used by the multiple PCs. Routers generrally aren’t cheap
and are often purchased by big and have the financial muscle. However,
this guide should help a home user or small businesses turn a Linux box
into an affordable router.
1
1 Introduction
There exist several guides on the internet that guide users how to share internet
however, many of them make it look like rocket science even to everyday Linux
users. This document will attempt to make this process as easy as it can be.
If its still difficult to understand let me know. Perhaps, I will be able to do
something about it. Hope you enjoy the guide.
Each network should have two additional addresses for the network address
and broadcast address. Thus we shall add 2 to 5 to make 7 hosts.
7 ≤ 23 ⇒ 7 ≤ 8
8 − 7 = 1 extra IP address
This implies the netmask shall be, 255.255.255.240. Taking the first subnet,
our network address shall be, 192.168.1.0 and netmask 255.255.255.240.
Here is how we obtain 240 in our last octet And since, x = 4 the last octect
of our netmask becomes 240.
2
bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 bit 8
128 192 224 240 248 252 invalid invalid
The details of subnetting are beyond the scope of this document. However,
for further reading you may visit the Subnetting tutorial [3] in the references
section.
3
# we want the nameserver to appear at a fixed address
host ns {
next-server desert.sandstorm.org;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 207.175.42.254;
}
}
Finally, restart the network service to activate the new configuration. This
step is applicable for both the solutions above.
[stuart@desert ~]$ /sbin/service network restart
4
3. Save configuration and restart the firewall
5
References
[1] Anonymous, 2ND February 2008, ”CentOS / RedHat Linux Internet
Connection sharing.“
http://www.cyberciti.biz/faq/rhel-fedora-linux-internet-connection-sharing-howto/
Accessed Wednesday, April 07 2010 19:47:13 hours.
[2] Phd, 16TH January 2008, ”How to Masquerade on Linux(Internet connec-
tion sharing).”
http://www.howtoforge.com/internet-connection-sharing-masquerading-on-linux
Accessed Wednesday, April 07 2010 20:04:21 hours.
[3] Becker, Ralph, 25TH January 2007, ”IP Subnetting Tutorial.“
http://www.ralphb.net/IPSubnet/
Accessed Wednesday, April 07 2010 21:25:45 hours.
[4] Ochieng, Edmund, 3RD March 2010, ”Linux DHCP Server configuration.”
http://www.scribd.com/full/27775817?access key=key-303haxdvitgb29x4ohs
Accessed Wednesday, April 07 2010 21:49:54 hours.