Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

orjail do not honors the "-r, --routing" option #95

Open
Roberto-MN opened this issue Aug 31, 2023 · 0 comments
Open

orjail do not honors the "-r, --routing" option #95

Roberto-MN opened this issue Aug 31, 2023 · 0 comments

Comments

@Roberto-MN
Copy link

Roberto-MN commented Aug 31, 2023

I typed the following line at the terminal:
sudo orjail -v -s -r 10.200.219.2 10.200.219.1 30

When I check the IPs by typing "ifconfig -a", the IPs shown are not those typed in the command line, are random IPs. I tried to correct this defect by editing the "orjail" file and putting an "if" to test the command line values. The code stretch was as follows:


  if [ "${IPHOST}x" = "x" -a "${IPNETNS}x" = "x" ];then
    # generate a random available address from specified subnet mask
    set +e
    USEDADDR=$(ip addr show type veth| grep -Po 'inet \d+.\d+.\K(\d+)')
    for available_subnet in $(shuf -i 1-255 -n 254); do
      if ! echo "$USEDADDR" | eno grep "^$available_subnet$"; then
        break
      fi
    done
    set -e
    IPHOST=${IPHOSTMASK//x/$available_subnet}
    IPNETNS=${IPNETNSMASK//x/$available_subnet}
  fi

Is it right? Can I do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant