[opensuse] preferred way to add a static route in OpenSuse?
Hello, I have added a static route that sends all traffic for a certain net block over the wlan interface. route add -net xxx.xxx.xxx.0 netmask 255.255.255.0 gw 192.168.1.1 dev wlan0 What is the preferred way in OpenSuse to: a) make this static route permanent? b) make this static route only come up when wlan0 is up? c) delete the static route when wlan0 goes down? TIA, Amedee -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
El Martes 11 Noviembre 2008 Amedee Van Gasse escribió:
Hello,
I have added a static route that sends all traffic for a certain net block over the wlan interface.
route add -net xxx.xxx.xxx.0 netmask 255.255.255.0 gw 192.168.1.1 dev wlan0
What is the preferred way in OpenSuse to: a) make this static route permanent? Yast/Network/network cards /wlan0/routes
b) make this static route only come up when wlan0 is up? /etc/sysconfig/network/if-up.d custom script
c) delete the static route when wlan0 goes down? /etc/sysconfig/network/if-down.d custom script
TIA, Amedee
-- No imprima este correo si no es necesario. El medio ambiente está en nuestras manos. ->>----------------------------------------------- Clist UAH a.k.a Angel ---------------------------------[www.uah.es]-<<-- "Ninja: No Income, No Job, no Assets (Lo que viene siendo un muerto de hambre). Hipotecas Subprime para Dummies" -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Angel Alvarez schreef:
El Martes 11 Noviembre 2008 Amedee Van Gasse escribió:
Hello,
I have added a static route that sends all traffic for a certain net block over the wlan interface.
route add -net xxx.xxx.xxx.0 netmask 255.255.255.0 gw 192.168.1.1 dev wlan0
What is the preferred way in OpenSuse to: a) make this static route permanent? Yast/Network/network cards /wlan0/routes
Thanks. I was looking at the "global" routes config in Yast, didn't realize that each individual interface could have routes too. You see, I'm used to routing on Cisco IOS, so I know the basics, I just need to fing the right place to do what I want.
b) make this static route only come up when wlan0 is up? /etc/sysconfig/network/if-up.d custom script
c) delete the static route when wlan0 goes down? /etc/sysconfig/network/if-down.d custom script
OK thanks, I can do that. I already considered that but I was hesitant because perhaps Yast could already provide this. But you just told me I was on the right path anyway. -- Amedee -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* Amedee Van Gasse
I have added a static route that sends all traffic for a certain net block over the wlan interface.
route add -net xxx.xxx.xxx.0 netmask 255.255.255.0 gw 192.168.1.1 dev wlan0
[snip] May I recommend 'ip' from the iproute2 package? route and ifconfig have been deprecated since kernel 2.2 by the superiour 'ip' command. -- Mads Martin Joergensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogical, with just a little bit more effort?" -- A. P. J. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Wed, November 12, 2008 09:07, Mads Martin Joergensen wrote:
* Amedee Van Gasse
[Nov 11. 2008 17:44]: I have added a static route that sends all traffic for a certain net block over the wlan interface.
route add -net xxx.xxx.xxx.0 netmask 255.255.255.0 gw 192.168.1.1 dev wlan0
[snip]
May I recommend 'ip' from the iproute2 package? route and ifconfig have been deprecated since kernel 2.2 by the superiour 'ip' command.
Yes of course you may recommend that. It's just that most pages on the web still refer to route and ifconfig. But with my Cisco experience, it feels more comfortable to use ip. I wasn't fully aware it even existed, and I certainly didn't know that route&ifconfig are deprecated. -- Amedee -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* Amedee Van Gasse
I have added a static route that sends all traffic for a certain net block over the wlan interface.
route add -net xxx.xxx.xxx.0 netmask 255.255.255.0 gw 192.168.1.1 dev wlan0
[snip]
May I recommend 'ip' from the iproute2 package? route and ifconfig have been deprecated since kernel 2.2 by the superiour 'ip' command.
Yes of course you may recommend that. It's just that most pages on the web still refer to route and ifconfig. But with my Cisco experience, it feels more comfortable to use ip. I wasn't fully aware it even existed, and I certainly didn't know that route&ifconfig are deprecated.
One example of deprecation is the addition of several IP adresses to one
interface. Here I add 10.42.42.42 for eth0, and as the example shows
ifconfig will not show it. So people using ifconfig might never find
additional IP addresses added to an interface.
blitz:~ # ip addr add 10.42.42.42 dev eth0
blitz:~ # ip addr list eth0
2: eth0:
On Tue, Nov 11, 2008 at 05:41:46PM +0100, Amedee Van Gasse wrote:
What is the preferred way in OpenSuse to: a) make this static route permanent? b) make this static route only come up when wlan0 is up? c) delete the static route when wlan0 goes down?
Add a /etc/sysconfig/network/ifroute-wlan0 file. See man 5 routes Lars -- Lars Müller [ˈlaː(r)z ˈmʏlɐ] Samba Team SUSE Linux, Maxfeldstraße 5, 90409 Nürnberg, Germany
participants (4)
-
Amedee Van Gasse
-
Angel Alvarez
-
Lars Müller
-
Mads Martin Joergensen