I have a host1 that has a WAN interface eth0 (1.2.3.4) and a LAN interface eth1 (10.41.82.1). Inside the LAN is a host2 with the IP address 10.41.82.2.  Incoming connections to 1.2.3.4:22 are forwarded to host2 using the following iptables rules on host1:  root@host1:~# iptables -t nat -A OUTPUT     -d 1.2.3.4 -p tcp --dport 22 -j DNAT --to 10.41.82.2:22 root@host1:~# iptables -t nat -A PREROUTING -d 1.2.3.4 -p tcp --dport 22 -j DNAT --to 10.41.82.2:22   This works fine, except when host2 is trying to access 1.2.3.4:22:  root@host2:~# telnet 1.2.3.4 22 Trying 1.2.3.4...  root@host2:~# ping 1.2.3.4 PING 1.2.3.4 56(84) bytes of data. 64 bytes from 1.2.3.4: icmp_seq=1 ttl=64 time=0.125 ms 64 bytes from 1.2.3.4: icmp_seq=2 ttl=64 time=0.279 ms  root@host2:~# tcptraceroute 1.2.3.4 22 traceroute to 1.2.3.4, 30 hops max, 60 byte packets  1  * * *  2  * * *  3  * * *  4  * * *  5  * * * (and so on)   It seems like the packets are being forwarded in a circle. As you can see, pinging works, so the routes and IP forwarding are set up properly.  What did I do wrong and how can I fix the problem?    UPDATE:  As mentioned in BillThor’s response and as is described in the , I need to add an SNAT rule. I have done this now (note that I have added the LAN address of host2 for -d, as this rule is applied in POSTROUTING where the destination of the packet has already been changed):  root@host1:~# iptables -t nat -A POSTROUTING -d 10.41.82.2 -p tcp --dport 22 -j SNAT --to 10.41.82.1   Unfortunately, this does not solve the problem, and everything is still the same as described above. Interestingly, the SNAT rule never seems to be matched, according to the counters shown when running iptables -t nat -nvL.    UPDATE 2:  I discovered that when I run tcpdump -i eth1, even when I run it with parameters irrelevant to this case, such as tcpdump -i eth1 port 34238, it suddenly works. But only while tcpdump is running.  What I didn’t mention so far because I thought it was irrelevant is that eth1 is actually a bridge, and host2 is a Xen domain. I am starting to suspect that my problem might be related to this.
This is a  about Hairpin NAT (Loopback NAT).   The generic form of this question is:  We have a network with clients, a server, and a NAT Router. There is port forwarding on the router to the server so some of it's services are available externally. We have DNS pointing to the external IP. Local network clients fail to connect, but external work.   Why does this fail? How can I create a unified naming scheme (DNS names which work both locally and externally)?   This question has answeres merged from multiple other questions. They originally referenced FreeBSD, D-Link, Microtik, and other equipment. They're all trying to solve the same problem however.
I need to calculate the surface (m2) of external walls of all the buildings in a town. By external walls I mean all the walls of a building or parts of a wall which are not in contact with another building. I have a 2D shapefile of polygons with the cadastral footprint of the buildings, which includes information of the building’s height in the attribute table.  I don’t really know how can I do it… My idea is to convert the 2D file to 3D and use the 3D shapefile to distinguish the external walls from the shared walls (parts of a building that are shared with other buildings) of all buildings, and from there, calculate the total area but I’m not sure whether this can be done with ArcScene.  Anybody knows how could it be done and if there is an automate way to do it? How can I get crash data (stack traces at least) from my Android application? At least when working on my own device being retrieved by cable, but ideally from any instance of my application running on the wild so that I can improve it and make it more solid. I have set of temp files created in my folder with .bak extensions. How can I make them hide by default in Ubuntu?  I tried adding a .hidden file with *.bak as entry in the file, but that is not working. Any help is very appreciated... $y_{2n}, y_{2n+1}$ and $y_{3n}$ all converge. What can we say about the sequence $ y_n$? My friend and I are currently debating the following question:      Let $y_n$ be a sequence in a metric space and assume that the subsequences    $y_{2n}$, $y_{2n + 1}$, and $y_{3n}$ all converge. What can we say about the sequence $y_n$?    To me it seems that all the subsequences will converge to a limit say $y$. Then any term in the original sequence will be in one of these subsequences, it follows that the entire sequence $y_n$ converges to $y$.  I let $\varepsilon &gt; 0$. Since $y_{2n}$ converges to $y$ there exists an index $2N$ such that $d(y_{2n},y) &lt; \varepsilon$ for $2n \geq 2N$, and since $(y_{2n+1})$ converges to $y$ there exists $2M + 1$ such that $d(y_{2n+1}, y) &lt; \varepsilon$ for $2n + 1 \geq 2M + 1$.  Let $m \geq \max\{2N,2M+1\}$. If  $m$ is even, since $m\geq 2N$ we have $d(y_m,y)&lt;\varepsilon$; if $m$ is odd, since $m\geq 2M+1$ we have $d(y_m,y)&lt;\varepsilon$. Thus $d(y_m,y)&lt;\varepsilon$ for any $m \geq \max\{2N,2M+1\}$, and we conclude that $(y_n)$ converges to $y$.   However, my friend does not think that this is completely correct because I didn't use the $y_{3n}$ in the proof. I think he is right, that I do in fact need it, but I am unsure of how to add it in. All in all, I think that since any term in the original sequence will be in one of these subsequences, it follows that the entire sequence $(y_n)$ converges to $y$.  $2n+1$ covers all the odd terms and $2n$ converse all the even terms, so is $3n$ even needed? I would like to use it since the proof has it in the question, but I am unsure of what to do. Could someone kindly help me construct this proof in a better manner,and is my line of thinking correct? Thank you! How do I enable the "Universe" repository? How do I get to the Universe Repository in supported versions of Ubuntu? $\gcd(a,b)=1, x^a = y^b\Rightarrow x = n^b$, $ y = n^a$ for an integer $n$. If $ a$, $ b$, $ x$, $ y$ are integers greater than $1$ such that $ a$ and $ b$ have no common factor except $1$ and $ x^a = y^b$ show that $ x = n^b$, $ y = n^a$ for some integer $ n$ greater than $1$.  I started this way: $x^a=y^b$ $=&gt;$ $x=y^{b/a}=(y^{1/a})^b$. Thus $x$ is an integer, and so is $y^{1/a}$, so $y=n^a$ for some integer $n$ greater than $1$. Then from the given relation, we get $x=n^b$.   I am not very convinced with my solution, as I feel I did some mistake. Can anyone point out where the mistake is? Any other solution is also welcome :) Can I nohup/screen an already-started process? How long can you store used cooking oil How long can you store used cooking oil then re-use it? I deep fried a turkey one year ago and have had it refrigerated since. I would like to treat a user as a non-gender noun and refer to it with the gender-neutral pronoun, it. E.g.,     The user defines two variables, x and y. It then multiplies each variable by a prime number.    However, on  I found this:      The word "it", however, has an extremely impersonal connotation, even offensive, in common usage and is rarely used in English to refer to an unspecified human being or person of unknown gender. This is because the word "it" connotes that the person being specified is inferior to a person or is an object.   Is to appropriate to refer to a person of unknown sex as it?  Should I rephrase my sentence as follows:     The user defines two variables, x and y. The user then multiplies each variable by a prime number. Can whole chilli peppers be frozen? I have some  chilli peppers bought from the local supermarket.    Aren't they lovely?  :)  Well, unfortunately, my local supermarket (I think the only one in the UK that stocks them) doesn't always have them in stock, so when they do appear on the shelves, I quickly stock-up on them.  Storing them in the fridge, they'll last maybe a week or so before starting to deteriorate.  My question is, can these chili peppers be frozen and, if so, will freezing them have any "negative" effects ?  I buy these particular peppers for their heat (and also their great smoky flavour), so I'd hate for either the heat or the flavour to be negatively impacted if they were frozen. Finder sidebar flashing text and high CPU load since El Capitan After update to OS X 10.11 I started having these bugs:   Finder sidebar text flashing  Very high CPU load:      I have Macbook Pro Retina 13" Mid 2014  I reset NVRAM.  I deleted com.apple.finder.plist, it didn't help.  Also I did this: , no longer flashes. I took this code straight out of 'Java all in one for Dummies' ....why doesn't it work? So I had asked a question prior to this one about recurrence relations, but apparently it was a bad one to ask. So I'm trying again to understand how to solve these babies... Here it is:  $$ 3a_{n+1}-4a_n=0, n&gt;=0, a_1=5 $$  What is the general process for solving a relation like this? I've just executed a long-running process from the bash prompt. In hindsight, I wish I'd run time on it, or noted down the time at which I kicked it off.  Is there any way of getting this information retrospectively? The .bash_history doesn't seem to include timestamps.  In my particular case it's Mac OS X, but I'm interested in general Unix/Linux solutions.  To clarify, the process has now completed, and I'd prefer not to run it again unless absolutely necessary! Lets say I'm building a base class which will be extended upon by the children class. So a base class is called Base and children can be Child1, Child2, etc.  In the base class's constructor, how can i get the value of Child1/Child2?  This is all using PHP Consider following structure:  . |_s |_s  |_ss  |_ss+   |_sss  |_ss |_s |_s   How can I demote a subsection to subsubsection without changing markups ?  . |_s |_s  |_ss   |_sss+    |_p  |_ss |_s |_s   How can I promote a subsection to section without changing markups ?  . |_s |_s  |_ss |_s+  |_ss  |_ss |_s |_s   A wrapper command would be excellent  \begin[+1]{level} \section{} \end{level} I have Ubuntu server 12.04 installed, so I have no GUI. When I do the command ifconfig, I cannot find my internal IP address. It says inet addr: 127.0.0.1. Here is the output of ifconfig -a: eth0   link encap:Ethernet  HWaddr 00:06:4f:4a:66:f0     BROADCAST MULTICAST  MTU:1500  Metric:1     RX packets:0 errors:0 dropped:0 overruns:0 frame:0     TX packets:0 errors:0 dropped:0 overruns:0 carrier:0     collisions:0 txqueuelen:1000     RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)  eth1   link encap:Ethernet  HWaddr 00:16:ec:05:c8:9c      BROADCAST MULTICAST  MTU:1500  Metric:1     RX packets:0 errors:0 dropped:0 overruns:0 frame:0     TX packets:0 errors:0 dropped:0 overruns:0 carrier:0     collisions:0 txqueuelen:1000     RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)  lo     Link encap:Local Loopback     inet addr 127.0.0.1  Mask:255.0.0.0     inet6 addr:  ::1/128 Scope:Host     UP LOOPBACK RUNNING MTU:65536  Metric:1     RX packets:1800 errors:0 dropped:0 overruns:0 frame:0     Tx packets:1800 errors:0 dropped:0 overruns:0 carrier:0     collisions:0 txqueuelen:0     RX bytes:143896 (143.b KB)  TX bytes:143896 (143.8 KB)  here are the contents of etc/network/interfaces: # The loopback network interface auto lo iface lo inet loopback  # The primary network interface auto eth0 iface eth0 inet dhcp  If someone could edit this for me, the contents of etc/network/interfaces should be on separate lines. The output of host askubuntu.com was: ;; connection timed out; no servers could be reached.  I set up owncloud and webmin a few months ago and was using them for a month with no problems. I think the power went off one day 2 months ago and I never turned the server back on until yesterday. I haven't done anything that would have affected the internet setup So i'm not sure why it doesn't work anymore. As far as my network topology goes, I have a pci-e network card for the pc. The ethernet line goes from the network card to a switch, and then to a modem/router from there. How can I copy from Tmux terminal and paste it other application in my OS? I am using tmux on ubuntu. I read this  for copy and paste inside tmux. But I would like to know how can I copy from TMUX terminal and paste it to other application e.g browser in my OS? Can I mix sources from different ubuntu versions? As we know that we are using  for installing packages and repositories configuration file located at /etc/apt/sources.list.  I am using Ubuntu 12.10 (Quantal Quetzal) which reaches . That means no updates or support. So, the question is, can I use sources.list file from another version, say Ubuntu 12.04 LTS, and will it negatively affect the system. Enable External Sharing Programmatically We have a scenario on which we are creating site collections from a provider-hosted app. Some of these site collections will be used by external users. Is there a way from CSOM (server-side) to enable external sharing on the site collection? I haven't found any resources stating whether this is or not doable.  I'm trying to replicate the settings you can specify at the site collections page on the tenant admin site:    Thanks!