<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ftp-proxy &#8211; Blog of Kliment Andreev &#8211; A place so I won&#039;t forget things</title>
	<atom:link href="https://blog.andreev.it/tag/ftp-proxy/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.andreev.it</link>
	<description></description>
	<lastBuildDate>Sun, 20 Oct 2019 21:09:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>FreeBSD: Use FreeBSD as home router (gateway) with pf NAT + ftp-proxy</title>
		<link>https://blog.andreev.it/2011/12/freebsd-as-home-router-gateway-with-pf-nat/</link>
					<comments>https://blog.andreev.it/2011/12/freebsd-as-home-router-gateway-with-pf-nat/#respond</comments>
		
		<dc:creator><![CDATA[Kliment Andreev]]></dc:creator>
		<pubDate>Thu, 08 Dec 2011 14:55:05 +0000</pubDate>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[ftp-proxy]]></category>
		<category><![CDATA[gateway]]></category>
		<category><![CDATA[NAT]]></category>
		<guid isPermaLink="false">http://blog.iandreev.com/?p=182</guid>

					<description><![CDATA[After five or six years using my old beige box (Pentium II Celeron, 300MHz,&#8230;]]></description>
										<content:encoded><![CDATA[<div id="bsf_rt_marker"></div><p>After five or six years using my old beige box (Pentium II Celeron, 300MHz, 192MB RAM) as a FreeBSD router (gateway), I’ve decided it’s time to replace it with a more decent old Dell C610 laptop (Pentium III, 1.2MHz, 1Gb RAM). I installed FreeBSD, put another network card and configured <strong>/etc/rc.conf</strong> so this laptop can be used as a NAT gateway.This is part of my <strong>/etc/rc.conf.</strong></p>
<pre class="brush: bash; title: ; notranslate">
# Use this machine as a gateway
gateway_enable=&quot;YES&quot;
# Hostname + domain name
hostname=&quot;tripnotic.klimentandreev.com&quot;
# IP address of the internal network card. My subnet is 192.168.1.0/24
ifconfig_dc0=&quot;inet 192.168.1.111  netmask 255.255.255.0&quot;
# IP address that is assigned by Comcast ISP to my external network card
ifconfig_xl0=&quot;DHCP&quot;
#Enable pf (firewall and packet filter)
pf_enable=&quot;YES&quot;
pf_rules=&quot;/etc/pf.conf&quot;
pflog_enable=&quot;YES&quot;
pflog_logfile=&quot;/var/log/pflog&quot;        
</pre>
<p>Next, I copied <strong>/etc/pf.conf</strong> to <strong>/etc/pf.conf.orig</strong> in case I need the original pf configuration file. Open your favorite editor and modify only the following lines in <strong>/etc/pf.conf:</strong></p>
<pre class="brush: bash; title: ; notranslate">
# Macros: define common values, so they can be referenced and changed easily.
ext_if=&quot;xl0&quot;    # replace with actual external interface name i.e., dc0. Mine is xl0
int_if=&quot;dc0&quot;    # replace with actual internal interface name i.e., dc1
internal_net=&quot;192.168.1.0/24&quot; # My internal subnet
#external_addr=&quot;192.168.1.1&quot; # My external IP is DHCP so I left this line commented.
</pre>
<p>I uncommented this line:</p>
<pre class="brush: bash; title: ; notranslate">nat on $ext_if from $internal_net to any -&gt; ($ext_if)
</pre>
<p>then I saved the file and rebooted. Since we changed the old desktop with a different computer, DHCP won’t work, so remember to also reboot your cable box. Once this is done, test the connection from your new gateway. I also needed to change my <strong>dhcpd.conf</strong> on my other OpenBSD box to reflect the new gateway address.<br />
<strong>UPDATE:</strong> When I tried to use ftp client from my laptop, I was getting all kinds of errors. I tried to use passive command, but it didn’t work. I would get the ftp prompt, but when I try to list the folder, the connection failed. After some googling, I found that ftp-proxy needs to be installed. First, edit <strong>/etc/rc.conf</strong> and add <strong>ftpproxy_enable=”YES”</strong> at the end. Then, edit <strong>/etc/pf.conf</strong> and uncomment the following lines:</p>
<pre class="brush: bash; title: ; notranslate"> 
nat-anchor “ftp-proxy/*”
rdr-anchor “ftp-proxy/*”
rdr pass on $int_if proto tcp to port ftp -&gt; 127.0.0.1 port 8021
</pre>
<p>and all the way down where the rules are</p>
<pre class="brush: bash; title: ; notranslate">
anchor “ftp-proxy/*”
</pre>
<p>Save the changes, start <strong>/etc/rc.d/ftp-proxy</strong> and you are good to go.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.andreev.it/2011/12/freebsd-as-home-router-gateway-with-pf-nat/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
