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

Help extends from the entire office network to the entire home network #1155

Open
ld-2022 opened this issue Oct 24, 2023 · 0 comments
Open

Comments

@ld-2022
Copy link

ld-2022 commented Oct 24, 2023

I configured the following based on the document Routing.md

office(192.168.1.0/24)

eth0:192.168.1.220
StarVPN:192.168.188.62

Usage steps
  1. sysctl -w net.ipv4.ip_forward=1
  2. iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
  3. nohup ./n2n -a 192.168.188.62 -c -k -l :6262 -f -r -v -d StarVPN > test.log 2>&1 &
  4. iptables -A FORWARD -i eth0 -o StarVPN -m state --state RELATED,ESTABLISHED -j ACCEPT
  5. iptables -A FORWARD -i StarVPN -o eth0 -j ACCEPT
  6. ./n2n-route -n 192.168.100.0/24 192.168.188.63

home (192.168.100.0/24)

eth0:192.168.100.107
StarVPN:192.168.188.63

Usage steps
  1. sysctl -w net.ipv4.ip_forward=1
  2. iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
  3. nohup ./n2n -a 192.168.188.63 -c -k -l :6262 -f -r -v -d StarVPN > test.log 2>&1 &
  4. iptables -A FORWARD -i eth0 -o StarVPN -m state --state RELATED,ESTABLISHED -j ACCEPT
  5. iptables -A FORWARD -i StarVPN -o eth0 -j ACCEPT
  6. ./n2n-route -n 192.168.1.0/24 192.168.188.62

present situation

Company machine: eth0:192.168.1.220 can access home 192.168.100.0/24
Home machine: eth0:192.168.100.107 You can also access the company 192.168.1.0/24

problem

I want to access my home network (192.168.100.0/24) on company machine: eth0: 192.168.1.225
I have already configured: IP route add 192.168.100.0/24 via 192.168.1.220 dev eth0 src 192.168.1.215 on the company machine: eth0: 192.168.1.225

root@office225:~# ip route
default via 192.168.1.1 dev eth0 proto static
172.16.1.0/24 dev eth1 proto kernel scope link src 172.16.1.16
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.225
192.168.100.0/24 via 192.168.1.220 dev eth0 src 192.168.1.225

But I am unable to connect to 192.168.100.1. It is known that I can connect on 192.168.1.220. May I know where the problem is with my configuration? thanks

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

No branches or pull requests

1 participant