Incompatibility IP Address and default IP Gateway Adress on TCP/IP Stack

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Incompatibility IP Address and default IP Gateway Adress on TCP/IP Stack

996 次查看
Angelillo
Contributor III

Hi,

I'm using Ethernet communication with my K70 over MQX 3.8.1. My ethernet configuration should be:

  

    #define ENET_IPADDR  IPADDR(10,4,33,50)

    #define ENET_IPMASK  IPADDR(255,255,240,0)

    #define ENET_IPGATEWAY  IPADDR(10,4,32,254)

But if the second number of IP Address is the same that the second number of IP Gateway Adress (in my IP configuration is '4') my application doesn't run correctly. If these numbers aren't equals, my application run perfectly.

Can anyone help me?

Thank you very much in advance,

Ángel G.

标记 (3)
0 项奖励
回复
3 回复数

774 次查看
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Angel,

The answer from RadekS is right.

You cannot use a gateway address on another subnet. The gateway IP tells the system how to get to another subnet, and without it, packets won't leave the current subnet.

A computer only knows how to talk to the other computers that are directly connected on the same subnet. A gateway is a "default route" which specifies where packets should be sent by default if they are not destined for somewhere on the local subnet.

Regards,
Garabo

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

774 次查看
RadekS
NXP Employee
NXP Employee

It looks like some problem in LAN configuration.

If you want establish connection inside your LAN network (range 10.4.32.1 - 10.4.47.254), gateway should not have any influence.

If you want establish connection outside of your LAN network, you have to be sure that gateway address is equal to address of your router (connection to external world).

0 项奖励
回复

774 次查看
Wlodek_D_
Senior Contributor II

Hello,

Thank you for your post, however please consider moving it to the right community place (e.g. MQX Software Solutions )  to get it visible for active members.

For details please see general advice Where to post a Discussion?

Thank you for using Freescale Community.

0 项奖励
回复