Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I connect to my wireless network through NetworkManager. In addition I have another computer connected to the first one through ethernet. I'm using NetworkManager to share the wireless connection of my workstation (Computer 1) to the other (Computer 2). Here's a diagram:

                Internet
                    |
                Wireless router (internal ip: 10.0.1.1)
                    |
                (Wifi)
                    |
Computer 1:     wlan0         eth0
                10.0.1.3      10.42.0.1
                                |
Computer 2:                   eth0
                            10.42.0.48

This setup works; Computer 2 has internet access. Additionally I can VNC or RDP from Computer 1 to Computer 2.

Here's iptables rules after the wired connection is shared by NetworkManager:

$ sudo iptables -nL
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:67
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:67
ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0            udp dpt:53
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:53

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  0.0.0.0/0            10.42.0.0/24         state RELATED,ESTABLISHED
ACCEPT     all  --  10.42.0.0/24         0.0.0.0/0           
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           
REJECT     all  --  0.0.0.0/0            0.0.0.0/0            reject-with icmp-port-unreachable
REJECT     all  --  0.0.0.0/0            0.0.0.0/0            reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Now I want to do some port forwarding so I can access the second computer from the wifi network (10.0.1.*), for example VNC (port 5900).

How can I do this??

Thanks!

share|improve this question

migrated from serverfault.com Oct 17 '13 at 18:20

This question came from our site for system and network administrators.

Use the manual pages iptables-extensions(8) as well as iptables(8) and try yourself first. I'll amend the answer for you when you come up with specific problems.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .