Guillermo Moyna on Tue, 14 Aug 2001 08:50:04 -0400


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Accessing IP-dependent pages from home...


Hmm.  I'm not familiar with /etc/sysconfig.  Which distribution are you
using?  (I think I recall you mentioning RedHat, but I'm not sure.)

I actually figured out that the 'static-route' file under /etc/sysconfig was not doing much. i.e., if it was, it should have added the routes, right? Anyway, the following works fine:


/sbin/ifconfig eth0:1 10.1.20.30 up

Once you have that going, you just add the routes...

/sbin/route add -host 208.7.154.207 gw 10.1.1.254 eth0:1

That makes my machine connect to 208.7.154.207 using its 10.1.20.30 IP and the 10.1.1.254 gateway. It works fine, and I can do what I want, which is use it from home to get articles...

In order to get it to work at boot, I made a little script and I launch it from /etc/rc.d/rc5.d/S99local. Here it is for anyone interested:

***********

#!/bin/csh

#
# First set up the additional IP address for eth0...
#

/sbin/ifconfig eth0:1 10.1.20.30 up

#
# Now add the routes...
#

foreach IP ( 216.200.143.20 \
             216.143.112.80 \
             198.81.200.2 )

  /sbin/route add -host $IP gw 10.1.1.254 eth0:1

end

***********

If more hosts are required, they are just added to the foreach loop...

Thanks for all those who helped and gave suggestions,

Guillermo

+==================-------------- --- -- -  -    -     -
Guillermo Moyna, PhD
Department of Chemistry & Biochemistry
University of the Sciences in Philadelphia
600 South 43rd Street
Philadelphia, PA 19104-4495

 "The only existing things are atoms and empty space.
  All else is mere opinion" - Democritus, 370 B.C.

Office: Grifith Hall 360
Phone:  (215) 596-8526
Fax:    (215) 596-8543
e-mail: g.moyna@usip.edu
WWW:    http://tonga.usip.edu/gmoyna/index.html
        http://www.usip.edu/chemistry/faculty/moyna.asp

     -     -   -  - -- --- -----------=================+


______________________________________________________________________ Philadelphia Linux Users Group - http://www.phillylinux.org Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce General Discussion - http://lists.phillylinux.org/mail/listinfo/plug