View previous topic :: View next topic |
Author |
Message |
flickerfly l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/gallery/Funny_Figure/pilgrim.gif)
Joined: 08 Nov 2002 Posts: 677 Location: Lanham, MD
|
Posted: Thu Jan 27, 2005 6:45 pm Post subject: Add a route in /etc/conf.d/net |
|
|
I currently add my routes in /etc/conf.d/localstart but this doesn't work well when I take my NIC down without shutting it down. I assume that I could put it in /etc/conf.d/net with the right syntax. Anyone know? I can't seem to dig up documentation on it. _________________ An Evil Genious' Guide to Sheeple and How To Avoid Becoming One | 0x4C9EF4A |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
nobspangle Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/210249061640b0c1d626f5b.gif)
Joined: 23 Mar 2004 Posts: 1318 Location: Manchester, UK
|
Posted: Thu Jan 27, 2005 11:04 pm Post subject: |
|
|
I think you need the latest baselayout (unstable) then the instructions are in the file. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
UberLord Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/16007251014200867ea775c.gif)
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Thu Jan 27, 2005 11:12 pm Post subject: |
|
|
You can add routes with baselayout-1.9.x and better
Code: | routes_eth0=( "default gw 192.168.0.1" ) |
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
flickerfly l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/gallery/Funny_Figure/pilgrim.gif)
Joined: 08 Nov 2002 Posts: 677 Location: Lanham, MD
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
afabco Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 24 Feb 2004 Posts: 380
|
Posted: Fri Jan 28, 2005 1:41 am Post subject: |
|
|
Is this the 'right' way to add routes?
I have the following routes at the end of /etc/conf.d/local.start
route add -net 192.168.11.0 netmask 255.255.255.0 gw 10.70.1.1
route add -net 10.70.3.0 netmask 255.255.255.0 gw 10.70.1.1
route add -net 10.70.4.0 netmask 255.255.255.0 gw 10.70.1.1
Problem i see with this is if I mess with the networking, these routes don't get changed/removed. Plus whatever other issues I'm not even aware of.
What's the 'right' way to do something like this?
Thanks! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
UberLord Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/16007251014200867ea775c.gif)
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Fri Jan 28, 2005 1:49 am Post subject: |
|
|
Code: | routes_eth0=( "192.168.11.0 netmask 255.255.255.0 gw 10.70.1.1"
"10.70.3.0 netmask 255.255.255.0 gw 10.70.1.1"
"10.70.4.0 netmask 255.255.255.0 gw 10.70.1.1" ) |
I think |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
afabco Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 24 Feb 2004 Posts: 380
|
Posted: Fri Jan 28, 2005 2:03 am Post subject: |
|
|
you THINK??????
/me grins
thanks. I'll let you know. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
afabco Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 24 Feb 2004 Posts: 380
|
Posted: Fri Jan 28, 2005 2:10 am Post subject: |
|
|
hm. nope.
/etc/conf.d/net:
bash-2.05b$ cat /etc/conf.d/net
iface_eth0="192.168.11.185 netmask 255.255.255.0 broadcast 192.168.11.255"
iface_eth1="192.168.0.185 netmask 255.255.255.0 broadcast 192.168.0.255"
iface_eth2="10.70.1.185 netmask 255.255.255.0 broadcast 10.70.1.255"
gateway="eth1/192.168.0.1"
routes_eth2=( "192.168.11.0 netmask 255.255.255.0 gw 10.70.1.1"
"10.70.3.0 netmask 255.255.255.0 gw 10.70.1.1"
"10.70.4.0 netmask 255.255.255.0 gw 10.70.1.1" )
bash-2.05b$ /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.70.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.11.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 127.0.0.1 255.0.0.0 UG 0 0 0 lo
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth1
EDIT:
here's the way it was:
/etc/conf.d/local.start:
bash-2.05b$ cat /etc/conf.d/local.start
# /etc/conf.d/local.start:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/local.start,v 1.4 2002/11/18 19:39:22 azarah Exp $
# This is a good place to load any misc.
# programs on startup ( 1>&2 )
route add -net 192.168.11.0 netmask 255.255.255.0 gw 10.70.1.1
route add -net 10.70.3.0 netmask 255.255.255.0 gw 10.70.1.1
route add -net 10.70.4.0 netmask 255.255.255.0 gw 10.70.1.1
bash-2.05b$ /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.70.4.0 10.70.1.1 255.255.255.0 UG 0 0 0 eth2
10.70.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
10.70.3.0 10.70.1.1 255.255.255.0 UG 0 0 0 eth2
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.11.0 10.70.1.1 255.255.255.0 UG 0 0 0 eth2
192.168.11.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 127.0.0.1 255.0.0.0 UG 0 0 0 lo
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth1
This works, altho looking at it I see a problem with the 192.168.11.0 subnet... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|