suse12: how to set default route via config file
6,457
Create or edit /etc/sysconfig/network/routes
and add a line like :
default 192.168.1.1 - -
(where, in case it would not be obvious, 192.168.1.1 is your gateway)
[src: courseware for Suse course 3124 "SUSE Linux Server 12 Administration"]
Related videos on Youtube
Author by
John Westlund
Updated on September 18, 2022Comments
-
John Westlund over 1 year
I've got some systems that are provisioning SLES12sp1 statelessly - the systems come up with their provisioning interface configured, but no default route.
On RedHat I'd set the
GATEWAYDEV
in/etc/sysconfig/network
-- but I can't find an equivalent for openSUSE/SLES.There is no NetworkManager or
ifcfg
files:# ls /etc/sysconfig/network/ config dhcp if-down.d if-up.d ifcfg-lo ifcfg.template network providers scripts
Some additional context:
# ifconfig eth2 eth2 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX inet addr:192.168.1.29 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::21e:67ff:fecb:f26f/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:213248 errors:0 dropped:0 overruns:0 frame:0 TX packets:35744 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:295970393 (282.2 Mb) TX bytes:4018621 (3.8 Mb) Memory:92020000-9203ffff # route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
-
MariusMatutiae over 7 yearsHave you seen this page? suse.com/documentation/sled11/book_sle_admin/data/…
-
John Westlund over 7 yearsYes -- the sle 12 version of that doc, but I haven't found anything in it that resolves my issue.
-
-
John Westlund over 7 years@heritu -- no luck. Tried
default <ip> - -
,default <ip> - eth2
,default - - eth2
. Maybe because PXE is bringing up the interface? -
John Westlund over 7 yearsI think your answer is correct -- but won't work in my case because of how the provisioning is happening.