Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Documentation on assigning IP address to a network interface #3

Open
skyred opened this issue Jul 5, 2015 · 3 comments
Open

Documentation on assigning IP address to a network interface #3

skyred opened this issue Jul 5, 2015 · 3 comments

Comments

@skyred
Copy link

skyred commented Jul 5, 2015

I followed the documentation and created a simple server without auth.
Then, I compiled a client and connected to the server, as the server printed

[Sat Jul  4 21:13:14 2015] registered new peer 5 MAC=1E:8A:66:ED:70:82 REMOTE_ADDR=XXX.XXX.XXX.XXX REMOTE_USER= DN=

and the client printed

[Sun Jul  5 09:13:14 2015] connecting to XXX.XXX.XXX.XXX port 80 (transport: ws)
[Sun Jul  5 09:13:15 2015] connected to XXX.XXX.XXX.XXX port 80 (transport: ws)

Now, I simply visited a web page to show my client IP, but it still displayed my real client IP. I realized that I have not done this step specified in the documentation:

Once your client is connected you can assign it an ip address (or make a dhcp request if one of the connected nodes has a running dhcp server)

I Googled around, and found a simple step on my Ubuntu 14.10:

/sbin/ip link # To show my current network interfaces, and I see vpn-ws0
sudo /sbin/ip addr add 192.168.0.10/24 dev vpn-ws0

No error returned. Then, I re-checked my ip address on a website, it still showed the real client IP.

So, I am wondering what I did wrong.

@unbit
Copy link
Owner

unbit commented Jul 5, 2015

The --exec trick is safer (and faster) than manually calling network setup:

https://github.com/unbit/vpn-ws#the---exec-trick

For your specific setup (network anonimizer) you need the following steps:

  • assign the ip address to the vpn-ws0 interface
  • assign a route for the vpn server using you router ip as gateway
  • remove default routing rule
  • add the vpn peer ip as the new default gw

So, if your local vpn peer is 192.168.0.10 and the server is 192.168.0.1 and you home router is 1.2.3.4 and your http server is 5.6.7.8:

ifconfig vpn-ws0 192.168.0.10
route add -host 5.6.7.8 gw 1.2.3.4
route del default
route add default gw 192.168.0.1

@skyred
Copy link
Author

skyred commented Jul 5, 2015

Thank you very much! But, I am a little afraid to carry on the rest of experiment on my laptop, as I don't know enough, and I would need to research how to undo things first.

I will try to post back my process.

@luckypoem
Copy link

@skyred ,
你好,你成功的用此程序翻墙了吗?我还是失败,看看这里 #6 ,如果你成功了,可指点一下我该怎么做吗

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants