From d050581ad1d1fc940e3f124af20096fffc33cc62 Mon Sep 17 00:00:00 2001 From: mborgerson Date: Sat, 30 May 2020 18:36:12 -0700 Subject: [PATCH] Created Networking (markdown) --- Networking.md | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 Networking.md diff --git a/Networking.md b/Networking.md new file mode 100644 index 0000000..20af2f8 --- /dev/null +++ b/Networking.md @@ -0,0 +1,101 @@ +Networking Options +------------------ +xemu emulates the Xbox network controller (nvnet), and being built on top of +QEMU's robust networking support infrastructure, provides a flexible array of +advanced network configuration options. There are two network backends exposed +in the Network configuration window for xemu: + +- **User (NAT)**: In this networking mode, a full TCP/IP stack is running within + xemu, and network address translation is used to route packets between the + internal network and the outside world. +- **Socket**: In this networking mode, all traffic that would be sent/recieved by + the emulated NIC is simply encapsulated in UDP datagrams and forwarded to a + remote host, which could be another instance of xemu or perhaps a real Xbox + (see [l2tunnel](github.com/mborgerson/l2tunnel) for more information). This + is useful for quickly setting up a virtual LAN. + +Tips +---- + +### Connect to an FTP server hosted inside xemu +If you have an alternative dashboard that runs an FTP server (as almost all +replacement dashboards do), you can easily connect to that FTP server to read +or write files on the virtual hard disk. + +#### Step 1: Enable user networking + +In xemu, open the Network window by navigating to +MachineNetwork. If networking is currently +enabled, click Disable. From the "Attached To" combo box, select +"User (NAT)", then click Enable. + +#### Step 2: Forward port 21 + +Because xemu is configured to use "user networking", we must configure xemu +to forward FTP traffic on the host machine to the internal network. There is +not a fancy GUI to do this yet, but we can easily do this using the monitor. + +In xemu, open the Monitor window by navigating to +DebugMonitor. In the box at the bottom of the +Monitor window, paste the following command and press Enter: + +``` +hostfwd_add xemu-netdev tcp:127.0.0.1:2121-:21 +``` + +Now xemu will begin listening on TCP port 2121 for new connections, and forward +that traffic to the internal network. + +#### Step 3: Connect using your FTP client +The [Filezilla FTP client](https://filezilla-project.org/) is recommended. It +is an open-source client available for all major platforms. If you would +prefer to use another client, look for the respective settings in your client +mentioned in this section. + +Now, assuming that you are using Filezilla, start the client. Let's first +create a new "Site" by navigating to FileSite +Manager, then in the "Site Manager" window, click the New +Site button. + +* Enter "xemu" for the site name +* For "Host" enter `127.0.0.1` and for "Port" enter `2121` +* For "Encryption" select "Only use plain FTP (insecure)" +* For "Logon Type" select "Normal" +* Enter the appropriate "User" and "Password" (typically `xbox` for both) +* Navigate to the "Transfer Settings" tab and select "Active" +* Click OK when you are finished + +We must configure one more additional setting. + +* Navigate to the settings window via EditSettings... +* On the left-hand side, navigate to ConnectionFTPActive mode +* In the "Active mode IP" group, select "Use the following IP address:" and enter `10.0.2.2` +* **Uncheck** "Don't use external IP address on local connections." +* Click OK when you are finished + +You can now open the "Site Manager" window again, select "xemu", and click the Connect button. + +
+More details about the FTP protocol for the curious... +FTP has two modes, passive and active. + +Passive mode involves the client first connecting to the server for control and +then again on another port other for data. The client first connects, then the +server gives it another address and port to connect to for data. The first +problem with this is that the server reports to the client the only IP address +that it knows (10.0.2.15) which is not correct for our needs--we need 127.0.0.1. +That's alright because we can override this in Filezilla. The second problem is +that we don't know which port the server is going to choose, so we can't forward +it ahead of time. + +In active mode, the client first connects to the server, then the server +connects to the client! The client needs to give the IP address for the server +to connect to. By default, it will give your computer's IP address, but the +guest cannot connect to using that IP. So instead we need to override this +setting and provide the IP address that the guest should connect to to actually +connect to the host, which is 10.0.2.2. +
+ +Note: To prevent interference with other FTP servers that you might connect to, +you may want to adjust your settings and disable the "Active mode IP" override +when you have finished transferring files. \ No newline at end of file