Accessing a gateway

I am using redhat linux 5.2 as a web server using the version of apache the comes with it.  The server works fine on our network and can be accessed with no problems, subnetting, dns,etc. is fine., but I have been given the ip address of our gateway to the internet (standard ip format) how do I configure the server to use it?

A good clear set of instructions will result in the points being raised by another 30 points.  Many Thanks
LVL 1
Steves2001Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
dagmaticConnect With a Mentor Commented:
All right thank you very much, glad to see you going.
Make sure you boot this machine soon ; to ensure that it will work correctly without command line intervention, and while all of this is fresh in your mind.
0
 
stefanxCommented:
I don't know for redhat, but under slackware you simply just add the default gateway in /etc/rc.d/rc.inet1 as follows:

route -add default gw xxx.xxx.xxx.xxx

I don't have a linux box here at home, so just check the exact syntax of that route command by checking the man page i.e man route

Also, remember that the default gateway is a networking issue - it has very little to do with your webserver
0
 
Steves2001Author Commented:
Sorry there is no file called rc.inet1 in the rc.d directory and yes I am aware using a gateway is networking problem thats why I have put it in linux networking section (sorry, that sounded sarcastic)
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
stefanxCommented:
Try finding the location of the route commands in your /etc/rc.d directory by saying

grep route /etc/rc.d/*


0
 
joolsCommented:
Try this....

o  cd into the sysconfig area.
cd /etc/sysconfig

edit the static routes file using the format below;
vi static-routes

eth0 net x.x.x.x netmask x.x.x.x gw x.x.x.x

Note: x.x.x.x denotes ip address for network and gateway but these can normally be specified as hostnames if dns or /etc/hosts OK.

If you want more information, please post the ip configuration to be added.

J
0
 
Steves2001Author Commented:
I have made the changes you suggested in the static-routes file and restarted the server.  The line when used reported that the format was incorrect for the route command.  The line below shows the information added

194.83.167.5 is the server IP
255.255.255.192 is our networks sub net mask
194.83.167.2 is the gateway IP

eth0 net 194.83.167.5 netmask 255.255.255.192 gw 194.83.167.2

I went home and tried to access the server using it's IP address with no success (novell netware was so easy compared to this)
0
 
joolsCommented:
I think I forgot the metric value, try this in static-routes (I'll check and post again if this is crap);

eth0 net 194.83.167.5 netmask 255.255.255.192 gw 194.83.167.2 1

If that doesn't work, can you give ifconfig -a information?

Any other networking (unix or windoze) is easier than this :)

0
 
joolsCommented:
Sorry Steves2001, forget the metric, according to the notes I have it's not reqd in static-routes.

Please post you ifconfig -a output and give a fuller description of the error you are getting on startup.

If you could also list netstat -r output it may help.

cheers

J
0
 
vxCommented:
Perhaps you should try to add the route manually first, so not in a script, it saves you the trouble of rebooting :)
0
 
Steves2001Author Commented:
Thanks I will give that a try on Monday I'm of site at the moment.
0
 
Steves2001Author Commented:
And I can't spell I meant off site
0
 
subhroCommented:
try to use "/sbin/netconf".....
0
 
subhroCommented:
sorry i think it should be /bin/netconf
0
 
dagmaticCommented:
can you ping the gateway from the webserver?

if you can.

type this at the command line

route add default gw 194.83.167.2

You now should be able to ping past the gateway i.e. get out to the net from that machine. If so let me know we will set it up so that it automatic at boot.

The out put of ifconfig and route would be helpful.
0
 
Steves2001Author Commented:
I have tried the route command and it worked correctly for pinging internal to yahoo will try accessing from home tonight to see if all is ok (don't try accessing it your self using the domain name as the colleges DNS server has not had it added to its hosts database yet).  I did a little more reading myself and I think I have made correct configuration changes to make it work by changing the /etc/sysconfig/network file, any comments from the experts about whether this is the correct method would be appreciated.  The full file is listed below.


NETWORKING=yes
FORWARD_IPV4=no
HOSTNAME=gcomp
DOMAINNAME=nlincs-coll.ac.uk
GATEWAY=194.83.167.2
GATEWAYDEV=eth0

Not to sure about how to distribute the points yet.
0
 
dagmaticCommented:
nice looking page, I get to

           Welcome to
           North Lincolnshire College
from the IP address.

your /etc/sysconfig/network is fine. You know that you can manipulate this file from the control-panel app? it is on the routing tab for the networking section.
0
 
Steves2001Author Commented:
dagmatic post an answer to this question so I can award you 50 points, jools post a comment if you would like 15 points for the help.  Many thanks to all for the help offered.
0
 
joolsCommented:
Thanks Steves2001, give the pts to dagmatic. Just glad to be of some assistance.

J
0
 
Steves2001Author Commented:
I have and no problems thanks again and thanks jools.
0
All Courses

From novice to tech pro — start learning today.