Is it possible to set up OpenBSD such, that it will have IP1 internally (in hosts, in hostname.en0, sockets binds to IP1), but convert it to IP2 when packet goes to ethernet. Also, packets for the IP2 should be received and delivered to services which were bind to IP1.

I think, this is possible in Linux, with iptables firewall (something like by DNAT/SNAT), but now I want to do this on OpenBSD.

I can setup routing of real LAN in any way.

link|improve this question

67% accept rate
Why do you need this? – yfeldblum Jul 29 '11 at 13:00
This is the task. If I will done this, I will able to move physical server into virtual and keep its IP unchanged. – osgx Jul 29 '11 at 13:41
feedback

migrated from stackoverflow.com Nov 18 '11 at 11:05

This question came from our site for professional and enthusiast programmers.

2 Answers

You can modify kernel to substitute IP1 with IP2 for outgoing traffic and vice versa.

What protocol you have in mind ?

link|improve this answer
tcp/udp over ip – osgx Nov 14 '11 at 22:38
feedback

This should be more or less doable with an alias on the interface and minor PF/NAT magic. Have you looked at all into the PF guide?

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.