• AVR Freaks

Helpful Reply2 gateways

Author
jo1234
Junior Member
  • Total Posts : 115
  • Reward points : 0
  • Joined: 2015/09/17 09:01:38
  • Location: Switzerland
  • Status: offline
2017/11/21 03:26:35 (permalink)
0

2 gateways

Hello, 

Is it possible to have 2 gateway or make a route with the PIC32MX with the sample project
web_server_nvm_mpfs?
 
Thank you in advance for your answer.
#1
jo1234
Junior Member
  • Total Posts : 115
  • Reward points : 0
  • Joined: 2015/09/17 09:01:38
  • Location: Switzerland
  • Status: offline
Re: 2 gateways 2017/12/01 04:18:44 (permalink) ☄ Helpfulby loalo 2017/12/11 00:38:52
5 (1)
I found the solution for those interested. you have to make changes in the ipv4.c file
 
 I replace:
 
// if(_TCPIPStackIpAddFromLAN(pNetIf, pIpAdd))
// {
// pPkt->arpTarget.Val = pIpAdd->Val;
// }
// else
// { // not this LAN
// pPkt->arpTarget.Val = pNetIf->netGateway.Val;
// }
 
 by this:
 
if((pPkt->destAddress.Val & pNetIf->DefaultMask.Val) == (pNetIf->DefaultGateway.Val & pNetIf->DefaultMask.Val))//Local
{
pPkt->arpTarget.Val = pIpAdd->Val;
}
else if((pPkt->destAddress.Val & pNetIf->DefaultMask.Val) == (routeconfig[0].IP_Route.Val & routeconfig[0].IP_Mask.Val))//Reseau Route
{
pPkt->arpTarget.Val = routeconfig[0].IP_Net.Val;//moi!!!
}
else if((pPkt->destAddress.Val & pNetIf->DefaultMask.Val) == (routeconfig[1].IP_Route.Val & routeconfig[1].IP_Mask.Val))//Reseau Route
{
pPkt->arpTarget.Val = routeconfig[1].IP_Net.Val;//moi!!!
}
else if((pPkt->destAddress.Val & pNetIf->DefaultMask.Val) == (routeconfig[2].IP_Route.Val & routeconfig[2].IP_Mask.Val))//Reseau Route
{
pPkt->arpTarget.Val = routeconfig[2].IP_Net.Val;//moi!!!
}
else if((pPkt->destAddress.Val & pNetIf->DefaultMask.Val) == (routeconfig[3].IP_Route.Val & routeconfig[3].IP_Mask.Val))//Reseau Route
{
pPkt->arpTarget.Val = routeconfig[3].IP_Net.Val;//moi!!!
}
 
This corresponds to my routing table
post edited by jo1234 - 2017/12/01 04:20:41
#2
Jump to:
© 2019 APG vNext Commercial Version 4.5