1

I am trying to add some routes in /etc/init.d/S98 script but it is failing to ping the gateway IP and hence route addition is failing. But once all the S98 scripts are executed I am able to ping the IP and add the routes. Below are the logs captured during S98 script execution. Could you please help me in understanding if I am missing something during init script (/etc/rc3.d/S98) execution.

PING 27.190.35.1 (27.190.35.1) from 27.190.35.171 bond0.3: 56(84) bytes of data.
From 27.190.35.171 icmp_seq=1 Destination Host Unreachable
From 27.190.35.171 icmp_seq=2 Destination Host Unreachable
From 27.190.35.171 icmp_seq=3 Destination Host Unreachable

# ifconfig 
bond0     Link encap:Ethernet  HWaddr B4:B5:2F:59:FF:E8
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.240.0
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:9000  Metric:1
          RX packets:446 errors:0 dropped:0 overruns:0 frame:0
          TX packets:290 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10000
          RX bytes:51268 (50.0 KiB)  TX bytes:42174 (41.1 KiB)

bond0.2   Link encap:Ethernet  HWaddr B4:B5:2F:59:FF:E8
          inet addr:10.63.73.16  Bcast:10.63.73.127  Mask:255.255.255.128
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:45 errors:0 dropped:0 overruns:0 frame:0
          TX packets:49 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10000
          RX bytes:2070 (2.0 KiB)  TX bytes:2058 (2.0 KiB)

bond0.2:1 Link encap:Ethernet  HWaddr B4:B5:2F:59:FF:E8
          inet addr:10.63.73.5  Bcast:10.63.73.127  Mask:255.255.255.128
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1

bond0.3   Link encap:Ethernet  HWaddr B4:B5:2F:59:FF:E8
          inet addr:27.190.35.171  Bcast:27.190.35.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:39 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10000
          RX bytes:1794 (1.7 KiB)  TX bytes:1680 (1.6 KiB)

bond0.3:1 Link encap:Ethernet  HWaddr B4:B5:2F:59:FF:E8
          inet addr:27.190.35.170  Bcast:27.190.35.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1

bond0:1   Link encap:Ethernet  HWaddr B4:B5:2F:59:FF:E8
          inet addr:192.168.1.30  Bcast:192.168.15.255  Mask:255.255.240.0
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:9000  Metric:1

eth0      Link encap:Ethernet  HWaddr B4:B5:2F:59:FF:E8
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:9000  Metric:1
          RX packets:304 errors:0 dropped:0 overruns:0 frame:0
          TX packets:272 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10000
          RX bytes:35698 (34.8 KiB)  TX bytes:39596 (38.6 KiB)
          Interrupt:32 Memory:f6000000-f67fffff

eth1      Link encap:Ethernet  HWaddr B4:B5:2F:59:FF:E8
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:9000  Metric:1
          RX packets:142 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10000
          RX bytes:15570 (15.2 KiB)  TX bytes:2578 (2.5 KiB)
          Interrupt:36 Memory:f4800000-f4ffffff

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:156 errors:0 dropped:0 overruns:0 frame:0
          TX packets:156 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:14528 (14.1 KiB)  TX bytes:14528 (14.1 KiB)

# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.63.73.0      *               255.255.255.128 U     0      0        0 bond0.2
27.190.35.0     *               255.255.255.0   U     0      0        0 bond0.3
192.168.0.0     *               255.255.240.0   U     0      0        0 bond0
default         10.63.73.126    0.0.0.0         UG    0      0        0 bond0.2

traceroute result:
traceroute to 27.190.35.1 (27.190.35.1), 30 hops max, 60 byte packets
 1  Cage-3-dsc-sb-phy-A (27.190.35.171)  3000.659 ms !H  3000.649 ms !H  3000.634 ms !H

arping result: 
ARPING 27.190.35.1 from 27.190.35.171 bond0.3
jordanm
  • 42,678
Puneeth
  • 11
  • You chose a name for your script that makes it look like a stop link. – jordanm Jul 17 '13 at 14:39
  • First off are you sure you're booting into runlevel 3? Have you made sure that your network comse up before you try applying the routes? Thirdly are these networks VLANed on the same switch? – Karlson Jul 17 '13 at 20:05

2 Answers2

0

The init scripts are run in order of the number in them:

  • S01first

  • S10tenth

    ...

  • S90ninetieth

This is done so you can stack dependancies in services, just like S85httpd depends on S10network. If there are no dependencies, such as with S08ip6tables and S08iptables, the order in which the run is not important.

So if you have a dependency on S98 having been run, which is what read here, you can put the service in S99.

Personally, unless there are good reasons, I would renumber the script just after the range that the network scripts are usually run, just after S20 or S30, depending on what is installed.

EDIT: You might want to change from a custom solution to using the common way of implementing bonding. Linux Bond / Team Multiple Network Interfaces (NIC) Into a Single Interface, and read Painfully Slow Or No Failed Link Detection if you are still experiencing the similar issues.

  • I have captured the logs when the issue was faced. Even arping is failing. – Puneeth Jul 18 '13 at 05:20
  • Yes I am booting in runlevel-3 and the script (/etc/rc3.d/S98) is getting executed properly but in the script I am trying to ping the IP which is failing. You can see that the network services are up and all the IPs are plumbed. I am trying to add a gateway IP to reach the external network which if failing. I tried renaming the script as S99 but still it is failing. – Puneeth Jul 18 '13 at 05:22
  • You don't need to rename the script, you probably need to split the script into 2 parts, and S98 and S99 part. – Daniël W. Crompton Jul 18 '13 at 07:44
  • I think you misunderstood my query, there is no dependency between S98 and S99 scripts. I am just wondering why ping to external gateway IP is failing during init script execution whereas it is working after some time. – Puneeth Jul 18 '13 at 12:28
  • If I read your question correctly you have a number of tools being run in S98, some of these fail, when on running these after the execution of S98 they succeed. To me that sounds like you should create a new script called S99 which runs these commands. – Daniël W. Crompton Jul 19 '13 at 00:17
0

Check on the switch you have portfast turned on for the ports. Not having portfast means the switch will wait 30 seconds before forwarding packets.

interface FastEthernet1
spanning-tree portfast

Doug
  • 1