---
title: "W5500 not getting IP from router but able to direct from laptop"
url: "https://maker.wiznet.io/forum/14283"
markdown_url: "https://maker.wiznet.io/forum/14283/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "Deepak"
created: "2021-07-05T06:40:26+09:00"
last_activity: "2021-07-07T06:01:18+09:00"
language: "en"
views: 599
replies: 2
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W5500 not getting IP from router but able to direct from laptop

## Question

Asked by Deepak on 2021-07-05 in Ethernet Chips.

**Hello everyone,**

I am able to connect my laptop to w5500 without any router but when I am connecting it to the office local network then it is not getting IP.

**Here is my code.**

void eth_reset()
{
unsigned char status_ir;
GPIOB-> BRR |= (1&lt;&lt;7); // Reset pin
HAL_Delay(200);//reset
GPIOB-> BSRR |= (1&lt;&lt;7);
HAL_Delay(500);

```
reg_wizchip_cs_cbfunc(cs_sel, cs_desel);  //  cs select and deselect pass in wizchip library
reg_wizchip_spi_cbfunc(spi_rb, spi_wb);   //  receive buff and transmit buff pass in wizchip libra
//wizchip_init(socketRxTxBuff, socketRxTxBuff);    //  Socket Rx amd Tx buffer initialization (Max 16kb for rx and 16kb for tx), Max size can be divide in 8 socket buffer according to need
if(ctlwizchip(CW_INIT_WIZCHIP,(void*)memsize) == -1){
	UARTSendString(logPort, (unsigned char*)"WIZCHIP Initialized fail.\r\n");
	//while(1);
}

volatile wiz_PhyConf phyConf =
{
		PHY_CONFBY_HW, // PHY_CONFBY_SW
		PHY_MODE_AUTONEGO, // PHY_MODE_AUTONEGO
		PHY_SPEED_100, // PHY_SPEED_100
		PHY_DUPLEX_FULL, // PHY_DUPLEX_HALF
};

volatile wiz_NetInfo netInfo = { .mac = {0xa1,0xb2,0xc3,0xd1,0xe1,0xf4},	// Mac address
		.ip 	= {192,168,1,199},	// IP address
		.sn 	= {255,255,255,0},	// Subnet mask
		.gw 	= {192,168,1,1},    // Gateway address
		.dns	= {0,0,0,0},
		.dhcp   =  NETINFO_STATIC};

//wizchip_setnetinfo(&netInfo);
HAL_Delay(200);
ctlnetwork(CN_SET_NETINFO, (void*) &netInfo);
//UARTSendString(2, "ctlnetwork\r\n");

HAL_Delay(200);
ctlwizchip(CW_SET_PHYCONF, (void*) &phyConf);
//UARTSendString(2, "ctlwizchip\r\n");

HAL_Delay(200);
ctlwizchip(CW_GET_PHYLINK, (void*) &tmp);
```

// setSIMR(0x01);
}

Please suggest any change if I am doing anything wrong.

## Replies

### Reply 1 by teju, 2021-07-05

Hi [@Deepak](https://maker.wiznet.io/u/deepak) ,
Thank you for reaching us…
Can you send me the log …
And once make sure that gateway address of yours office…??

Thanks & Regards
Teju S H

### Reply 2 by Deepak, 2021-07-07 (in reply to reply 1)

It is connect now, If sometimes I change the mac address, It also work. Right now it is working. I will send the the log if It will occur again.

---

Source: https://maker.wiznet.io/forum/14283
