Comments (6)
Hello! Do you use FreeRTOS+LWIP to implement Wireguard on STM32F407? Can you share your project?
from wireguard-lwip.
Sorry I do not use an RTOS, I prefer being in control of my code ;)
from wireguard-lwip.
Sorry I do not use an RTOS, I prefer being in control of my code ;)
thanks!
Can you really realize it using STM32F407?
I compiled it according to the demo provided by the author. But
wg_netif = netif_add(&wg_netif_struct, &ipaddr, &netmask, &gateway, &wg, &wireguardif_init, &ip_input);
There seems to be a problem with this function. Do you know what's going on here?
from wireguard-lwip.
Set it up and my WG implementation is in the attached ZIP file, hope it is of some use!
I also got it working with ESP32
static void wireguard_setup()
{
struct wireguardif_init_data wg;
struct wireguardif_peer peer;
ip_addr_t ipaddr = IPADDR4_INIT_BYTES(WIREGUARD_IPADDRESS[0], WIREGUARD_IPADDRESS[1], WIREGUARD_IPADDRESS[2], WIREGUARD_IPADDRESS[3]);
ip_addr_t netmask = IPADDR4_INIT_BYTES(WIREGUARD_SUBNET[0], WIREGUARD_SUBNET[1], WIREGUARD_SUBNET[2], WIREGUARD_SUBNET[3]);
ip_addr_t gateway = IPADDR4_INIT_BYTES(WIREGUARD_GW[0], WIREGUARD_GW[1], WIREGUARD_GW[2], WIREGUARD_GW[3]);
// Setup the WireGuard device structure
wg.private_key = &WIREGUARD_MY_PRIV;
wg.listen_port = WIREGUARD_LISTENPORT;
wg.bind_netif = NULL;
// Register the new WireGuard network interface with lwIP
wg_netif = netif_add(&wg_netif_struct, &ipaddr, &netmask, &gateway, &wg, &wireguardif_init, &ip_input);
// Mark the interface as administratively up, link up flag is set automatically when peer connects
netif_set_up(wg_netif);
// Initialise the first WireGuard peer structure
wireguardif_peer_init(&peer);
peer.public_key = &WIREGUARD_THEIR_PUB;
peer.preshared_key = NULL;
// Allow all IPs through tunnel
IP4_ADDR(&peer.allowed_ip, 0, 0, 0, 0);
// peer.allowed_ip = IPADDR4_INIT_BYTES(0, 0, 0, 0);
IP4_ADDR(&peer.allowed_mask, 0, 0, 0, 0);
// peer.allowed_mask = IPADDR4_INIT_BYTES(0, 0, 0, 0);
// If we know the endpoint's address can add here
IP4_ADDR(&peer.endpoint_ip, WIREGUARD_ENDPOINTIP[0], WIREGUARD_ENDPOINTIP[1], WIREGUARD_ENDPOINTIP[2], WIREGUARD_ENDPOINTIP[3]);
// peer.endpoint_ip = IPADDR4_INIT_BYTES(10, 0, 0, 12);
peer.endport_port = WIREGUARD_LISTENPORT;//51820;
// Register the new WireGuard peer with the netwok interface
wireguardif_add_peer(wg_netif, &peer, &wireguard_peer_index);
if ((wireguard_peer_index != WIREGUARDIF_INVALID_INDEX) && !ip_addr_isany(&peer.endpoint_ip)) {
// Start outbound connection to peer
wireguardif_connect(wg_netif, wireguard_peer_index);
}
from wireguard-lwip.
Looks like the paste got a bit screwed!
from wireguard-lwip.
Looks like the paste got a bit screwed!
WGSetup.txt
Thank you very much
from wireguard-lwip.
Related Issues (12)
- Implementation on ESP8266 HOT 3
- handshake_destroy
- Chacha20poly1305 enc/dec function not symmetrical
- wireguardif_init crashes the program?
- Crash on esp8266 arduino ide HOT 6
- Replay window is only 4 packets wide, instead of 32 HOT 1
- wireguard_check_replay() always rejects first data packet of session HOT 1
- about keypair_update HOT 1
- esp32 device as the vpn server HOT 8
- Problem with wireguard-lwip on esp32C3 using esp-if latest version (5.0), is it possible to work on this version ? HOT 7
- How to send packts through WireGuard-Tunnel? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wireguard-lwip.