This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
сервисы_gateway_и_routing [2022/03/09 15:38] val [Протокол OSPF] |
сервисы_gateway_и_routing [2024/06/24 05:41] (current) val [Протокол OSPF] |
||
---|---|---|---|
Line 13: | Line 13: | ||
net.ipv4.ip_forward = 1 | net.ipv4.ip_forward = 1 | ||
- | root@gate:~# cat /etc/sysctl.conf | + | root@gate:~# cat /etc/sysctl.d/20-my-forward.conf |
</code><code> | </code><code> | ||
- | ... | ||
net.ipv4.ip_forward=1 | net.ipv4.ip_forward=1 | ||
- | ... | ||
</code><code> | </code><code> | ||
- | root@gate:~# sysctl -f | + | root@gate:~# sysctl -p --system |
</code> | </code> | ||
Line 46: | Line 44: | ||
# ip route help | # ip route help | ||
- | # ip r add 192.168.Y.0/24 via 172.16.1.Y | + | gate.isp.un# ip r add 192.168.Y.0/24 via 172.16.1.Y |
+ | |||
+ | gate# | ||
+ | ip r add 192.168.110.0/24 via 192.168.X.201 | ||
+ | ip r add 192.168.120.0/24 via 192.168.X.202 | ||
+ | ip r add 192.168.130.0/24 via 192.168.X.203 | ||
# ip r del 192.168.Y.0/24 | # ip r del 192.168.Y.0/24 | ||
+ | |||
+ | ip route add|del blackhole|unreachable 192.168.100+X.201 | ||
</code> | </code> | ||
Line 89: | Line 94: | ||
==== Debian/Ubuntu ==== | ==== Debian/Ubuntu ==== | ||
+ | |||
+ | * [[https://linuxconfig.org/how-to-add-static-route-with-netplan-on-ubuntu-20-04-focal-fossa-linux|How to add static route with netplan]] | ||
+ | |||
<code> | <code> | ||
root@gate:~# cat /etc/network/interfaces | root@gate:~# cat /etc/network/interfaces | ||
Line 124: | Line 132: | ||
==== Протокол OSPF ==== | ==== Протокол OSPF ==== | ||
- | === Установка === | + | === frr === |
+ | |||
+ | * [[https://docs.frrouting.org/en/latest/setup.html]] | ||
+ | |||
+ | <code> | ||
+ | # apt install frr | ||
+ | |||
+ | # cat /etc/frr/daemons | ||
+ | </code><code> | ||
+ | ... | ||
+ | ospfd=yes | ||
+ | ... | ||
+ | </code><code> | ||
+ | # systemctl restart frr | ||
+ | |||
+ | # ps ax | grep frr | ||
+ | |||
+ | # vtysh | ||
+ | ... | ||
+ | # show run | ||
+ | </code> | ||
+ | |||
+ | === quagga === | ||
=== Debian/Ubuntu === | === Debian/Ubuntu === | ||
Line 292: | Line 322: | ||
iptables -t nat -A POSTROUTING -o eth1 -s 192.168.X.0/24 -j SNAT --to-source 172.16.1.X | iptables -t nat -A POSTROUTING -o eth1 -s 192.168.X.0/24 -j SNAT --to-source 172.16.1.X | ||
- | iptables -t nat -A POSTROUTING -o eth3 -s 192.168.X.0/24 -j SNAT --to-source 172.16.2.X | + | iptables -t nat -A POSTROUTING -o eth2 -s 192.168.X.0/24 -j SNAT --to-source 172.16.2.X |
- | #iptables -t nat -A POSTROUTING -o eth2 -s 192.168.X.0/24 -j SNAT --to-source 172.16.2.X | + | |
conntrack -F | conntrack -F |