To activate natd support you need to compile Kernel with following option:
options IPDIVERT
After that we can need to run at startup:
natd -interface rl1 (rl1 is my external interface)
/sbin/ipfw add 7 divert natd all from any to any via rl1 (this rule make nat to all internat packets)
7 is the number of rule.
If you have a internal routed subnet you can make nat without this.
/sbin/ipfw add 7 divert natd all from not A.B.C.D/29 to any via rl1
Aici veti gasi detalii tehnice despre cum se pot realiza configurari software+ hardware.
Here you can find tehnical details about software/hardware configuration.
Arhivă blog
duminică, 2 aprilie 2017
vineri, 10 februarie 2017
VirtualBox under console (VBoxManage)
I need to have virtual machines in servers without GUI. In this case I must configure virtual machines only with VBoxManage utility.
In first step i make/install MV under GUI version of VirtualBox and after that copy on guest server.
After that we need to register virtual machine.
vboxmanage registervm /path-to/vbox file
and start
VBoxManage startvm "Test" --type headless
When we need to shutdown virtual machine:
VBoxManage controlvm "Test" acpipowerbutton
or
VBoxManage controlvm "Test" poweroff
To view some information about virtual machine:
vboxmanage showvminfo /opt/vm/Test/Test.vbox
When we need to modify number of CPU. Stop virtual machine and afler that:
VBoxManage modifyvm "Test" --cpuhotplug on
VBoxManage modifyvm "Test" --cpus 4
To modify memory:
VBoxManage modifyvm "Test" --memory 4096
To delete network interface:
VBoxManage modifyvm "fbsd" --nic1 none
To add bridged interface:
VBoxManage modifyvm fbsd --nic1 bridged --bridgeadapter1 em1
To modify IP address
only if you have vboxguestadditions installed
# VBoxManage guestproperty get "Test" "/VirtualBox/GuestInfo/Net/0/V4/IP"
No value set!
# VBoxManage guestproperty set "Test" "/VirtualBox/GuestInfo/Net/0/V4/IP" 192.168.101.215
# VBoxManage guestproperty get "Test" "/VirtualBox/GuestInfo/Net/0/V4/IP"
Value: 192.168.101.215
# VBoxManage guestproperty get "Test" "/VirtualBox/GuestInfo/Net/0/V4/Netmask"
No value set!
# VBoxManage guestproperty set "Test" "/VirtualBox/GuestInfo/Net/0/V4/Netmask" 255.255.255.0
# VBoxManage guestproperty get "Test" "/VirtualBox/GuestInfo/Net/0/V4/Netmask"
Value: 255.255.255.0
# VBoxManage guestproperty get "Test" "/VirtualBox/GuestInfo/Net/0/V4/Gateway"
No value set!8
# VBoxManage guestproperty set "Test" "/VirtualBox/GuestInfo/Net/0/V4/Gateway" 192.168.101.1
To add virtual machine in bridge with network interfcace:
VBoxManage controlvm "Test" nic1 bridged em1
When we have this error:
==================
Waiting for VM "Test" to power on... VBoxManage: error: VT-x is disabled in the BIOS for all CPU modes (VERR_VMX_MSR_ALL_VMX_DISABLED)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole
===================
must enable Virtualisation Technology in BIOS.
To view all os types supported by VBoxManasge
VBoxManage list ostypes (guest)
A short example: VBoxManage modifyvm "vm" --ostype Linux24_64
If you have following error:
This kernel requires an x86-64 CPU, but only detected an i686 CPU. Unable to boot – please use a kernel appropriate for your CPU
Just enable:
VBoxManage modifyvm "vm" --longmode on
To make a screenshot via console:
VBoxManage controlvm "vm" screenshotpng screen-shot-dev-006.png
Other posibile problems:
If you have:
# VBoxManage startvm "vm"
VBoxManage: error: Invalid frontend name: 'GUI/Qt'
In first step i make/install MV under GUI version of VirtualBox and after that copy on guest server.
After that we need to register virtual machine.
vboxmanage registervm /path-to/vbox file
and start
VBoxManage startvm "Test" --type headless
When we need to shutdown virtual machine:
VBoxManage controlvm "Test" acpipowerbutton
or
VBoxManage controlvm "Test" poweroff
To view some information about virtual machine:
vboxmanage showvminfo /opt/vm/Test/Test.vbox
When we need to modify number of CPU. Stop virtual machine and afler that:
VBoxManage modifyvm "Test" --cpuhotplug on
VBoxManage modifyvm "Test" --cpus 4
To modify memory:
VBoxManage modifyvm "Test" --memory 4096
To delete network interface:
VBoxManage modifyvm "fbsd" --nic1 none
To add bridged interface:
VBoxManage modifyvm fbsd --nic1 bridged --bridgeadapter1 em1
To modify IP address
only if you have vboxguestadditions installed
# VBoxManage guestproperty get "Test" "/VirtualBox/GuestInfo/Net/0/V4/IP"
No value set!
# VBoxManage guestproperty set "Test" "/VirtualBox/GuestInfo/Net/0/V4/IP" 192.168.101.215
# VBoxManage guestproperty get "Test" "/VirtualBox/GuestInfo/Net/0/V4/IP"
Value: 192.168.101.215
# VBoxManage guestproperty get "Test" "/VirtualBox/GuestInfo/Net/0/V4/Netmask"
No value set!
# VBoxManage guestproperty set "Test" "/VirtualBox/GuestInfo/Net/0/V4/Netmask" 255.255.255.0
# VBoxManage guestproperty get "Test" "/VirtualBox/GuestInfo/Net/0/V4/Netmask"
Value: 255.255.255.0
# VBoxManage guestproperty get "Test" "/VirtualBox/GuestInfo/Net/0/V4/Gateway"
No value set!8
# VBoxManage guestproperty set "Test" "/VirtualBox/GuestInfo/Net/0/V4/Gateway" 192.168.101.1
To add virtual machine in bridge with network interfcace:
VBoxManage controlvm "Test" nic1 bridged em1
When we have this error:
==================
Waiting for VM "Test" to power on... VBoxManage: error: VT-x is disabled in the BIOS for all CPU modes (VERR_VMX_MSR_ALL_VMX_DISABLED)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole
===================
must enable Virtualisation Technology in BIOS.
To view all os types supported by VBoxManasge
VBoxManage list ostypes (guest)
A short example: VBoxManage modifyvm "vm" --ostype Linux24_64
If you have following error:
This kernel requires an x86-64 CPU, but only detected an i686 CPU. Unable to boot – please use a kernel appropriate for your CPU
Just enable:
VBoxManage modifyvm "vm" --longmode on
To make a screenshot via console:
VBoxManage controlvm "vm" screenshotpng screen-shot-dev-006.png
Other posibile problems:
If you have:
# VBoxManage startvm "vm"
VBoxManage: error: Invalid frontend name: 'GUI/Qt'
can try
vboxmanage startvm vm --type headless
Waiting for VM "vm" to power on...
or if you have
vboxmanage startvm vm --type headless
Waiting for VM "vm" to power on...
VBoxManage: error: Failed to open/create the internal network 'HostInterfaceNetworking-bce0' (VERR_SUPDRV_COMPONENT_NOT_FOUND).
VBoxManage: error: Failed to attach the network LUN (VERR_SUPDRV_COMPONENT_NOT_FOUND)
you can try:
load module vboxnetflt
In my case:
kldload vboxnetflt
root@# kldstat
Id Refs Address Size Name
1 14 0xffffffff80200000 17bc680 kernel
2 2 0xffffffff819bd000 7b9a8 vboxdrv.ko
3 1 0xffffffff81c11000 29d86 vboxguest.ko
4 1 0xffffffff81c3b000 358d ums.ko
5 1 0xffffffff81c3f000 2a02 vboxnetflt.ko
6 2 0xffffffff81c42000 ba02 netgraph.ko
7 1 0xffffffff81c4e000 4123 ng_ether.ko
root@# vboxmanage startvm vm --type headless
Waiting for VM "vm" to power on...
VM "vm" has been successfully started.
root@#
Mapping Ports
VBoxManage setextradata "vm" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP
VBoxManage setextradata "vm" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22
VBoxManage setextradata "vm" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 2222
VBoxManage setextradata "vm" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol" TCP
VBoxManage setextradata "vm" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort" 22
VBoxManage setextradata "vm" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort" 2222
If you install phpVirtualBox and have problems with login steps you can try to start virtualserver manually in verbose mode.
vboxwebsrv -v
If you have error VBOX_E_INVALID_VM_STATE
you can try: VBoxManage startvm "vm" --type emergencystop
and start the virtual machine again.
vboxwebsrv -v
If you have error VBOX_E_INVALID_VM_STATE
you can try: VBoxManage startvm "vm" --type emergencystop
and start the virtual machine again.
sâmbătă, 4 februarie 2017
Linux bridge not forward multicast traffic
As it turns out, it's a bug in the igmp snooping code in the kernel that's
the problem with multicast traffic not being forwarded.
This seems to affect recent versions. To check if it's turned on, run
cat /sys/devices/virtual/net//bridge/multicast_snooping
If it's 1, it's highly this is the culprit causing the non-propagation of
the multicast traffic. The solution is to turn it off by setting it 0.
In my case:
echo 0 > /sys/devices/virtual/net/br0/bridge/multicast_snooping
Source
the problem with multicast traffic not being forwarded.
This seems to affect recent versions. To check if it's turned on, run
cat /sys/devices/virtual/net/
If it's 1, it's highly this is the culprit causing the non-propagation of
the multicast traffic. The solution is to turn it off by setting it 0.
In my case:
echo 0 > /sys/devices/virtual/net/br0/bridge/multicast_snooping
Source
vineri, 23 decembrie 2016
Convert multiple files from NEF to jpeg with Ufraw (with change image attributes)
If you wish to improuve quality of pictures from RAW files you ca use Ufraw software.
I need to modify image attibutes (exposure, white balance, denoising,saturation, curves.... ) for all files from folder and export to jpeg files.
To do this I open one pictures and change all values to obtain a verry good picture. After that I click on Options -> Save configuration.
To apply changes to all pictures i run ufraw-batch utility with following sintax: (for the first step I open a command prompt in ufraw folder)
c:\Program Files\UFRaw\bin>ufraw-batch.exe f:\New\raw\*.NEF --out-type=jpeg
ufraw-batch.exe: Loaded f:\New\raw\_DSC4317.NEF [1/15]
ufraw-batch.exe: Saved f:\New\raw\_DSC4317.jpg [1/15]
ufraw-batch.exe: Loaded f:\New\raw\_DSC4318.NEF [2/15]
ufraw-batch.exe: f:\New\raw\_DSC4318.jpg [2/15]
ufraw-batch.exe: f:\New\raw\_DSC4319.NEF [3/15]
joi, 26 mai 2016
A simple check of encryption version
To debug in some situations you can use the command line tools of openssl, especially
openssl s_client. By adding the options -tls1, -tls1_1 and -tls1_2 you can test compatibility for the protocols, and with -cipher [cipherlist] for ciphers. For exampleopenssl s_client -connect example.com:443 -tls1
source
duminică, 17 aprilie 2016
Qmail remove messages with specific attached files
First you need to put in quarantine-events.txt following lines (this example is for archives):
.zip<-tab->SIZE=-1<-tab->We_not_accept_archives-tab->-tab->
.rar<-tab->SIZE=-1<-tab->We_not_accept_archives-tab->-tab->
.ace<-tab->SIZE=-1<-tab->We_not_accept_archives-tab->-tab->-tab-size>
.........
It is verry important to put TAB not space to work.
Next, run qmail-scanner-queue.pl -g and qmail-scanner-queue.pl -r
root@mail:/var/qmail/bin # ./qmail-scanner-queue.pl -g
perlscanner: generate new DB file from /var/spool/qscan/quarantine-events.txt
perlscanner: total of 3 entries.
root@mail:/var/qmail/bin # ./qmail-scanner-queue.pl -r
perlscanner: reading from /var/spool/qscan/quarantine-events.db
File: .zip
Size: Any
Description: We_not_accept_archives
File: .rar
Size: Any
Description: We_not_accept_archives
File: .ace
Size: Any
Description: We_not_accept_archives
===================================================================
.zip<-tab->SIZE=-1<-tab->We_not_accept_archives-tab->-tab->
.rar<-tab->SIZE=-1<-tab->We_not_accept_archives-tab->-tab->
.ace<-tab->SIZE=-1<-tab->We_not_accept_archives-tab->-tab->-tab-size>
.........
It is verry important to put TAB not space to work.
Next, run qmail-scanner-queue.pl -g and qmail-scanner-queue.pl -r
root@mail:/var/qmail/bin # ./qmail-scanner-queue.pl -g
perlscanner: generate new DB file from /var/spool/qscan/quarantine-events.txt
perlscanner: total of 3 entries.
root@mail:/var/qmail/bin # ./qmail-scanner-queue.pl -r
perlscanner: reading from /var/spool/qscan/quarantine-events.db
File: .zip
Size: Any
Description: We_not_accept_archives
File: .rar
Size: Any
Description: We_not_accept_archives
File: .ace
Size: Any
Description: We_not_accept_archives
===================================================================
miercuri, 2 decembrie 2015
Clear account in Outlook 2010 run in Playonlinux with wine
To simulate a click to the control panel icon, you have to do the following
export WINEARCH="win32"
export WINEPREFIX="/home/radut/.PlayOnLinux/wineprefix/Office2010"
After that run:
wine /home/radut/.wine/drive_c/windows/system32/rundll32.exe \
shell32.dll,Control_RunDLL \
"/home/radut/.PlayOnLinux/wineprefix/Office2010/drive_c/Program Files/Microsoft Office/Office14/MLCFG32.CPL"
radut is my user but you need to change.
The Email control panel will be appear but you can use only button for change profiles.
Show Profiles -> Remove
Abonați-vă la:
Postări (Atom)