Adding routes using restricted shell is not working for GW V10

book

Article ID: 207889

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

The naming implementation of the networking part is not working for routes created from the restricted shell .

With the naming ssg_ethx adding additional routes do not work.

When a customer boots the ova with 3 interfaces. He will get the following interfaces in /etc/sysconfig/network-scripts/

  • ensxxx (or something else)
  • ssg_eth1
  • ssh_eth2

The ens interface contains the aliases. which is fine for Iptables etc. but not for adding routes.

The problem is when customers add a routes with Karaf. This karaf shell creates route files which do not match with interface config files in /etc/sysconfig/network-scripts/.

NetworkManager will only ad routes when the ifcfg file matches with the route file. For example ifcfg-ssg_eth1 and route-ssg_eth1.

Currently these names never match. Below can you find an example of mismatching route files.

  • ifcfg-ens160
  • ifcfg-ssg_eth1
  • ifcfg-ssg_eth2

After adding routes with karaf the following route files were present.

  • route-eth0
  • route-eth2

 

Cause

For the OS to apply the routing the created routing file route-xxxxx  needs to match the interface config filename ifcfg-xxxx  ,not the interface alias name used in the nic config menu like  "ssg_eth0 , ssg_eth1".

Environment

Release : 10.0

Component : API GATEWAY

Resolution

To apply the routing from the the restricted shell we need to make sure the routing file created by the add route command is matching the OS interface script file.

The nic configuration menu shows the NIC alias name which is not the same as the interface script file

To find the correct name from the restricted shell you can do the following 

Run the following command in the restricted shell to determine the script file names.

        head -n 1 /etc/sysconfig/network-scripts/ifcfg-*

[email protected]()>head -n 1 /etc/sysconfig/network-scripts/ifcfg-*
==> /etc/sysconfig/network-scripts/ifcfg-ens160 <==
TYPE=Ethernet

==> /etc/sysconfig/network-scripts/ifcfg-lo <==
DEVICE=lo

This shows the network config files for each nic configured in the system .

To check which config file is for which nic  interface , you can show the content of the ifcfg-xxxx file using cat from the restricted shell

cat /etc/sysconfig/network-scripts/ifcfg-ens160

The NAME or DEVICE shows the nic alias used in the nic configuration menu . 

[email protected]()>[email protected]()>cat /etc/sysconfig/network-scripts/ifcfg-ens160
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ssg_eth0
UUID=1f51d3a8-f7fb-4d98-8321-a23d7b871065
DEVICE=ssg_eth0
ONBOOT=yes

# Per CCE: Set ZONE=public in /etc/sysconfig/network-scripts/ifcfg-ens160
ZONE=public
HWADDR=00:50:56:B1:0F:15

If you need to add a route for this NIC with the device alias name ssg_eth0 you need to create a routing file with the name route-ens160 
Only then the OS will run the route-ens160 script when the interface is started.


To do this from the restricted shell menu "route:add"  specify the interface name as ens160 not ssg_eth0  the route:add will create a routing file named route-<interfacename> where interface name is the name specified in the command .

[email protected](route)>add ens160 10.10.10.10 255.255.255.0  10.10.10.254

static route for '10.10.10.10' was added to 'ens160' successfully.

To check the configuration 

use the route:show command in the restricted shell

To verify the correct route-xxx files are created use the following command.

head -n 1 /etc/sysconfig/network-scripts/route-*

[email protected](route)>head -n 1 /etc/sysconfig/network-scripts/route-*
==> /etc/sysconfig/network-scripts/route-ens160 <==

To check the content of the route-ens160 file you can use

[email protected](route)>cat /etc/sysconfig/network-scripts/route-ens160

###                                     WARNING:                                            ###
###     This file is auto generated by the Layer 7 System Configuration wizard.             ###
###     This file will be overwritten if the utility is re-run                              ###
###                                                                                         ###
###     /etc/sysconfig/network-scripts/route-%s                                             ###

ADDRESS2=10.10.10.10
NETMASK2=255.255.255.0
GATEWAY2=10.10.10.254

To apply the routing you have to restart the network interface or reboot the appliance