|
[root@localhost root]# ifconfig eth0      Link encap:Ethernet   HWaddr 00:48:54:54:FF:9C              inet addr:10.0.0.2 Bcast:10.0.0.255 Mask:255.255.0.0              UP BROADCAST NOTRAILERS RUNNING MTU:1500 Metric:1              RX packets:547245 errors:0 dropped:0 overruns:0 frame:0              TX packets:928805 errors:0 dropped:0 overruns:0 carrier:0              collisions:0 txqueuelen:100              RX bytes:130382433 (124.3 Mb) TX bytes:743890952 (709.4 Mb)              Interrupt:10 Base address:0xf00 eth1      Link encap:Ethernet   HWaddr 00:4F:D4:54:3F:DC              inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.0.0              UP BROADCAST NOTRAILERS RUNNING MTU:1500 Metric:1              RX packets:0 errors:0 dropped:0 overruns:0 frame:0              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0              collisions:0 txqueuelen:100              RX bytes:0 (0.0 Mb) TX bytes:0 (0.0 Mb)              Interrupt:9 Base address:0xFFF lo           Link encap:Local Loopback              inet addr:127.0.0.1 Mask:255.0.0.0              UP LOOPBACK RUNNING MTU:16436 Metric:1              RX packets:0 errors:0 dropped:0 overruns:0 frame:0              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0              collisions:0 txqueuelen:0              RX bytes:0 (0.0 Mb) TX bytes:0 (0.0 Mb) |
|
# Disables packet forwarding net.ipv4.ip_forward = 0 # Enables source route verification net.ipv4.conf.default.rp_filter = 1 # Disables the magic-sysrq key kernel.sysrq = 0 |
| When you select an IP address range you need to know a little bit about them. IP addressess are four blocks of numbers between 0 and 256 seperated by dots. Every machine that is on the Internet has an IP address like 208.151.122.54 or 1.2.3.4 This is kinda like the computer's phone number. No two computers can have the same IP address anywhere on the same network. Because of the iminent danger of this fact, along with the popularity of the internet there were three special IP address ranges that were set aside for "private" use. Hence they're called
"private networks". Of these private networks, the two most common are 10.x.x.x and 192.168.x.x where the "x" is a number between 0 and 255. There is no diffrence between the use of either of these ranges except for the amount of IP addressess they offer. 192.168.X.X = 255 sets of 255 IP addressess = approx. 65025 IP addressess 10.X.X.X = 255 sets of 255 sets of IP addressess = approx 4,228,250,625 IP addressess If you manage to use all the IP addressess in the 10.x.x.x subnet, please let me know! :) When you begin to set up your network, you will need to select a range of IP addressess to use, something between 10.0.0.X - 10.254.254.X or 192.168.0.X or 192.168.254.X A selection splitting two subnets together is not allowed and can be a routing hell. e.g. you can't use 192.168.0.50-192.168.1.50 however 192.168.0.0-192.168.0.255 is fine. Within that range from 192.168.0.0-192.168.0.255 there are three addressess that are reserved and cannot be used. These are: 192.168.0.0 This is the broadcast for the network. 192.168.0.255 This is also the broadcast for the network. The rest of the addressess are free to use. For the sake of this document, I will be using the 192.168.0.X IP address range reserving .1 for the router itself. |
|
DEVICE="eth1" BOOTPROTO="static" ONBOOT="yes" IPADDR="192.168.0.1" |
|
eth1      Link encap:Ethernet   HWaddr 00:4F:D4:54:3F:DC              inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.0.0              UP BROADCAST NOTRAILERS RUNNING MTU:1500 Metric:1              RX packets:0 errors:0 dropped:0 overruns:0 frame:0              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0              collisions:0 txqueuelen:100              RX bytes:0 (0.0 Mb) TX bytes:0 (0.0 Mb)              Interrupt:9 Base address:0xFFF |
|
subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.2 192.168.0.253; default-lease-time 86400; max-lease-time 86400; option routers 192.168.0.1; option ip-forwarding off; option broadcast-address 192.168.0.255; option subnet-mask 255.255.0.0; option domain-name-servers 24.28.131.62, 24.28.131.63; }; |
|
start() {          # Start daemons.          echo -n $"Starting "prog: "          daemon /usr/sbin/dhcpd eth1 ${DHCPDARGS}          RETVAL=$?          echo |
|
[root@localhost /etc]# dhcpd eth1
Internet Software Consortium DHCP Server 2.0pl5 Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved. Please contribute if you find this software useful. For info, please visit http://www.isc.org/dhcp-contrib.html Listening on Socket/eth1/192.168.0.0 Sending on Socket/eth1/192.168.0.0 |
|
Internet Software Consortium DHCP Server 2.0pl5 Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved. Please contribute if you find this software useful. For info, please visit http://www.isc.org/dhcp-contrib.html Can't open lease database /var/lib/dhcp/dhcpd.leases: No such file or directory -- check for failed database rewrite attempt! Please read the dhcpd.leases manual page if you. don't know what to do about this. exiting |
|
May 9 11:44:17 localhost dhcpd: DHCPDISCOVER from 00:80:64:09:32:97 via eth1 May 9 11:44:17 localhost dhcpd: DHCPOFFER on 192.168.0.2 to 00:80:64:09:32:97 via eth1 May 9 11:44:17 localhost dhcpd: DHCPREQUEST for 192.168.0.2 from 00:80:64:09:32:97 via eth1 May 9 11:44:17 ns dhcpd: DHCPACK on 192.168.0.2 to 00:80:64:09:32:97 via eth1 |