Good day!
Please, help me understand, how setup FreeBSD 11-STABLE amd64 router with several ip addresses on external interface.
I have:
Provider give me subnet
/etc/rc.conf
/etc/rc.firewall
And with that setup I try to connect from outside to that router's 25 port.
So nated service works only on first assigned external ip address.
But ssh access working on all assigned ip's.
What I'm do wrong?
Please, help me understand, how setup FreeBSD 11-STABLE amd64 router with several ip addresses on external interface.
I have:
Provider give me subnet
Code:
1.1.1.2/24 gw 1.1.1.1
/etc/rc.conf
Code:
# Assigned external IP addresses
ifconfig_rl0="inet 1.1.1.2/24"
ifconfig_rl0_alias0="inet 1.1.1.3/24"
ifconfig_rl0_alias0="inet 1.1.1.4/24"
ifconfig_rl0_alias0="inet 1.1.1.5/24"
defaultrouter="1.1.1.1"
# Internal
ifconfig_re0="inet 192.168.0.0/24"
# Loopback for Jails
cloned_interfaces="lo1"
ifconfig_lo1="inet 10.1.1.1/32" # Jail1
ifconfig_lo1_alias0="inet 10.1.1.2/32" # Jail2
/etc/rc.firewall
Code:
${FW} nat 1 config log if ${extIF} unreg_only reset same_ports \
redirect_port tcp 10.1.1.2:25 25
${FW} add nat 1 ip from any to any via ${extIF}
And with that setup I try to connect from outside to that router's 25 port.
telnet 1.1.1.2 25
Code:
Trying 1.1.1.2...
Connected to site.admin.
Escape character is '^]'.
220 domain.org ESMTP Postfix
telnet 1.1.1.3 25
Code:
Trying 1.1.1.3...
telnet: connect to address 1.1.1.3: Connection refused
telnet: Unable to connect to remote host
netstat -an | grep LISTEN
Code:
tcp4 0 0 10.1.1.2.25 *.* LISTEN
tcp4 0 0 *.22 *.* LISTEN
So nated service works only on first assigned external ip address.
But ssh access working on all assigned ip's.
What I'm do wrong?