Wednesday 5 November 2014

Mystery of changing IP address on NIC interfaces in Linux

In our lab we  use Linux Server PC, Fedora core 14. It had 8 LAN Network interfaces card and is used as PPPoE server, DHCP server and Radius Server.  All interfaces have static IP addresses assigned to them, but we were facing below issues with it:

1) After  every reboot, one NIC card will take IP Address of another NIC card.

2) One NIC card if goes up and down the default IP address will become 0.0.0.0

So if there is any change of state or PC reboot, we need to again manually assign the IP address of the NIC cards.

We used both the methods to assign ip address:

1) ifconfig  Command  ( ifconfig eth0 8.1.1.1 netmask 255.255.255.0 up)

2)Right corner->Network Configuration-> Edit connection->


It took some time to figure out what was happening once we decided to solve this problem forever.

Analysis

For each interface the configuration files are stored in /etc/sysconfig/network-script/ifcfg-<name>. For example for eth1 we should have /etc/sysconfig/network-script/ifcfg-eth1.

We saw we had different names for the same interfaces in command prompt and config files .The name was eth1, but in config file it was stored as Auto-eth1. For the NIC which was taking IP address of other NIC, the HWADDR field was not present. The NIC which was taking none ip address after up/down was actually configured as DHCP in config files. Below is sample file :


DEVICE=eth1
NM_CONTROLLED=yes
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=none
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME=eth1
UUID=9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04
USERCTL=yes
IPADDR0=25.1.1.1
PREFIX0=24
DEFROUTE=no

HWADDR=1C:6F:65:C6:4A:9C

Resolution

To make it work make sure the Edit connection have proper static ip address , no two interfaces should have default gateway. Now edit the /etc/sysconfig/network-script/ifcfg-<name> file and make sure it reflects same name and values as in Edit connections. Make sure below fields are matching properly between "Edit Connections" and config files :

DEVICE, NAME, HWADDR

IF these fields are not present in the config file, edit and give them properly.

After reboot everything worked fine !

Mystery solved.

Keep Trying , Keep Solving !

Tuesday 4 November 2014

ICICI Prudential Website exceptions

Got below Exception while paying premium for ICICI prudential website. ICICI bank let your website be properly tested ???
================================================

 Compilation of JSP File '/customer/onlinepay/view/OnlinePaySuccessView.jsp' failed:

OnlinePaySuccessView.jsp:1:19: 'try' statement has neither 'catch' nor 'finally' clause
 <%@ page import="org.apache.log4j.Logger"%>
                  ^---------------------^
OnlinePaySuccessView.jsp:1589:25: This expression can throw an exception java.lang.Exception that is not caught by any enclosing try statement and is not allowed in this method, constructor, or initializer block.
                                    SMSFlagSplit = transactionDAO.insertToSmsPushLogSplit(EnterMobileNo,
                                                                                       ^----------------------------------------------------
                                            strPolicyNum, Transaction_id, strPendingAmt);
----------------------------------------------------------------------------------------------------^
OnlinePaySuccessView.jsp:2529:12: This expression can throw an exception java.lang.Exception that is not caught by any enclosing try statement and is not allowed in this method, constructor, or initializer block.
    Vector v1=cd.getMailDetails(policyViewBeanDataBean.getClientID());
                  ^-----------------------------------------------------^
OnlinePaySuccessView.jsp:2812:1: Expression expected (found 'catch' instead)
</body>
^------
</html>
------^
OnlinePaySuccessView.jsp:2812:1: Illegal use of an expression as a statement.
</body>
^------
</html>
------^
OnlinePaySuccessView.jsp:2812:1: No variable or field with this name could be found at this location.
</body>
^------
</html>
------^
OnlinePaySuccessView.jsp:2812:1: No variable or field with this name could be found at this location.
</body>
^------
</html>
------^
OnlinePaySuccessView.jsp:2812:1: Syntax error: expected ) (found '__ee' instead)
</body>
^------
</html>
------^
OnlinePaySuccessView.jsp:2812:1: Illegal use of an expression as a statement.
</body>
^------
</html>
------^
OnlinePaySuccessView.jsp:2812:1: Syntax error: expected ; (found ')' instead)
</body>
^------
</html>
------^
OnlinePaySuccessView.jsp:2812:1: No variable or field with this name could be found at this location.
</body>
^------
</html>
------^
OnlinePaySuccessView.jsp:2812:1: No variable or field with this name could be found at this location.
</body>
^------
</html>
------^
OnlinePaySuccessView.jsp:2812:1: Syntax error: expected } (found 'EOF' instead)
</body>
^------
</html>
------^

================================================