kvm virtualization – QEMU VM with tap interface sees all packages coming from hypervisor instead of real source IP

I have set up a very simple Hypervisor using Alpine Linux and my VM sees all traffic coming from the IP of the hypervisor.

Which also means if fail2ban tries to block attacks, it always blocks the hypervisors IP

How can I have the VM see the real IP Adresses and not just the IP of the hypervisor?

On the HV (192.168.5.5) I have a bridged interface br0 which is working fine

# tun1 setup script on Hypervisor
iptables -t nat -A POSTROUTING -o br0 -j MASQUERADE
iptables -P FORWARD ACCEPT
ip tuntap add dev tap1 mode tap user root
ip link set dev tap1 up
ip link set tap1 master br0

qemu-system-x86_64 (..non related parameters removed ..) 
-device virtio-net-pci,netdev=network0,mac=02:1f:ba:26:d7:56 
-netdev tap,id=network0,ifname=tap1,script=no,downscript=no

The VM has internet access but all traffic it sees comes from the IP of the hypervisor.

Someone is even trying to use my Server for an DNS amplification attack (blocked outgoing on my PFSense Firewall though)
DNS amplification attacks

Fail2ban also blocking the wrong IP
fail2ban log showing blocked HV ip

c++ – Monthly Cost for House Code – Output not coming out correctly

My output is returning 0 for the value for the costs and I am not sure why.

#include <iostream>
#include <iomanip>
#include <cmath>

#define TAXRATE 0.0125
#define UTILITIES 300.00
#define INSURANCE 550.00

using namespace std;

