configuring RH 7 for a subnet mask of 255.255.255.224
Hi, all. I was finally able to configure my computer running Red Hat 7.0 (2.2.16-22) to access the Internet. I am on a small library LAN with a subnet mask of 255.255.255.0 and with static IP addresses of .0 to .255. I had trouble getting eth0 to initialize until I put the following at the end of /etc/rc.d/rc.local:
insmod tulip
ifconfig eth0 xxx.xxx.xxx.xxx.up
route add default gw xxx.xxx.xxx.254
ifconfig eth0 netmask 255.255.255.0
My nameservers are both listed in /etc/resolv.conf
Then everything works fine. I am online and have even been able to set up a practice web server using Apache 1.3.12.
Here is my problem. I want to reconfigure the same machine to work in another nearby library that has a LAN with a subnet mask of 255.255.255.224. Its IP range is .96 to .127.
I assume the xxx.xxx.xxx.96 would be the network address that I enter in Network Configurator (although I did not have to indicate a network address in my other LAN, probably because it was xxx.xxx.xxx.0, right?). My router/gateway is xxx.xxx.xxx.126.
So should I be able to indicate this in /etc/rc.d/rc.local sort of like I did for the other LAN? (The DNS IPs don't change, so that is already taken care of.)
insmod tulip
ifconfig eth0 xxx.xxx.xxx.xxx up
ifconfig eth0 netmask 255.255.255.224
route add default gw xxx.xxx.xxx.126
route add –net xxx.xxx.xxx.96
I assume I need to add this last line to indicate where my network starts. But so far, I can't get to the network when I try this. The NIC is up and running. When I do ifconfig, here is the output:
eth0 Link encap:Ethernet Hwaddr 00:00:F8:08:3D:0F
inet addr: xxx.xxx.xxx.xxx Bcast: xxx.xxx.255.255 Mask: 255.255.255.224
UP BROADCAST RUNNING MULTICAST 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
Interrupt:9 Base address:0xec00
My static IP is fine, my netmask is fine, but the broadcast is odd. Shouldn't it be: xxx.xxx.xxx.127 (one number above the gateway?) Maybe my inexpert hacking of /etc/rc.d/rc.local is the problem?
I have had no trouble configuring Windows 98 and NT computers for this subnet mask, but I really want to get a Linux box in this library and start replacing some Windows machines. Any advice would be welcome! Thanks to anyone in advance.
|