[En-Nut-Discussion] Ethernut as router

Nic Cave-Lynch nic at tymar.com
Sat Nov 27 01:29:04 CET 2004


Hi all

I want to route packets between (eg) the Ethernet and a PPP interface. 
 From what I've read so far, it seems as though I can only do this by 
chopping the NutIpInput() function. I don't mind doing this, but I was 
wondering if there's a more 'official' way of doing it. Any suggestions?

As part of the work on the NutIpInput() function, I want to know what 
the IP address of the two interfaces is (so I can run an internal HTTP 
server for configuring the router), and that's where I got _really_ 
confused. It seems that any call to NutNetIfConfig() will eventually 
write the IP address to the global confnet structure. So if I configure 
the Ethernet interface with one IP address, and then the PPP interface 
comes up and I configure that with the address given by the remote, I 
lose the Ethernet IP address. Am I missing something here?

I gather other people have done this sort of thing so can anyone give 
pointers to the general approach? Or do people not do routing at the IP 
(Layer 2) level? I'm sure I can make something work, but I get the 
feeling I'd be fighting NutNet, rather than working with it, which 
doesn't seem right, (and also risks breaking as OS versions change), so 
I was hoping if there are any pointers to the 'right' way of doing this.

Thanks

Nic C-L




More information about the En-Nut-Discussion mailing list