Gre tunnel linux: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| Zeile 45: | Zeile 45: | ||
*ip link set gretun up | *ip link set gretun up | ||
*ip route add 192.168.33.0/24 via 172.30.30.1 | *ip route add 192.168.33.0/24 via 172.30.30.1 | ||
| + | =Static= | ||
| + | ==garlic== | ||
| + | <pre> | ||
| + | auto gretun | ||
| + | iface gretun inet static | ||
| + | address 172.30.30.1 | ||
| + | pointopoint 172.30.30.2 | ||
| + | pre-up ip tunnel add gretun mode gre remote 10.82.1.195 local 10.82.1.211 ttl 255 | ||
| + | post-up ip route add 192.168.55.0/24 via 172.30.30.2 | ||
| + | </pre> | ||
| + | ==hubsi== | ||
| + | <pre> | ||
| + | auto gretun | ||
| + | iface gretun inet static | ||
| + | address 172.30.30.2 | ||
| + | pointopoint 172.30.30.1 | ||
| + | pre-up ip tunnel add gretun mode gre remote 10.82.1.211 local 10.82.1.195 ttl 255 | ||
| + | post-up ip route add 192.168.33.0/24 via 172.30.30.1 | ||
| + | </pre> | ||
Version vom 24. Oktober 2019, 10:02 Uhr
Aufbau
-192.168.33.1/24 -|garlic|-10.82.1.211---------------------10.82.1.195-|hubsi|-192.168.55.1/24
Interfaces
garlic
auto ens18 iface ens18 inet static address 10.82.1.211 netmask 255.255.0.0 gateway 10.82.0.1 auto dummy0 iface dummy0 inet static address 192.168.33.1 netmask 255.255.255.0 pre-up ip link add dummy0 type dummy
hubsi
auto ens18 iface ens18 inet static address 10.82.1.195 netmask 255.255.0.0 gateway 10.82.0.1 auto dummy0 iface dummy0 inet static address 192.168.55.1 netmask 255.255.255.0 pre-up ip link add dummy0 type dummy
Ipfordward on
- cat /etc/sysctl.conf
net.ipv4.ip_forward=1
- sysctl -p
Manuell
garlic
- ip tunnel add gretun mode gre remote 10.82.1.195 local 10.82.1.211 ttl 255
- ip address add dev gretun 172.30.30.1 peer 172.30.30.2/32
- ip link set gretun up
- ip route add 192.168.55.0/24 via 172.30.30.2
hubsi
- ip tunnel add gretun mode gre remote 10.82.1.211 local 10.82.1.195 ttl 255
- ip address add dev gretun 172.30.30.2 peer 172.30.30.1/32
- ip link set gretun up
- ip route add 192.168.33.0/24 via 172.30.30.1
Static
garlic
auto gretun iface gretun inet static address 172.30.30.1 pointopoint 172.30.30.2 pre-up ip tunnel add gretun mode gre remote 10.82.1.195 local 10.82.1.211 ttl 255 post-up ip route add 192.168.55.0/24 via 172.30.30.2
hubsi
auto gretun iface gretun inet static address 172.30.30.2 pointopoint 172.30.30.1 pre-up ip tunnel add gretun mode gre remote 10.82.1.211 local 10.82.1.195 ttl 255 post-up ip route add 192.168.33.0/24 via 172.30.30.1