1

I need some.domain.com:8000 to be linked to 162.251.150.150:80.

So when I load some.domain.com:8000 in my browser - an actual request should be going to 162.251.150.150:80.

I was trying to use pf.conf for that with different settings, but without success:

pass out proto tcp from  some.domain.com port 8000 to 162.251.150.150 port 80
nat pass on lo0 inet proto tcp from any to some.domain.com port 8000 -> 162.251.150.150 port 80

(I've created an alias for some.domain.com in hosts file along with that)

I have MacOS 10.12.3

p.s. I made that working in Ubuntu with following command:

sudo iptables -t nat -A OUTPUT -p tcp --dport 8000 -d some.domain.com  -j DNAT --to-destination 162.251.150.150:80

p.p.s. I saw following question

What is the modern way to do port-forwarding on El Capitan? (forward port 80 to 8080)

My question is specific because of domain name need to be specified

andrfas
  • 111

0 Answers0