Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Accessing a gateway

Posted on 1999-07-26
19
Medium Priority
?
380 Views
Last Modified: 2010-03-18
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
0
Comment
Question by:Steves2001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
  • 3
  • +3
19 Comments
 
LVL 8

Expert Comment

by:stefanx
ID: 1585902
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
 
LVL 1

Author Comment

by:Steves2001
ID: 1585903
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
 
LVL 8

Expert Comment

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

grep route /etc/rc.d/*


0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Expert Comment

by:jools
ID: 1585905
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
 
LVL 1

Author Comment

by:Steves2001
ID: 1585906
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
 
LVL 19

Expert Comment

by:jools
ID: 1585907
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
 
LVL 19

Expert Comment

by:jools
ID: 1585908
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
 
LVL 2

Expert Comment

by:vx
ID: 1585909
Perhaps you should try to add the route manually first, so not in a script, it saves you the trouble of rebooting :)
0
 
LVL 1

Author Comment

by:Steves2001
ID: 1585910
Thanks I will give that a try on Monday I'm of site at the moment.
0
 
LVL 1

Author Comment

by:Steves2001
ID: 1585911
And I can't spell I meant off site
0
 

Expert Comment

by:subhro
ID: 1585912
try to use "/sbin/netconf".....
0
 

Expert Comment

by:subhro
ID: 1585913
sorry i think it should be /bin/netconf
0
 

Expert Comment

by:dagmatic
ID: 1585914
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
 
LVL 1

Author Comment

by:Steves2001
ID: 1585915
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
 

Expert Comment

by:dagmatic
ID: 1585916
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
 
LVL 1

Author Comment

by:Steves2001
ID: 1585917
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
 
LVL 19

Expert Comment

by:jools
ID: 1585918
Thanks Steves2001, give the pts to dagmatic. Just glad to be of some assistance.

J
0
 

Accepted Solution

by:
dagmatic earned 150 total points
ID: 1585919
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
 
LVL 1

Author Comment

by:Steves2001
ID: 1585920
I have and no problems thanks again and thanks jools.
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question