-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Can CBSD support a dynamic host IP? #61
Comments
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:
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? |
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. |
it seems easy to implement: olevole@09c4a25 natcfg can now be not only IPv4 but also as network interface (re0, vtnet0, ..). 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:
(where /usr/jails is workdir)
|
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. |
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. |
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 ) |
Yes sorry only just noticed the docs. Tested it and new nat feature works fine from bootup. Good work. |
Excellent! I'll take it in the CBSD 10.3.0 release ( waiting for FreeBSD 10.3-RELEASE ) |
Hi. The documentation says that the nodeip should be the:
This is fine for most use cases, but not for mine, as I travel a lot with my laptop, and connect to many different wifi hotspots (work, home, hotel). This breaks the connectivity of my jails. So is it possible to use DHCP assigned IP with cbsd rather than static? That would save me the time of editing static IP in /etc/rc.conf and NAT rules (ipfw/pf) each time.
Or perhaps the nodeip is not essential to the jail management? Could I leave it blank, and just edit the NAT rules to use the wlan0 interface IP, rather than a static IP? I remember ipfw rules support the
to me
syntax to get the DHCP assigned IP of the interface.If this is not possible, would you consider adding a feature to cbsd to support roaming between locations through wifi with jails?
Thanks. I realise my use case is unusual, but I can't be the only one that uses jails on the move to test and develop. I'm sure some people could benefit from a roaming jail setup.
The text was updated successfully, but these errors were encountered: