[opensuse] Adding a route from a shell script?
We have a good-sized shell script that automates our openSUSE and SLES OS configurations, chained into from autoyast. We'd like it to set up a multicast route. If I put the route in /etc/sysconfig/network/ifroute-eth0, the line seems to be ignored - I get no route. If I put the same line in /etc/sysconfig/network/routes, the line seems to take effect. However, the line eventually gets moved to routes.YaST2save and of course then stops working. I suspect I've been putting the right thing in ifroute-eth0 and the program utilizing ifroute-eth0 is doing something wrong, because otherwise it seems like the same line wouldn't work in /etc/sysconfig/network/routes. What do I need to do in order to automatically add a route and get it to stick? It seems I could add an rc script to re-add my line to /etc/sysconfig/network/routes on every boot, but... that's a little bit icky. The line I've been trying to use is: 228.0.0.0/8 0.0.0.0 255.0.0.0 eth0 multicast Thanks! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Dan Stromberg wrote:
We have a good-sized shell script that automates our openSUSE and SLES OS configurations, chained into from autoyast.
We'd like it to set up a multicast route.
If I put the route in /etc/sysconfig/network/ifroute-eth0, the line seems to be ignored - I get no route.
If I put the same line in /etc/sysconfig/network/routes, the line seems to take effect. However, the line eventually gets moved to routes.YaST2save and of course then stops working.
I suspect I've been putting the right thing in ifroute-eth0 and the program utilizing ifroute-eth0 is doing something wrong, because otherwise it seems like the same line wouldn't work in /etc/sysconfig/network/routes.
What do I need to do in order to automatically add a route and get it to stick?
It seems I could add an rc script to re-add my line to /etc/sysconfig/network/routes on every boot, but... that's a little bit icky.
The line I've been trying to use is:
228.0.0.0/8 0.0.0.0 255.0.0.0 eth0 multicast
Thanks!
BTW, we had a similar problem with changing the default runlevel in /etc/inittab. If we edited the runlevel in /etc/inittab from our shell script, the runlevel would be set back to the wrong value again on the next boot. We eventually found that we could make the runlevel stay put by changing the autoyast.xml instead, and letting yast (?) stuff the right value in the file in an automatic way. So I checked our autoyast.xml files for this issue, but didn't see anything that looked much like a way of adding a route. I searched on "net" and "route" in an example file. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Dan Stromberg wrote:
Dan Stromberg wrote:
We have a good-sized shell script that automates our openSUSE and SLES OS configurations, chained into from autoyast.
We'd like it to set up a multicast route.
If I put the route in /etc/sysconfig/network/ifroute-eth0, the line seems to be ignored - I get no route.
If I put the same line in /etc/sysconfig/network/routes, the line seems to take effect. However, the line eventually gets moved to routes.YaST2save and of course then stops working.
I suspect I've been putting the right thing in ifroute-eth0 and the program utilizing ifroute-eth0 is doing something wrong, because otherwise it seems like the same line wouldn't work in /etc/sysconfig/network/routes.
What do I need to do in order to automatically add a route and get it to stick?
It seems I could add an rc script to re-add my line to /etc/sysconfig/network/routes on every boot, but... that's a little bit icky.
The line I've been trying to use is:
228.0.0.0/8 0.0.0.0 255.0.0.0 eth0 multicast
Thanks!
BTW, we had a similar problem with changing the default runlevel in /etc/inittab. If we edited the runlevel in /etc/inittab from our shell script, the runlevel would be set back to the wrong value again on the next boot. We eventually found that we could make the runlevel stay put by changing the autoyast.xml instead, and letting yast (?) stuff the right value in the file in an automatic way.
So I checked our autoyast.xml files for this issue, but didn't see anything that looked much like a way of adding a route. I searched on "net" and "route" in an example file.
It looks like although our autoyast.xml's had no routing information, they can contain routing information. After googling and looking at some ycp files, I came up with this guess, which seems to be working: <routing> <ip_forward config:type="boolean">false</ip_forward> <!-- destination, gateway, netmask, [device, [extrapara]] --> <!-- 228.0.0.0/8 0.0.0.0 255.0.0.0 eth0 multicast --> <routes config:type="list"> <route> <destination>228.0.0.0/8</destination> <gateway>0.0.0.0</gateway> <netmask>255.0.0.0</netmask> <device>eth0</device> <extrapara>multicast</extrapara> </route> </routes> </routing> ...but using this rather complicated method is going to be a headache if we need to change a route in the field. It'd be much nicer if we could just edit the "routes" file with vi or a shell script. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Thursday 2008-03-06 at 14:13 -0800, Dan Stromberg wrote: ...
BTW, we had a similar problem with changing the default runlevel in /etc/inittab. If we edited the runlevel in /etc/inittab from our shell script, the runlevel would be set back to the wrong value again on the next boot. We eventually found that we could make the runlevel stay put by changing the autoyast.xml instead, and letting yast (?) stuff the right value in the file in an automatic way.
In my experience, a value in /etc/inittab stood. But then, I have never used autoyast. How about removing autoyast? I suppose it is not needed after installation. Perhaps it is a bug. Perhaps it is a feature, to configure all the computers the same, even after installation. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) iD8DBQFH0IzctTMYHG2NR9URAh53AJ0e6fmex2vE7BFOyzHa7oMmywhPsQCgmTrK h1uypTEykW1TleqTa3xT9Lg= =bi8s -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Carlos E. R. wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
The Thursday 2008-03-06 at 14:13 -0800, Dan Stromberg wrote:
...
BTW, we had a similar problem with changing the default runlevel in /etc/inittab. If we edited the runlevel in /etc/inittab from our shell script, the runlevel would be set back to the wrong value again on the next boot. We eventually found that we could make the runlevel stay put by changing the autoyast.xml instead, and letting yast (?) stuff the right value in the file in an automatic way.
In my experience, a value in /etc/inittab stood. But then, I have never used autoyast. How about removing autoyast? I suppose it is not needed after installation. Perhaps it is a bug. Perhaps it is a feature, to configure all the computers the same, even after installation.
What openSUSE were you using at the time? We're using 10.3. Have others had this same experience? Are autoyast users finding they cannot make persistent changes to some system files under /etc, while standard install users are finding they can? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Thursday 2008-03-06 at 17:08 -0800, Dan Stromberg wrote:
In my experience, a value in /etc/inittab stood. But then, I have never used autoyast. How about removing autoyast? I suppose it is not needed after installation. Perhaps it is a bug. Perhaps it is a feature, to configure all the computers the same, even after installation.
What openSUSE were you using at the time?
We're using 10.3.
Same one. And others previously, I have configured runlevel in /etc/inittab directly quite often. In 7.x or roundabouts you had to edit a config file, rc.config perhaps, and then suseconfig passed the change over to inittab. But I don't use autoyast.
Have others had this same experience? Are autoyast users finding they cannot make persistent changes to some system files under /etc, while standard install users are finding they can?
It would make some sense. But I can't say for sure. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) iD8DBQFH0KHPtTMYHG2NR9URAkK/AJ9b2ygjrRIL9vodiK52xgZ4uwC6mwCeKXhi kI72Vik3aVpTvIBegK1t1Hg= =VPUV -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (2)
-
Carlos E. R.
-
Dan Stromberg