Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iptables rules is not apply to WSL ubuntu #35

Closed
yunlzheng opened this issue Oct 31, 2019 · 1 comment
Closed

Iptables rules is not apply to WSL ubuntu #35

yunlzheng opened this issue Oct 31, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request wsl

Comments

@yunlzheng
Copy link
Collaborator

Describe the bug

Iptables rules is not apply to WSL ubuntu

Log

Forwarding from 127.0.0.1:2222 -> 22
Forwarding from [::1]:2222 -> 22
2:47AM DBG port-forward start at pid: 5538
2:47AM DBG Child, os.Args = [ktctl -d connect]
2:47AM DBG Child, cmd.Args = [sshuttle --dns --to-ns 172.16.0.72 -v -e ssh -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -i /root/.kt_id_rsa -r root@127.0.0.1:2222 -x 127.0.0.1 172.16.1.0/25 172.16.0.128/25 172.16.0.0/25 172.19.0.0/16]
Starting sshuttle proxy.
firewall manager: Starting firewall with Python version 2.7.6
firewall manager: ready method name nat.
IPv6 enabled: False
UDP enabled: False
DNS enabled: True
User enabled: False
TCP redirector listening on ('127.0.0.1', 12300).
DNS listening on ('127.0.0.1', 12299).
Starting client with Python version 2.7.6
c : connecting to server...
Handling connection for 2222
Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.
c : Connected.
firewall manager: setting up.
Starting server with Python version 3.5.2
 s: latency control setting = True
 s: auto-nets:False
>> iptables -t nat -N sshuttle-12300
>> iptables -t nat -F sshuttle-12300
>> iptables -t nat -I OUTPUT 1 -j sshuttle-12300
>> iptables -t nat -I PREROUTING 1 -j sshuttle-12300
>> iptables -t nat -A sshuttle-12300 -j RETURN --dest 127.0.0.1/32 -p tcp
>> iptables -t nat -A sshuttle-12300 -j REDIRECT --dest 172.16.1.0/25 -p tcp --to-ports 12300 -m ttl ! --ttl 42
>> iptables -t nat -A sshuttle-12300 -j REDIRECT --dest 172.16.0.128/25 -p tcp --to-ports 12300 -m ttl ! --ttl 42
>> iptables -t nat -A sshuttle-12300 -j REDIRECT --dest 172.16.0.0/25 -p tcp --to-ports 12300 -m ttl ! --ttl 42
>> iptables -t nat -A sshuttle-12300 -j REDIRECT --dest 172.19.0.0/16 -p tcp --to-ports 12300 -m ttl ! --ttl 42
>> iptables -t nat -A sshuttle-12300 -j REDIRECT --dest 10.0.2.3/32 -p udp --dport 53 --to-ports 12299 -m ttl ! --ttl 42
2:47AM DBG vpn(sshuttle) start at pid: 5547
2:47AM DBG KT proxy start successful
$ iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
sshuttle-12300  all  --  anywhere             anywhere

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
sshuttle-12300  all  --  anywhere             anywhere

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination

Chain sshuttle-12300 (0 references)
target     prot opt source               destination
RETURN    all  --  anywhere             anywhere

Environment (please complete the following information):

  • OS: [e.g. Windows 10 WSL ubuntu]
  • Kubernetes [1.10.1]
  • KT Version [0.0.6]

Additional context

@yunlzheng yunlzheng added the enhancement New feature or request label Oct 31, 2019
@yunlzheng yunlzheng self-assigned this Oct 31, 2019
@yunlzheng yunlzheng added the wsl label Nov 27, 2019
@linfan
Copy link
Collaborator

linfan commented Dec 9, 2020

Windows的wsl内核不带iptables服务,因为Windows有自己的防火墙服务,这个issue先关了哈

@linfan linfan closed this as completed Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wsl
Projects
None yet
Development

No branches or pull requests

2 participants