Previously, in my small server, with one NIC connected to a cheap modem/router I had a jail for mldonkey. It could be accessed from the local LAN and also from the Internet with the help of a dynamic DNS. Mldonkey could connect to servers with HighID. I'm using RELEASE-9.2.
Now, I changed my ISP, got a new modem/router and have two NICs at the small server, like this.
So, basically, I get a different IP for re0 than the one I get for the modem/router part that serves em0 as well as the other computers connected to the modem/router. Both re0 and the modem/router get dynamic IPs from the ISP.
The good news is that I can access mldonkey from the local LAN, as well as from the Internet, as before. The bad news is that mldonkey cannot connect to servers. I temporarily enabled raw_sockets for the jail and it can't connect to 8.8.8.8 or other hosts.
The relevant configuration parts are:
For the jail:
For the host system:
So, what should I do differently? I tried several changes to no avail.
Now, I changed my ISP, got a new modem/router and have two NICs at the small server, like this.
Code:
ISP --------- modem/router------------local network (internal interface em0)
|_____(bridged)__ external NIC re0
So, basically, I get a different IP for re0 than the one I get for the modem/router part that serves em0 as well as the other computers connected to the modem/router. Both re0 and the modem/router get dynamic IPs from the ISP.
The good news is that I can access mldonkey from the local LAN, as well as from the Internet, as before. The bad news is that mldonkey cannot connect to servers. I temporarily enabled raw_sockets for the jail and it can't connect to 8.8.8.8 or other hosts.
The relevant configuration parts are:
For the jail:
Code:
# cat /etc/rc.conf | grep -v '^#'
network_interfaces="re0 em0"
ifconfig_em0_alias="inet 192.168.1.20/24"
For the host system:
Code:
/etc/rc.conf.local:
ifconfig_em0="inet 192.168.1.4 netmask 255.255.255.0"
ifconfig_re0="DHCP" # <----- bridged, second IP provided by ISP
#-----------------------JAILS----------------------------------
jail_enable="YES"
ezjail_enable="YES"
jail_list="mldonkey other" # Space separated list of names of jails
#-----------------------JAILS-MLDONKEY-------------------------
ifconfig_em0_alias0="inet 192.168.1.20 netmask 255.255.255.0"
jail_mldonkey_hostname="mldonkey" # jail's hostname
jail_mldonkey_ip="192.168.1.20" # jail's IP address
jail_mldonkey_rootdir="/encriptado/jails/mldonkey" # jail's root directory
jail_mldonkey_interface="em0"
jail_mldonkey_devfs_enable="YES" # mount devfs in the jail
jail_mldonkey_devfs_ruleset="devfsrules_jail" # devfs ruleset to apply to jail
#----------------------PF--------------------------------------
pf_enable="YES"
pflog_enable="YES"
gateway_enable="YES"
# cat /etc/pf.conf
Code:
#INTERFACES
ext_if = "re0"
int_if = "em0"
mldonkey = "192.168.1.20"
rdr pass on $ext_if proto tcp from any to any port $mldonkey_web_port -> $mldonkey
rdr pass on $ext_if proto tcp from any to any port $mldonkey_tcp_port -> $mldonkey
rdr pass on $ext_if proto udp from any to any port $mldonkey_udp_port -> $mldonkey
rdr pass on $int_if proto tcp from any to any port $mldonkey_web_port -> $mldonkey
rdr pass on $int_if proto tcp from any to any port $mldonkey_tcp_port -> $mldonkey
rdr pass on $int_if proto udp from any to any port $mldonkey_udp_port -> $mldonkey
block in log on $ext_if
#block out log on $ext_if
set skip on lo0
pass in quick from <local> to any keep state
pass out from any to any keep state
# (several other rules that I think are not important for this issue)
So, what should I do differently? I tried several changes to no avail.