<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: IPtables rule in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/iptables-rule/m-p/3684341#M85547</link>
    <description>Shalom Tom,&lt;BR /&gt;&lt;BR /&gt;Examples....&lt;BR /&gt;&lt;BR /&gt;-A FORWARD -d 192.168.0.131 -i eth0 -p 47 -j ACCEPT&lt;BR /&gt;-A FORWARD -d 192.168.0.131 -i eth0 -p tcp -m tcp --dport 1723 -j ACCEPT&lt;BR /&gt;-A FORWARD -d 192.168.0.131 -i eth0 -p 47 -j ACCEPT&lt;BR /&gt;&lt;BR /&gt;forward destination -d port 47 to internal IP address 192.168.0.131 everything from eth0&lt;BR /&gt;&lt;BR /&gt;What you can do is use the -s command with the -i to control the interface&lt;BR /&gt;&lt;BR /&gt;-A FORWARD -d 192.168.0.131 -i eth0 -s 24.123.3.108 -p 47&lt;BR /&gt;&lt;BR /&gt;That's generally what you want so long as your sources have fixed ip addresses.&lt;BR /&gt;&lt;BR /&gt;Change the port and -s source to meet your actual needs.&lt;BR /&gt;&lt;BR /&gt;Post any error messages my code generates.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
    <pubDate>Mon, 05 Dec 2005 04:22:05 GMT</pubDate>
    <dc:creator>Steven E. Protter</dc:creator>
    <dc:date>2005-12-05T04:22:05Z</dc:date>
    <item>
      <title>IPtables rule</title>
      <link>https://community.hpe.com/t5/operating-system-linux/iptables-rule/m-p/3684340#M85546</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I know what I want, but I don't know how to format it for iptables.  I've been going in circles for hours, so hopefully someone can help me with this.&lt;BR /&gt;&lt;BR /&gt;I want to allow external connnections through my router so that I can connect from a specific remote IP to an internal box via ssh.  From the remote system I want to ssh to a high number port such as 9876 and have the router send that to an internal box, 192.168.1.20, on port 22.&lt;BR /&gt;&lt;BR /&gt;I've found rules to open up ssh and forward to an internal box, but I want to be selective about which external IPs can connect and I want them coming in on a high port.&lt;BR /&gt;&lt;BR /&gt;I hope that's clear.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Tom</description>
      <pubDate>Sun, 04 Dec 2005 23:19:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/iptables-rule/m-p/3684340#M85546</guid>
      <dc:creator>Tom Ward_1</dc:creator>
      <dc:date>2005-12-04T23:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: IPtables rule</title>
      <link>https://community.hpe.com/t5/operating-system-linux/iptables-rule/m-p/3684341#M85547</link>
      <description>Shalom Tom,&lt;BR /&gt;&lt;BR /&gt;Examples....&lt;BR /&gt;&lt;BR /&gt;-A FORWARD -d 192.168.0.131 -i eth0 -p 47 -j ACCEPT&lt;BR /&gt;-A FORWARD -d 192.168.0.131 -i eth0 -p tcp -m tcp --dport 1723 -j ACCEPT&lt;BR /&gt;-A FORWARD -d 192.168.0.131 -i eth0 -p 47 -j ACCEPT&lt;BR /&gt;&lt;BR /&gt;forward destination -d port 47 to internal IP address 192.168.0.131 everything from eth0&lt;BR /&gt;&lt;BR /&gt;What you can do is use the -s command with the -i to control the interface&lt;BR /&gt;&lt;BR /&gt;-A FORWARD -d 192.168.0.131 -i eth0 -s 24.123.3.108 -p 47&lt;BR /&gt;&lt;BR /&gt;That's generally what you want so long as your sources have fixed ip addresses.&lt;BR /&gt;&lt;BR /&gt;Change the port and -s source to meet your actual needs.&lt;BR /&gt;&lt;BR /&gt;Post any error messages my code generates.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Mon, 05 Dec 2005 04:22:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/iptables-rule/m-p/3684341#M85547</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2005-12-05T04:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: IPtables rule</title>
      <link>https://community.hpe.com/t5/operating-system-linux/iptables-rule/m-p/3684342#M85548</link>
      <description>You will also need a nat table rule as well as forwarding rules previously mentioned.&lt;BR /&gt;&lt;BR /&gt;-t nat -A PRETROUTING -i &lt;EXT_IF&gt; -p tcp -s &lt;SOURCE_ADDR&gt; --destination-port 9876 -j DNAT --to-destination 192.168.1.20:22&lt;BR /&gt;&lt;BR /&gt;-A FORWARD -p tcp -i &lt;EXT_IF&gt; --destination-port 22 --destination 192.168.1.20 -j ACCEPT&lt;BR /&gt;&lt;BR /&gt;-A FORWARD -s 192.168.1.20 -j ACCEPT&lt;BR /&gt;&lt;BR /&gt;-t nat -A POSTROUTING -p tcp -s 192.168.1.20 -o &lt;EXT_IF&gt; -j SNAT --to-source &lt;EXT_IF ip="" addr=""&gt;&lt;BR /&gt;&lt;BR /&gt;if external addr is dynamically assigned&lt;BR /&gt;-t nat -A POSTROUTING -p tcp -s 192.168.1.20 -o ppp0 -j MASQUERADE&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You can harden or soften these as applies by specifing the source ports in the POSTROUTING chains.&lt;/EXT_IF&gt;&lt;/EXT_IF&gt;&lt;/EXT_IF&gt;&lt;/SOURCE_ADDR&gt;&lt;/EXT_IF&gt;</description>
      <pubDate>Mon, 05 Dec 2005 19:26:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/iptables-rule/m-p/3684342#M85548</guid>
      <dc:creator>ger donohue_1</dc:creator>
      <dc:date>2005-12-05T19:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: IPtables rule</title>
      <link>https://community.hpe.com/t5/operating-system-linux/iptables-rule/m-p/3684343#M85549</link>
      <description>Consider installing Shorewall.&lt;BR /&gt;It will build the NAT rules and opent the &lt;BR /&gt;port for you.&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Dec 2005 12:00:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/iptables-rule/m-p/3684343#M85549</guid>
      <dc:creator>Bill Thorsteinson</dc:creator>
      <dc:date>2005-12-06T12:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: IPtables rule</title>
      <link>https://community.hpe.com/t5/operating-system-linux/iptables-rule/m-p/3684344#M85550</link>
      <description>Thank you for the replies.&lt;BR /&gt;&lt;BR /&gt;I've got one part working -- the subnet restrictions.  I haven't worked out the port shifting bit yet.&lt;BR /&gt;&lt;BR /&gt;I'm using floppy firwall.  Here's the rules that I have so far.&lt;BR /&gt;iptables -A PREROUTING -t nat -p tcp -d ${OUTSIDE_IP} --dport 22 -s 999.999.999.0/24 -j DNAT --to ${SERVER_IP}:22 &lt;BR /&gt;iptables -A FORWARD -p tcp  -s 999.999.999.0/24 -d ${SERVER_IP} --dport 22 -o ${INSIDE_DEVICE} -j ACCEPT&lt;BR /&gt;They're just a slight modification of the sample rule given.&lt;BR /&gt;&lt;BR /&gt;I plan to check out bering-uClib.  It has shorewall and looks like it's actively maintained.  &lt;BR /&gt;&lt;BR /&gt;As a side note I was checking ebay for another 486 like mine to use as test and there aren't many of them for sale anymore.  Too bad they work well for routers.&lt;BR /&gt;&lt;BR /&gt;Thanks and Happy Holidays,&lt;BR /&gt;Tom</description>
      <pubDate>Thu, 08 Dec 2005 10:23:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/iptables-rule/m-p/3684344#M85550</guid>
      <dc:creator>Tom Ward_1</dc:creator>
      <dc:date>2005-12-08T10:23:59Z</dc:date>
    </item>
  </channel>
</rss>

