Skip to content

Instantly share code, notes, and snippets.

@kostyll
Created December 13, 2014 12:00
Show Gist options
  • Save kostyll/b559c74954bfe72c9b7a to your computer and use it in GitHub Desktop.
Save kostyll/b559c74954bfe72c9b7a to your computer and use it in GitHub Desktop.
share inet in linux
#!/bin/bash
## Internet connection shating script
sysctl -w net.ipv4.ip_forward=1
sysctl -p
iptables -X
iptables -F
iptables -t nat -X
iptables -t nat -F
iptables -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -I POSTROUTING -o ppp0 -j MASQUERADE
@kostyll
Copy link
Author

kostyll commented Dec 13, 2014

http://xmodulo.com/internet-connection-sharing-iptables-linux.html - how to share inet with linux device with 2 network interfaces

http://windows.microsoft.com/uk-ua/windows7/allow-remote-desktop-connections-from-outside-your-home-network - manual to allow remote connections on the win 7

linux tool for remote accessing via rdp - krdc

@kostyll
Copy link
Author

kostyll commented Dec 13, 2014

stupid solution of changing ip if the system is changing it to:
while true ; do sudo ifconfig eth1 192.168.1.1 ; done

@kostyll
Copy link
Author

kostyll commented Dec 13, 2014

if there is NetworkManager:
nm-applet
nm-connection-editor

@kostyll
Copy link
Author

kostyll commented Dec 20, 2014

http://www.hydro.washington.edu/~jhamman/hydro-logic/blog/2013/10/04/pybook-remote/

freesshd.com

192.168.1.2:/d/andrew on /media/dasha_d type nfs (rw,addr=192.168.1.2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment