The method of making startup script

Dear all,

I want to make the startup script which run the command “ip route add 192.168.1.0/24 dev eth0”.
But I can’t find the method in the Guide.
Could you tell me the method of making startup script?

Best regard,

Hi and welcome to the Forum :slight_smile:
If using wicked, you should just be able to go into YaST Network Settings and add. Else just create a simple systemd service to call your script after the network interface is up and running.

#!/bin/bash
ip route add 192.168.1.0/24 dev eth0

# /etc/systemd/system/add_my_route.service
[Unit]
Description=Add route to eth0
After=wickedd.service

[Service]
Type=simple
ExecStart=/bin/sh -c "/path/to/script/add_my_route

[Install]
WantedBy=multi-user.target

Hi malcolmlewis,

you should just be able to go into YaST Network Settings and add
I set the 2 route by YaST.

I checked the route, and 192.168.2.0/24 is not reflected.

Can’t we set the Gateway on the Yast?

Thank you and regards,