blob: 005320cfec976887db15449c4fa7ecd2ea304f81 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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/)
|