Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions source/firewall/firewall.c
Original file line number Diff line number Diff line change
Expand Up @@ -10705,6 +10705,24 @@ static int do_wan2lan(FILE *fp)
return(0);
}

/*
* Procedure : do_block_lan_access_to_wan_ssh
* Purpose : To block SSH using WAN IP from LAN client
* Parameters :
* fp : An open file to write rules to block SSH using WAN IP in LAN client
* Return Values :
* 0 : Success
*/
#if defined(_SR213_PRODUCT_REQ_) || defined(_SCER11BEL_PRODUCT_REQ_)
static int do_block_lan_access_to_wan_ssh(FILE *fp)
{
FIREWALL_DEBUG("Entering do_block_lan_access_to_wan_ssh\n");
fprintf(fp, "-I INPUT 1 -i brlan0 -d %s -p tcp --dport 10022 -j REJECT\n", current_wan_ipaddr);
FIREWALL_DEBUG("Exiting do_block_lan_access_to_wan_ssh\n");
return(0);
}
#endif

/*
==========================================================================
Ephemeral filter rules
Expand Down Expand Up @@ -13710,6 +13728,10 @@ static int prepare_enabled_ipv4_firewall(FILE *raw_fp, FILE *mangle_fp, FILE *na
do_lan2wan(mangle_fp, filter_fp, nat_fp);
do_wan2lan(filter_fp);
do_filter_table_general_rules(filter_fp);
#if defined(_SR213_PRODUCT_REQ_) || defined(_SCER11BEL_PRODUCT_REQ_)
if(isWanReady)
do_block_lan_access_to_wan_ssh(filter_fp);
#endif
#if defined(SPEED_BOOST_SUPPORTED)
WAN_FAILOVER_SUPPORT_CHECK
if(isWanServiceReady)
Expand Down