Comments (4)
as you guess, LKL_HIJACK_NET_GATEWAY is used to configure route info of LKL stack. just do like ip route add default
; no tap device specific and no relations to host kernel device.
(crafted from tests/hijack-test.sh, not tested yet)
sudo brctl addbr br0
sudo brctl addif eth0 (which is connected to 192.168.13.254, gateway, for instance)
sudo brctl addif lkl_ptt0
LKL_HIJACK_NET_TAP=lkl_ptt0 LKL_HIJACK_NET_IP=192.168.13.2 LKL_HIJACK_NET_NETMASK_LEN=24 LKL_HIJACK_NET_GATEWAY=192.168.13.254 ${hijack_script} ./ping 8.8.8.8
as you can see, LKL_HIJACK_NET_GATEWAY=192.168.13.254 is the key part.
from linux.
Is your example assuming that the LKL and the host are on the same network? What if I only want the LKL to be able to talk to the host? For example the host may have eth0 IP 10.x.x.x while LKL is 192.168.13.x.
from linux.
If you just want LKL to be able to talk to the host, the easiest (and to some extent unclean) way is shown in the tools/lkl/tests/hijack-test.sh
: Create a tap device (in the host) and set it up to be in the same network as you configure LKL. Then you don't need a gateway at all (as the machines are in the same network) and you can communicate between host and LKL directly without problems. The host's traffic to other networks (your home/company network or "the internet") is not affected by the setup from hijack-test.sh
at all. So it is a safe setup if you only want "host-only" networking in LKL.
A gateway is only needed to forward traffic from one network to another and must be reachable in both networks. So, in your example with the host's only address in the 10.0.0.0/8 network and LKL in 192.168.13.0/24, you need to have a gateway between the two networks. In order to set one up, you have to add a tap device (in addition to your eth0), put in in the 10.0.0.0/24 network, and set up NAT on your host, including proper iptables entries to forward packets from one network/device to the other.
And yes, @thehajime's example only works when both, LKL and the host are in the 192.168.13.0/24 network (and eth0 is not configured as 192.168.13.2) :-)
from linux.
Okay, thanks! The issue I was having was that I was running netserver
under LKL and I couldn't get a netperf
instance on the host to talk to it. I was able to get it connected after messing with the routing table to stop the host kernel from trying to go through lo
and then changing LKL_HIJACK_NET_NETMASK_LEN
so that the host and LKL were on the same subnet. I'm having an issue now with LKL's netserver
hanging; I'll probably open another issue about that if I can't get it resolved.
from linux.
Related Issues (20)
- Start kernel in single threaded mode HOT 1
- Asking for a port to arm64 of "Unifying LKL into UML"
- How to switch between different kernel versions? HOT 1
- IWL-WiFi + FreeBSD
- Compilation under different kernel versions HOT 1
- Status of `Unifying LKL into UML` (v8, Jan 2021) ? HOT 6
- Investigate LKL strncpy and KASAN error
- LKL build target clean-conf doesn't clean .config
- Unable to mount btrfs filesystems spread across more than one partition with lklfuse HOT 4
- Ask for android build related help HOT 2
- LKL is potentially affected by 10 known CVEs HOT 3
- http benchmarking isn't working well
- network performance
- Failed to run lkl hijack on android 10 HOT 6
- can lkl based app run on vm HOT 4
- Interested in participating, cannot join mailing list or slack HOT 2
- split some tools out from the main Linux repo HOT 2
- drop tools/lkl/bin binaries HOT 1
- Updates about Unifying LKL into UML? HOT 1
- allow builds with CONFIG_NET disabled
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 linux.