// Function Prototypes
void getInput(double& sellPrice, double& interestRate, int& numYears);
void calcAll(double sellPrice, double interestRate, int numYears, double downPayment, double downPaymentRate, double loanAmount, double mortgage, double propertyTax, double insurance, double total);
double calcDownPayment(double sellPrice, double downPaymentRate);
double calcLoanAmount(double sellPrice, double downPayment);
double calcMortgage(double loanAmount, double interestRate, int numYears);
void output(double sellPrice, double interestRate, int numYears, double downPayment, double loanAmount, double mortgage, double propertyTax, double insurance, double total);
int main() {
    
// Non-global memory constant
    const double downPaymentRate = 20.0;
    
// Declare variables
    int numYears;
    double sellPrice, interestRate, mortgage, total, propertyTax, insurance, loanTime, loanAmount, downPayment;
    
// Input the data from the user
    getInput(sellPrice, interestRate, numYears);
    
// Calculate monthly cost
    calcAll(sellPrice, interestRate, numYears, downPayment, downPaymentRate, loanAmount, mortgage, propertyTax, insurance, total);

// Output the cost
    output(sellPrice, interestRate, numYears, downPayment, loanAmount, mortgage, propertyTax, insurance, total);
    
    
    return 0;
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
              
void getInput(double& sellPrice, double& interestRate, int& numYears)
{
/* Pre: sellPrice - reference to the sell price of the house
        interestRate - reference to the rate of interest per compounding period
        numYears - reference to the number of years for the loan
   Post: nothing
   Purpose: Enter the data for sell price, interest rate, and duration of loan
*/
                  
    cout << "How much was the house sold for? ";
    cin >> sellPrice;
                  
    cout << "What is the interest rate? ";
    cin >> interestRate;
                  
    cout << "Enter the number of years for the loan: ";
    cin >> numYears;
                  
}

void calcAll(double sellPrice, double interestRate, int numYears, double downPayment, double downPaymentRate, double loanAmount, double mortgage, double propertyTax, double insurance, double total)
{
/* Pre: sellPrice - sell price of house
        interestRate - interest rate
        numYears - duration of loan
        downPayment - down payment for house
        downPaymentRate - down payment percentage cost for the house
        loanAmount - amount that is loaned to user
        mortgage - mortgage owed for house
        propertyTax - property taxe owed for house
        insurance - insurance owed for house
   Post: nothing
   Purpose: Calculate the amounts for each function
*/
    downPayment = calcDownPayment(sellPrice, downPaymentRate);
    
    loanAmount = calcLoanAmount(sellPrice, downPayment);
    
    mortgage = calcMortgage(loanAmount, interestRate, numYears);
    
    insurance = INSURANCE / 12.0;
    
    propertyTax = (sellPrice * TAXRATE) / 12.0;
    
    total = mortgage + UTILITIES + propertyTax + insurance;
}

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

double calcDownPayment(double sellPrice, double downPaymentRate)
{
/* Pre: sellPrice - sell price of house
        downPaymentRate - down payment percentage cost for the house
   Post: down payment amount
   Purpose: Calculate the down payment amount owed
*/
    double monthlyDownPayment;
    
    monthlyDownPayment = (sellPrice * downPaymentRate) / 12.0;
    
    return monthlyDownPayment;
}

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
              
double calcMortgage(double loanAmount, double interestRate, int numYears)
{
/* Pre: interestRate - rate of interest per compounding period
        numYears - number of years for the loan
        loanAmount - amount loaned for the house
        Post: mortgage cost
        Purpose: Calculate the mortgage cost
*/
                  
// Declare variables
    double loanTime = numYears * 12.0;
    double loan = loanAmount;
    double interest = (interestRate / 100.0) * 12.0;
    double mortgage;
                  
// Calculate mortgage
mortgage = ((loan * interest) * (pow(1.0 + interest, loanTime)))
    / (pow(1.0 + interest, loanTime) - 1.0);
                  
return mortgage;
}
              
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

double calcLoanAmount(double sellPrice, double downPayment)
{
/* Pre: sellPrice - sell price of house
        downPayment - down payment cost of the house
        Post: loan amount
        Purpose: Calculate the loan amount
*/
    double loanAmt;
    
    loanAmt = sellPrice - downPayment;
    
    return loanAmt;
}
              
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

void output(double sellPrice, double interestRate, int numYears, double downPayment, double loanAmount, double mortgage, double propertyTax, double insurance, double total)
{
    /* Pre: sellPrice - sell price of house
            interestRate - interest rate
            numYears - duration of loan
            downPayment - down payment for house
            downPaymentRate - down payment percentage cost for the house
            loanAmount - amount that is loaned to user
            mortgage - mortgage owed for house
            propertyTax - property taxe owed for house
            insurance - insurance owed for house
       Post: nothing
       Purpose: Output the monthly cost
    */
    
    cout << setprecision(2) << fixed;
    cout << endl;
    cout << "MONTHLY COST OF HOUSE       " << endl << endl;
    cout << "SELLING PRICE             $ " << sellPrice << endl;
    cout << "AMOUNT OF LOAN            $ " << loanAmount << endl;
    cout << setprecision(1) << fixed;
    cout << "INTEREST RATE               " << interestRate << "%" << endl;
    cout << "TAX RATE                    " << TAXRATE << "%" << endl;
    cout << "DURATION OF LOAN (YEARS)    " << numYears << endl << endl;
    cout << setprecision(2) << fixed;
    cout << "MONTHLY PAYMENT             " << endl;
    cout << "      MORTGAGE            $ " << mortgage << endl;
    cout << "      UTILITIES           $ " << UTILITIES << endl;
    cout << "      PROPERTY TAXES      $ " << propertyTax << endl;
    cout << "      INSURANCE           $ " << insurance << endl;
    cout << "                         ___________" << endl;
    cout << "                          $ " << total << endl;
    
}

        

Here is my output:

How much was the house sold for? 600000
What is the interest rate? 5
Enter the number of years for the loan: 20

MONTHLY COST OF HOUSE       

SELLING PRICE             $ 600000.00
AMOUNT OF LOAN            $ 0.00
INTEREST RATE               5.0%
TAX RATE                    0.0%
DURATION OF LOAN (YEARS)    20

MONTHLY PAYMENT             
      MORTGAGE            $ 0.00
      UTILITIES           $ 300.00
      PROPERTY TAXES      $ 0.00
      INSURANCE           $ 0.00
                         ___________
                          $ 0.00

If anyone could please provide information as to why my output doesn’t output the functions that I called, that would be very helpful!

event based effects – When is FlixTrain coming to Sweden?

A poster here says that at least some of their assigned schedule is cancelled until Aug 30, which is short after the track closure between Malmö and Lund. So it would surprise me if they start before August (between Stockholm and Gothenburg they could start in mid August after the track closure in Stockholm), rather they might continue to push the launch forward until they are ready.

ITS COMING HOME

Just a quick note to let everyone know… ITS COMING HOME.

windows – Strange error coming up whenever I try to install/run any application that deals with Network in some/other way

As I laid out in the question title, I am getting the below error whenever I attempt to install (or run executable of) any software that deals with Network / Internet(maybe for firing HTTPS connections ?) in some way:
enter image description here

I tried installing and running Internet Download Manager(IDM) and Anydesk applications from fresh source files, and I know that some while ago these were easily getting installed and executed on-user-demand, but now this error shows up when trying to run Anydesk/IDM, so it’s not related to these softwares but with OS.

I confess that I did try to change permissions and access control of %SystemRoot%Temp folder and then perhaps went too far and ran delete command on it’s files, but I am sure I didn’t deleted unpermitted ones(ones that are in use by process(es)).

Then how could such a weird and unusual error crept in ?? Moreover how do I resolve this in proper way without needing to format-and-reinstall-Win10 ?

❕NEWS – Biggest Crash in History Coming Says Robert Kiyosaki, Bitcoin Can Help. | NewProxyLists

Robert Kiyosakii is 74 years old, the author of The “Rich Dad, Poor Dad” and his is a Financial literacy mogul who has predicted the likely prices of Bitcoin at certain period in which most has come to reality. In his recent tweet he said “biggest crash in history” is coming again this month. He however backs Gold, silver and bitcoin as assets that could help people to survive the hard time .
He expects that bitcoin will crash to $24,000 and will be a long one and he plans to buy it then as he said the best time to prepare for a crash is before the crash. Share your opinion.

bash – how to remove the junk data coming on script output when loading variables on a script?

I wanted to load a secret value like a password when using a script on bash. I found this method of loading from a file rather exporting on bash profile.

I wrote this sample script to test it

$cat run.sh
echo $val1
echo "-line1----"
set -o
source /tmp/file.txt
set +o
echo $val1
echo $val2
echo "--line2---"
echo $val2

Seems it is working good , but when I run the script , I see output as


-line1----
allexport       off
braceexpand     on
emacs           off
errexit         off
errtrace        off
functrace       off
hashall         on
histexpand      off
history         off
ignoreeof       off
interactive-comments    on
keyword         off
monitor         off
noclobber       off
noexec          off
noglob          off
nolog           off
notify          off
nounset         off
onecmd          off
physical        off
pipefail        off
posix           off
privileged      off
verbose         off
vi              off
xtrace          off
set +o allexport
set -o braceexpand
set +o emacs
set +o errexit
set +o errtrace
set +o functrace
set -o hashall
set +o histexpand
set +o history
set +o ignoreeof
set -o interactive-comments
set +o keyword
set +o monitor
set +o noclobber
set +o noexec
set +o noglob
set +o nolog
set +o notify
set +o nounset
set +o onecmd
set +o physical
set +o pipefail
set +o posix
set +o privileged
set +o verbose
set +o vi
set +o xtrace
value1
value2
--line2---
value2

Can someone help me with

  1. what are those values or suggestions on screen ? how to ignore them when I run a script?
  2. once the script is done, on command like I tried
$echo $val1

and got no result. So it seems like working and being used on script only.
But I feel this is a security issue in a different level that, one knows the path of file can read the values as they are in plane text. Is there any better way?

Batch file getting killed off when coming out of diskpart

I am working on a batch file that starts off partitioning a new hard drive and then using dism to apply an image
It’s being ran off a usb.
It starts off with a disk part script that changes the USB to the i drive then formats the disk and assigns the hard drive to c:
Which works well but then when it leaves disk part it can no longer find the path to where it was because it’s move from c to p. If i run it again it works because the directory does not change. So is there anyway to force the directory to change before coming out of diskpart?
Thanks in advance

python – Detect audio coming from microphone

Ive seen other questions similar to this, but they all involve detecting audio and then recording. I’d like my microphone connected to my computer to always be recording, and any time audio is detected it runs another part of a script. What modules would I need? How would I do this? Im pretty sure this would involve seeing when the audio volume goes above a certain point and then activating the rest of the script, because obviously there will always be some sort of sound coming from the microphone.

uk – Can I interrupt quarantine to go get the 2nd dose of the vaccine after coming back from an amber list-country?

From here I read

If you have been in a country or territory on the:

  • […]
  • amber list – you must quarantine in the place you’re staying and take 2 COVID-19 tests

This makes me think I can’t leave the house, not even to only go to the place where I can get the 2nd dose of the vaccine.

I’m asking anyway to understand if that’s the case or not.