ipfilter: é possível redirecionar o ssh para cada zona?

1

Eu tenho um servidor para testes, eu instalei nele o OmniOS, porque ele pode emular o linux (regiões com marca lx) e o Solaris (funciona perfeitamente com o kvm-qemu). Eu posso rodar tudo na rede 192.168.0.0/24, mas eu prefiro fazer algo assim: Um servidor com 2 nics: bge0 e bge1, bge0 tem 192.168.0.30 ip e bge1 com 10.2.0.1. O vm (zones e kvm-qemu) é executado na rede 10.2.0.1. Então eu faço um firewall como esse usando o ipfilter

ipf.conf

# block and quick everything by default but pass on lo0
block in log on bge0 all
pass in quick on bge1 all
pass in quick on lo0 all

# These rules will allow connections initiated from
# this host along with the return connection
pass out quick proto icmp all keep state
pass out quick proto tcp all keep state
pass out quick proto udp all keep state

# Allow SecureShell incoming connections on 22 port 
pass in quick proto tcp from any to any port = 22 flags S keep state keep frags

ipnat.conf
map bge0 10.2.0.0/24 -> 0/32 portmap tcp/udp auto
map bge0 10.2.0.0/24 -> 0/32
rdr bge0 10.2.0.0/24 -> 10.2.0.3

Com uma zona lx (10.2.0.3) funciona perfeitamente. Eu posso alcançá-lo com o ssh de 192.168.0.0/24 clientes da rede. Minha pergunta é..se eu quiser duas ou mais máquinas, é possível redirecionar ssh para máquinas diferentes?

Por exemplo

machine1-------->ssh------->lxzone1
machine1-------->ssh------->lxzone2

Qual regra para isso? Obrigado

p.s Com solaris11.4 que usam pf em vez de ipfilter (removido) tudo funciona bem com este simples pf.conf

# Vars
ext_if="net0"
int_if="net1"
ext_net="192.168.0.0/24"
int_net="10.2.0.0/24"
webports="{443, 80}"

##  make IP reassembly work
set reassemble yes no-df

## ignore loopback traffic
set skip on lo0

# block everything unless told otherwise
# and send TCP-RST/ICMP unreachable
# for every packet which gets blocked
block return in log all
pass out all

# Pass
pass in on $int_if proto tcp from $ext_net to any keep state
pass in on $int_if proto udp from $ext_net to any keep state
pass in on $int_if proto tcp from $int_net to any keep state
pass in on $int_if proto udp from $int_net to any keep state

# accept incoming SSH connections
pass in proto tcp from any to $ext_if port 22

# accept icmp
pass in proto icmp all

## allow all connections initiated from this system,
## including DHCP requests
pass out

#nat
pass out on net0 from $int_net to any nat-to (net0)
    
por elbarna 08.04.2018 / 13:53

0 respostas