You need to edit (using notepad) the [InetWD] section of the C:\Program Files\Alwil Software\Avast4\Data\avast4.ini file and add the following line (depending on your connection type):
Broadband connections, add this line:
AlwaysConnectedWaitSeconds=120 and
AssumeAlwaysConnected=1 if not present (or edit AssumeAlwaysConnected=0 to AssumeAlwaysConnected=1)
[InetWD]
AssumeAlwaysConnected=1
AlwaysConnectedWaitSeconds=120
When complete save the changes, avast's self-defence module will ask for confirmation, etc. answer Yes.
Or
Dial-up connections, add this line:
RASWaitSeconds=120 and
UseRAS=1 if not present (or edit UseRAS=0 to UseRAS=1)
[InetWD]
UseRAS=1
RASWaitSeconds=120
When complete save the changes, avast's self-defence module will ask for confirmation, etc. answer Yes.
The figure is seconds and the above equates to two minutes, you could try that and adjust upwards if required, 180, 240, etc.