1
\$\begingroup\$

I'm working on an ethernet connection with the ENC28J60. During development, I'd like to connect the chip to my computer directly (i.e. not via a gateway). This computer is running XP, has a primary network interface over WLAN (local IP 192.168.1.69 (DHCP assigned), default gateway 192.168.1.254, subnet mask 255.255.255.0) and I do not use the ethernet for other connections.

How should I setup the network? Normally, you'd use the default settings with DHCP to get an IP address assigned, however now, I think I have to set this up manually. Is this correct? How should I setup the ethernet configuration on my computer?

The ENC28J60 and its PIC's configuration use the IP address 192.168.0.140 for themselves, and 192.168.0.1 for the default gateway.

\$\endgroup\$
  • \$\begingroup\$ I'm not sure if this is the correct / best place to ask this. Perhaps Super User or Server Fault are more appropriate, but I'm not familiar with those sites. Are they more appropiate? \$\endgroup\$ – Keelan Apr 21 '13 at 11:19
  • \$\begingroup\$ What are the IP-address details for your wlan o your PC? \$\endgroup\$ – jippie Apr 21 '13 at 12:16
  • \$\begingroup\$ @jippie local: 192.168.1.69 (DHCP assigned), default gateway: 192.168.1.254, subnet mask: 255.255.255.0. I added them to the question \$\endgroup\$ – Keelan Apr 21 '13 at 12:17
  • \$\begingroup\$ Ah, OK, so 192.168.0.x should work on the wired interface. \$\endgroup\$ – jippie Apr 21 '13 at 12:20
  • 1
    \$\begingroup\$ You might find this interesting software: wireshark.org It is commonly called a sniffer and can spit out all data/packets it receives/sends on one or more interfaces. You want to filter on your wired interface. Mind you that many institutions like universities have this kind of software on their black list, you are not allowed to have it installed. This is because you can often easily find usernames/passwords and other personal infomation on the network. \$\endgroup\$ – jippie Apr 21 '13 at 12:22
2
\$\begingroup\$

The gateway is a just a default network node used to find addresses not in the routing table. Wikipedia has quite a good article that explains it here:

Default gateway

But in your case for a start I'd set the computer to have a fixed IP address of 192.168.0.1 which should work, later you can use 'route print' to see how XP sets up the routing table for that device, but it may not appear depending on other settings. You can setup mutiple IP addresses per adapter so your 'other stuff' like the Internet will still work.

\$\endgroup\$
  • \$\begingroup\$ The gateway has nothing to do with routing tables. The gateway is where a node will send a packet when the destination IP address is not on its local net. \$\endgroup\$ – Olin Lathrop Apr 21 '13 at 12:40
2
\$\begingroup\$

What you want to do is set up static addresses. The address assigned to your PC when it is connected to your LAN is irrellevant. You are trying to set up your own LAN consisting of only the PC and the PIC, if I understand your question correctly.

Pick something, like 192.168.0.xxx addresses. In that case, you can set up your net like this:

Network mask: 255.255.255.0
router:       192.168.0.1
PC:           192.168.0.2
PIC:          192.168.0.3

Actually the router doesn't matter because there is no router, but the PC software will probably make you fill in something. You can make the three addresses anything from 1 to 254 within the same network. It doesn't matter as long as they are unique.

You should also use a crossover cable if you are connecting two end devices directly to each other. Some device can auto-flip, so this might not be necessary.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.