virtualbox hostonly network - source IP
I've set up 2 physical virtualbox hosts with multiple guests on each. Both are networked over physical LAN (eth0 - 1.1.1.1 and 1.1.1.2) and both have hostonlyif (vboxnet0) configured - 10.0.1.0/24 and 10.0.2.0/24. Guests have NAT set up (along with host only), thus providing traffic both way. It's working fine as expected.
I've got OpenVPN server running on 1.1.1.1, so all guests can be part of one subnet 192.168.100.0/24.
Given a guest 10.0.2.100 (on 1.1.1.2) is connecting to 1.1.1.1, OpenVPN is seeing 1.1.1.2 as the client's IP (as expected, guest's outbound traffic not within same host will go through NAT'ed interface, so everything is working as designed). But I want a script on VPN server that runs during the connection to see 10.0.2.100.
I added an IP route on 10.0.2.100 to send connection traffic via 10.0.2.1/1.1.1.2 (allowing ip_forward on 10.0.2.1/1.1.1.2). The traffic doesn't seem to get past 10.0.2.1/1.1.1.2.
Also another approach I'm thinking is to let traffic through NAT'ed interface, but modify source IP when it leaves 1.1.1.2 - but am quite new to networking/firewall/virtualisation, so getting nowhere.
Last edited by pranix; 08-23-2013 at 06:43 PM.
|