Microchip
直播中

杨娟

7年用户 268经验值
私信 关注
[问答]

DHCP服务器总是分配子网掩码255.255.0.0如何更改?

请原谅,如果我在某处被问到,我使用的是TCP IP堆栈V5.42.08设备PIC24FJ256+Enc28。当我启用DHCP服务器,然后将板连接到我的PC(直接到以太网端口)时,它总是给我的PC分配IP地址169254.0.100和子网掩码255.255.0.0。我想要DHCP服务器屁股。我的子网掩码255.255.255.0,我如何改变?我在文件“DHCPS.C′://选项:子网掩码UPDPT(DHCPA子网掩码))中,在DHCP子网掩码中定义了“DHCP .H”:*定义DHCPA-子网掩码(1U)//DHCP1子网掩码类型,这是我必须更改的部分吗?是否将其更改为(0U)或(2U)以获得子网掩码255.255.255.0?

以上来自于百度翻译


      以下为原文

    Pardon me if this has been asked somewhere,
I'm using TCP IP Stack v5.42.08
Device PIC24FJ256 + ENC28.

When I enabled DHCP server then connect the board to my PC (directly to the ethernet port), it always assign my PC with IP address 169.254.0.100 and subnet mask 255.255.0.0.
I want the DHCP server assign me subnet mask 255.255.255.0 instead, how do I change that?
I found in file 'DHCPs.c':
      // Option: Subnet Mask
    UDPPut(DHCP_SUBNET_MASK);

Where DHCP_SUBNET_MASK is defined in 'DHCP.h':
    #define DHCP_SUBNET_MASK                (1u)    // DHCP_SUBNET_MASK Type

Is this the part that I must change? Do I change it to (0u) or (2u) to obtain subnet mask 255.255.255.0?

回帖(4)

陈杰

2018-9-3 16:59:37
也许它用你的面具来提供DHCP

以上来自于百度翻译


      以下为原文

    Maybe it uses your mask for the dhcp offer


// Option: Subnet Mask

    UDPPut(DHCP_SUBNET_MASK);

    UDPPut(sizeof(IP_ADDR));

    UDPPutArray((uint8_t*)&AppConfig.MyMask, sizeof(IP_ADDR));
举报

石胜厚

2018-9-3 17:07:01
AWW是的,在我把设备默认IP地址改为192.1681.101“C型”地址后,现在DHCP服务器将我的PC分配给另一个“C型”地址192.1681.100和子网255.255.255.0,但奇怪的是,现在我无法通过键入主机名“http://MCHPC板”来访问该板,浏览器搜索“www. MCH”。我以前可以用“B型”地址来做这件事。

以上来自于百度翻译


      以下为原文

    Aww yeah, after I changed device default IP address to 192.168.1.101 "type C" address, now the DHCP server assign my PC with another "type C" address 192.168.1.100 and subnet 255.255.255.0.
But, strange now I cannot access the board by typing host name "http://mchpboard", the browser search "www.mchpboard.com" instead.
while I can do that previously with "type B" address.
举报

吴键洪

2018-9-3 17:18:02
N.B.“192.1681.101”是“C型”地址。对不起,对您的其他问题无能为力。

以上来自于百度翻译


      以下为原文

   
n.b. "192.168.1.101" is a "Type C" address.
Sorry, can't help with your other problem.
举报

石胜厚

2018-9-3 17:25:37
好的,修正192.1681.101是“C型”地址,我已经编辑了这个帖子。

以上来自于百度翻译


      以下为原文

    Ok, correction 192.168.1.101 is "Type C" address, I've edited the post.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分