Home  >  Support  >  Support Forum  >  Why the ip adress isn't changing while program is running?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Why the ip adress isn't changing while program is running?

0 votes
Hello, I use next code on my RCM 6710:

int Init()
{
if (ifconfig(IF_ETH0, IFS_IPADDR, aton("10.10.6.100"),
IFS_NETMASK, aton("255.255.255.0"), IFS_ROUTER_SET, aton("10.10.6.1"),
IFS_UP, IFS_END)==0)
{
sock_init_or_exit(1);
return 1;
}
else
return 0;
}

This code doesn't work, because sock_init_or_exit(1) says that ip is the one I set by #define _PRIMARY_STATIC_IP
asked Mar 25 in Rabbit Software by airens New to the Community (5 points)

Please log in or register to answer this question.

2 Answers

+1 vote
 
Best answer
If you set a primary static IP address the way you have done then it is not possible to change the address at run time.

If you want to have full flexibility on setting IP configurations at run time you are probably best setting TCPCONFIG to 6 and issuing the required ifconfig()s to set up the addressing you need. The addp.c example in the samples\tcpip folder is a good one to examin to see how this works.

Regards,
Peter
answered Mar 25 by petermcs Veteran of the Digi Community (468 points)
selected Mar 26 by airens
0 votes
Worked great for me, thank you.
answered Mar 26 by airens New to the Community (5 points)
Contact a Digi expert and get started today! CONTACT US
...