{"id":1064,"date":"2010-12-03T13:53:20","date_gmt":"2010-12-03T13:53:20","guid":{"rendered":"http:\/\/wiki.freeiz.com\/?p=1064"},"modified":"2016-08-09T12:05:06","modified_gmt":"2016-08-09T12:05:06","slug":"linux-transit-vm-port-forward","status":"publish","type":"post","link":"https:\/\/wiki-see.info\/wp\/2010\/12\/03\/linux-transit-vm-port-forward\/","title":{"rendered":"Linux Transit VM Port Forward"},"content":{"rendered":"<p>Need forwarding to Telford Internal IP Address &#8211; 10.10.1.1<br \/>\nFixed Internet IP Address &#8211; 1.1.1.1<\/p>\n<p>Ports 40000, 41000, 42000, 43000, 44000, 45000, &amp; 46000 need forwarding to 10.10.1.1<\/p>\n<p>Configuration to be Done.<\/p>\n<p><strong>Need to create a Ethernet Subinterface on the VM<\/strong> :<\/p>\n<p># Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]<br \/>\nDEVICE=eth1:3<br \/>\nBOOTPROTO=static<br \/>\nONBOOT=yes<br \/>\nHWADDR=00:0c:29:fa:da:13<br \/>\nIPADDR=1.1.1.1<br \/>\nNETMASK=255.255.255.0<br \/>\nNETWORK=1.1.1.254<br \/>\nBROADCAST=1.1.1.253<br \/>\n<strong>Bring Interface UP<\/strong> :<\/p>\n<p>sudo ifup eth1:3<\/p>\n<p><strong>To View a list of rules with the NAT table<\/strong> :<\/p>\n<p>sudo iptables -vnL -t nat &#8211;line-numbers<\/p>\n<p><strong>Need to complete PREROUTING chain in order to DNAT these ports from WAN\u00a0to destination LAN address<\/strong> :<\/p>\n<p>sudo iptables -t nat -I PREROUTING\u00a01 -d\u00a01.1.1.1 -p tcp &#8211;dport 40000 -j DNAT &#8211;to 10.10.1.1<br \/>\nsudo iptables -t nat -I PREROUTING 2 -d\u00a01.1.1.1 -p tcp &#8211;dport 41000 -j DNAT &#8211;to 10.10.1.1<br \/>\nsudo iptables -t nat -I PREROUTING\u00a03 -d\u00a01.1.1.1 -p tcp &#8211;dport 42000 -j DNAT &#8211;to 10.10.1.1<br \/>\nsudo iptables -t nat -I PREROUTING\u00a04 -d\u00a01.1.1.1 -p tcp &#8211;dport 43000 -j DNAT &#8211;to 10.10.1.1<br \/>\nsudo iptables -t nat -I PREROUTING\u00a05 -d\u00a01.1.1.1 -p tcp &#8211;dport 44000 -j DNAT &#8211;to 10.10.1.1<br \/>\nsudo iptables -t nat -I PREROUTING\u00a06 -d\u00a01.1.1.1 -p tcp &#8211;dport 45000 -j DNAT &#8211;to 10.10.1.1<br \/>\nsudo iptables -t nat -I PREROUTING\u00a07 -d\u00a01.1.1.1 -p tcp &#8211;dport 46000 -j DNAT &#8211;to 10.10.1.1<\/p>\n<p>To summarize this as one rule :<\/p>\n<p>sudo iptables -t nat -I PREROUTING 18 -d 85.234.86.115 -p tcp -m multiport &#8211;dport 40000,41000,42000,43000,44000,45000,46000 -j DNAT &#8211;to 10.10.1.1<\/p>\n<p><strong>Need to complete POSTROUTING chain in order to SNAT these ports from LAN address to destination Subinterface :<\/strong> :<\/p>\n<p>sudo iptables -t nat -I POSTROUTING 20 -o eth1:3 -s 10.10.1.1 -p tcp -m multiport &#8211;dports 40000,41000,42000,43000,44000,45000,46000 -j SNAT &#8211;to 1.1.1.1<\/p>\n<p>To Delete a Chain Rule<\/p>\n<p>sudo iptables -t nat -D POSTROUTING 20<br \/>\nsudo iptables -t nat -D PREROUTING 20<\/p>\n<p><strong>Troubleshooting Diagnostics Testing<\/strong> :<\/p>\n<p>From the Internet :<\/p>\n<p>telnet 85.234.86.115 40000<\/p>\n<p>B00m.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Need forwarding to Telford Internal IP Address &#8211; 10.10.1.1 Fixed Internet IP Address &#8211; 1.1.1.1 Ports 40000, 41000, 42000, 43000, 44000, 45000, &amp; 46000 need forwarding to 10.10.1.1 Configuration to be Done. Need to create a Ethernet Subinterface on the VM : # Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] DEVICE=eth1:3 BOOTPROTO=static ONBOOT=yes HWADDR=00:0c:29:fa:da:13 IPADDR=1.1.1.1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,8],"tags":[459,565,657,695],"class_list":["post-1064","post","type-post","status-publish","format-standard","hentry","category-iptables-linux","category-linux","tag-linux-transit","tag-prerouting","tag-subinterface","tag-transit-vm"],"_links":{"self":[{"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/posts\/1064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/comments?post=1064"}],"version-history":[{"count":1,"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/posts\/1064\/revisions"}],"predecessor-version":[{"id":4834,"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/posts\/1064\/revisions\/4834"}],"wp:attachment":[{"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/media?parent=1064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/categories?post=1064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wiki-see.info\/wp\/wp-json\/wp\/v2\/tags?post=1064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}