Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Add a route in /etc/conf.d/net
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
flickerfly
l33t
l33t


Joined: 08 Nov 2002
Posts: 677
Location: Lanham, MD

PostPosted: Thu Jan 27, 2005 6:45 pm    Post subject: Add a route in /etc/conf.d/net Reply with quote

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
View user's profile Send private message
nobspangle
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1318
Location: Manchester, UK

PostPosted: Thu Jan 27, 2005 11:04 pm    Post subject: Reply with quote

I think you need the latest baselayout (unstable) then the instructions are in the file.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Thu Jan 27, 2005 11:12 pm    Post subject: Reply with quote

You can add routes with baselayout-1.9.x and better

Code:
routes_eth0=( "default gw 192.168.0.1" )
Back to top
View user's profile Send private message
flickerfly
l33t
l33t


Joined: 08 Nov 2002
Posts: 677
Location: Lanham, MD

PostPosted: Fri Jan 28, 2005 12:59 am    Post subject: Reply with quote

Thanks!
_________________
An Evil Genious' Guide to Sheeple and How To Avoid Becoming One | 0x4C9EF4A
Back to top
View user's profile Send private message
afabco
Guru
Guru


Joined: 24 Feb 2004
Posts: 380

PostPosted: Fri Jan 28, 2005 1:41 am    Post subject: Reply with quote

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
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Fri Jan 28, 2005 1:49 am    Post subject: Reply with quote

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
View user's profile Send private message
afabco
Guru
Guru


Joined: 24 Feb 2004
Posts: 380

PostPosted: Fri Jan 28, 2005 2:03 am    Post subject: Reply with quote

you THINK??????

/me grins

thanks. I'll let you know.
Back to top
View user's profile Send private message
afabco
Guru
Guru


Joined: 24 Feb 2004
Posts: 380

PostPosted: Fri Jan 28, 2005 2:10 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum