[TriLUG] configuring Linux with my new router

Joseph Tate jtate at dragonstrider.com
Wed Sep 10 15:27:27 EDT 2003


Richard O. Hammer wrote:

> I am stuck on getting my RedHat 7.3 configured with a fixed IP address 
> so that it can connect to the Internet through my new router (a 
> Linksys Cable/DSL Router with 4-port switch).
>
> Here is the /etc/sysconfig/network-scripts/ifcfg-eth0 which I am 
> attempting to use:
>
> DEVICE=eth0
> BOOTPROTO=static
> BROADCAST=192.168.1.255
> IPADDR=192.168.1.3
> NETMASK=255.255.255.0
> NETWORK=192.168.1.0
>
> When I use the above ifcfg-eth0 file I am able to reach my Windows 
> machine at 192.168.1.2 (it is also plugged into the router) and I can 
> ping the router at 192.168.1.1.  But an attempt to ping an outside IP 
> address gets me this error:
>
> connect: Network is unreachable
>
> Each time I change ifcfg-eth0 to try some new idea, I run
> /etc/rc.d/init.d/network restart
> to commit the changes.
>
> So what am I doing wrong here?
>
> Is there documentation somewhere on the language used in ifcfg-eth0? 
> on what the options there are, and what they mean?
>
> For what it is worth, I can get it working if I use dhcp, with the 
> following as my ifcfg-eth0:
>
> DEVICE=eth0
> BOOTPROTO=dhcp
> ONBOOT=yes
>
> If I use that then the router gives my Linux box an IP address and I 
> can get out to the Internet.  However I do not want to work this way 
> if I can avoid it because I believe having a preassigned local IP 
> address will make it easier for me to configure packet forwarding from 
> the router.
>
> Also, for what it is worth, I have been able to set up my Windows 
> machine with a static IP address working through this router.  So it 
> looks to me like it should be possible.
>
> Thank you,
>
> Rich Hammer
> Hillsborough
>
Send the output of the route command as well as what's contained in 
/etc/sysconfig/network and /etc/resolve.conf

Basically what you need is the Gateway set.  To do this add 
GATEWAY=192.168.1.1 and GATEWAYDEV=eth0 to /etc/sysconfig/network and 
restart the network.  Make sure you have a dns server or two in 
resolve.conf. 

Joseph




More information about the TriLUG mailing list