aboutsummaryrefslogtreecommitdiff
path: root/source/notes/2016-12-13-nat.md
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/notes/2016-12-13-nat.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/source/notes/2016-12-13-nat.md b/source/notes/2016-12-13-nat.md
new file mode 100644
index 00000000..005320cf
--- /dev/null
+++ b/source/notes/2016-12-13-nat.md
@@ -0,0 +1,30 @@
+---
+title: "nat"
+date: 2016-12-13T09:14:00
+date_display: Dec 13, 2016
+---
+
+Mise en place du NAT sur archlinux :
+
+
+```sh
+# ip link set up dev net0
+# ip addr add 192.168.123.100/24 dev net0
+# sysctl net.ipv4.ip_forward=1
+# iptables -t nat -A POSTROUTING -o internet0 -j MASQUERADE
+# iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
+# iptables -A FORWARD -i net0 -o internet0 -j ACCEPT
+```
+
+Mise en place d'une ip fixe sur debian :
+```sh
+# ifconfig eth0 192.168.123.101 netmask 255.255.255.0
+# route add default gw 192.168.123.100 eth0
+```
+
+Sources :
+
+- [https://wiki.archlinux.org/index.php/Internet_sharing](https://wiki.archlinux.org/index.php/Internet_sharing)
+
+- [http://www.howtogeek.com/118337/stupid-geek-tricks-change-your-ip-address-from-the-command-line-in-linux/](http://www.howtogeek.com/118337/stupid-geek-tricks-change-your-ip-address-from-the-command-line-in-linux/)
+