This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
настройка_шлюза_в_классе [2016/11/08 09:17] val [FreeBSD/Ubuntu] |
настройка_шлюза_в_классе [2020/09/25 10:34] val [Debian/Ubuntu] |
||
---|---|---|---|
Line 59: | Line 59: | ||
</code> | </code> | ||
- | ==== Ubuntu ==== | + | ==== Debian/Ubuntu ==== |
<code> | <code> | ||
root@nessus.isp.un:~# cat /etc/hostname | root@nessus.isp.un:~# cat /etc/hostname | ||
Line 84: | Line 84: | ||
root@nessus.isp.un:~# sh nat.sh | root@nessus.isp.un:~# sh nat.sh | ||
- | root@nessus.isp.un:~# iptables-save -c > /etc/iptables.rules | + | root@nessus.isp.un:~# iptables-save > /etc/iptables.rules |
</code><code> | </code><code> | ||
root@nessus.isp.un:~# cat /etc/network/interfaces | root@nessus.isp.un:~# cat /etc/network/interfaces | ||
Line 93: | Line 93: | ||
auto eth0 | auto eth0 | ||
iface eth0 inet static | iface eth0 inet static | ||
- | pre-up iptables-restore -c < /etc/iptables.rules | + | pre-up iptables-restore < /etc/iptables.rules |
- | address 10.N.M.252 | + | address 10.N.M.178 |
netmask 255.255.255.0 | netmask 255.255.255.0 | ||
gateway 10.N.M.254 | gateway 10.N.M.254 | ||
Line 105: | Line 105: | ||
# up route add -net 192.168.1.0 netmask 255.255.255.0 gw 172.16.1.1 | # up route add -net 192.168.1.0 netmask 255.255.255.0 gw 172.16.1.1 | ||
# ... | # ... | ||
- | # up route add -net 192.168.20.0 netmask 255.255.255.0 gw 172.16.1.20 | + | # up route add -net 192.168.55.0 netmask 255.255.255.0 gw 172.16.1.55 |
</code><code> | </code><code> | ||
- | # cat route.sh | + | # cat route.bash |
</code><code> | </code><code> | ||
- | for i in `jot 20 1` | + | for i in {1..55} |
do | do | ||
#route add -net 192.168.${i}.0 netmask 255.255.255.0 gw 172.16.1.${i} | #route add -net 192.168.${i}.0 netmask 255.255.255.0 gw 172.16.1.${i} | ||
- | #echo up route add -net 192.168.${i}.0 netmask 255.255.255.0 gw 172.16.1.${i} | + | #echo " " up route add -net 192.168.${i}.0 netmask 255.255.255.0 gw 172.16.1.${i} |
done | done | ||
</code><code> | </code><code> | ||
- | root@nessus.isp.un:~# cat createuser.sh | + | root@nessus.isp.un:~# cat createuser.bash |
</code><code> | </code><code> | ||
- | for i in `jot 20 1` | + | for i in {1..55} |
do | do | ||
echo $i | echo $i | ||
Line 134: | Line 134: | ||
* [[Сервис MTA]] для зоны isp.un | * [[Сервис MTA]] для зоны isp.un | ||
- | === DNS === | + | ===== DNS ===== |
* [[Сервис DNS]] | * [[Сервис DNS]] | ||
Line 249: | Line 249: | ||
$GENERATE 38-55 server.corp$ A 192.168.$.10 | $GENERATE 38-55 server.corp$ A 192.168.$.10 | ||
$GENERATE 38-55 www.corp$ A 192.168.$.20 | $GENERATE 38-55 www.corp$ A 192.168.$.20 | ||
- | $GENERATE 39-55 gate.corp$ A 192.168.$.1 | + | $GENERATE 38-55 gate.corp$ A 192.168.$.1 |
+ | $GENERATE 38-55 router.corp$ A 192.168.$.1 | ||
;$GENERATE 1-9 lan.corp$ A 192.168.10$.10 | ;$GENERATE 1-9 lan.corp$ A 192.168.10$.10 | ||
$GENERATE 38-55 lan.corp$ A 192.168.1$.10 | $GENERATE 38-55 lan.corp$ A 192.168.1$.10 | ||
$GENERATE 38-55 corp$ A 192.168.$.10 | $GENERATE 38-55 corp$ A 192.168.$.10 | ||
$GENERATE 38-55 mgmt.corp$ A 192.168.$.20 | $GENERATE 38-55 mgmt.corp$ A 192.168.$.20 | ||
- | |||
</code><code> | </code><code> | ||
# cat 192.168.rev | # cat 192.168.rev | ||
Line 263: | Line 263: | ||
NS ns.un. | NS ns.un. | ||
- | ;$GENERATE 1-20 1.$ PTR gate.corp$.un. | + | ;for msc, un4, unbez, !!! not for un3 |
- | $GENERATE 1-20 10.$ PTR server.corp$.un. | + | ;$GENERATE 40-55 1.$ PTR gate.corp$.un. |
+ | $GENERATE 40-55 1.$ PTR router.corp$.un. | ||
- | ;$GENERATE 1-20 1.$ PTR router.corp$.un. | + | $GENERATE 40-55 10.$ PTR server.corp$.un. |
- | $GENERATE 1-20 3.$ PTR switch.corp$.un. | + | $GENERATE 40-55 3.$ PTR switch.corp$.un. |
- | + | $GENERATE 40-55 20.$ PTR mgmt.corp$.un. | |
- | $GENERATE 1-20 20.$ PTR mgmt.corp$.un. | + | |
</code><code> | </code><code> | ||
- | # cat dns.sh | + | # cat isp.dns.sh |
</code><code> | </code><code> | ||
STANDS="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" | STANDS="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" | ||
Line 312: | Line 312: | ||
===== ISP2 ===== | ===== ISP2 ===== | ||
- | ==== Ubuntu ==== | + | ==== Debian/Ubuntu ==== |
<code> | <code> | ||
+ | # git clone http://val.bmstu.ru/unix/conf.git | ||
+ | |||
+ | # cat conf/isp2/readme.txt | ||
+ | |||
root@gate.isp2.un:~# cat /etc/network/interfaces | root@gate.isp2.un:~# cat /etc/network/interfaces | ||
</code><code> | </code><code> | ||
Line 326: | Line 330: | ||
auto eth0:0 | auto eth0:0 | ||
iface eth0:0 inet static | iface eth0:0 inet static | ||
- | pre-up iptables-restore -c < /etc/iptables.rules | + | pre-up iptables-restore < /etc/iptables.rules |
address 10.N.M.179 | address 10.N.M.179 | ||
netmask 255.255.255.0 | netmask 255.255.255.0 | ||
gateway 10.N.M.254 | gateway 10.N.M.254 | ||
- | |||
- | auto eth0:1 | ||
- | iface eth0:1 inet static | ||
- | address 172.16.1.60 | ||
- | netmask 255.255.255.0 | ||
</code><code> | </code><code> | ||
root@gate.isp2.un:~# cat nat.sh | root@gate.isp2.un:~# cat nat.sh |