Giter Club home page Giter Club logo

Comments (8)

olevole avatar olevole commented on May 20, 2024

Hi!

"nodeip" must be static and it plays a role only if you have added one CBSD node to the other node ( via cbsd node mode=add ... )

in other cases (eg, local jails management) it is not essential.

So, if your jail have private (rfc1918) IP, but your laptop often gets a new address, all you have to do - is to enter a new IP address of node for NAT - rules forming and apply automatically:

This is two commands:

% cbsd natcfg     ( enter new IP )
% cbsd naton

Do I understand correctly that you're talking about the last example - you work only with local jail (and jails have private IP). And you want to IP NAT was taked from specified interface automatically, instead of fixed/hardcoded IP?

from cbsd.

rodyaj avatar rodyaj commented on May 20, 2024

Yes, you have correctly understood my issue. Using 'natcfg' and 'naton', I will make a script to set the natip from my DHCP assigned IP automatically. Or maybe I will just rewrite /usr/jails/etc/ipfw.conf to use 'to me' syntax.

Thanks.

from cbsd.

olevole avatar olevole commented on May 20, 2024

it seems easy to implement: olevole@09c4a25

natcfg can now be not only IPv4 but also as network interface (re0, vtnet0, ..).
The algorithm in this case is simple - on naton stage, first IPv4 was taken on the interface as natip ( This means that the IP must be initialized before CBSD starting)

At this point I'm assuming that a dynamic IP does not change during ONE system boot.

In other words, if you move the running laptop between WiFi/hotspot networks or switch ethernet cable and issued a new IP address - you'll have to run the command cbsd naton every time.

You can test new changes by swithing from port version to github CBSD-current:

  1. get git:
pkg install git
  1. remove installed version of CBSD ( it is safe for jail data):
% pkg remove cbsd
  1. If some files exist after removing in /usr/local/cbsd, remove it by hands:
rm -rf /usr/local/cbsd
  1. Clone develop-version from GH:
git clone https://github.com/olevole/cbsd.git /usr/local/cbsd
  1. Restore symlinks for bsdconfig module:
mkdir /usr/local/libexec/bsdconfig
ln -sf /usr/local/cbsd/share/bsdconfig/cbsd /usr/local/libexec/bsdconfig/cbsd
  1. Restore rc.d script via symlink:
ln -sf /usr/jails/rc.d/cbsdrsyncd /usr/local/etc/rc.d/cbsdrsyncd
ln -sf /usr/jails/rc.d/cbsdd /usr/local/etc/rc.d/cbsdd

(where /usr/jails is workdir)

  1. Upgrade CBSD code in your workdir from /usr/local/cbsd:
cbsd initenv
  1. Clean object files in /usr/local/cbsd:
make -C /usr/local/cbsd clean

from cbsd.

rodyaj avatar rodyaj commented on May 20, 2024

Thanks for taking the time to do this. I will test it tomorrow, as I am away from a computer right now. Your changes seem reasonable though.

from cbsd.

rodyaj avatar rodyaj commented on May 20, 2024

Hi. I am trying to test this on a fresh freebsd install without cbsd, but cannot find the cbsd executable after cloning into /usr/local/cbsd and running 'make' with the required dependencies.

from cbsd.

olevole avatar olevole commented on May 20, 2024

For fresh install you need repeat steps with initenv:

% env workdir="/usr/jails" /usr/local/cbsd/sudoexec/initenv

See: http://www.bsdstore.ru/en/installing_cbsd.html#preparing ( 1b) Installing experimental (development) version of CBSD from github )

from cbsd.

rodyaj avatar rodyaj commented on May 20, 2024

Yes sorry only just noticed the docs. Tested it and new nat feature works fine from bootup. Good work.

from cbsd.

olevole avatar olevole commented on May 20, 2024

Excellent! I'll take it in the CBSD 10.3.0 release ( waiting for FreeBSD 10.3-RELEASE )

from cbsd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.