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 | ||
настройка_шлюза_в_классе [2017/04/06 08:15] val [Ubuntu] |
настройка_шлюза_в_классе [2020/09/29 16:16] val [DNS] |
||
---|---|---|---|
Line 3: | Line 3: | ||
===== ISP1 ===== | ===== ISP1 ===== | ||
- | ==== FreeBSD/Ubuntu ==== | + | ==== FreeBSD/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 78: | Line 78: | ||
iptables -t nat -A POSTROUTING -s 172.16.1.254 -j ACCEPT | iptables -t nat -A POSTROUTING -s 172.16.1.254 -j ACCEPT | ||
- | iptables -t nat -A POSTROUTING -s 172.16.1.0/24,192.168.0.0/16 -j SNAT --to-source 10.M.N.252 | + | iptables -t nat -A POSTROUTING -s 172.16.1.0/24,192.168.0.0/16 -j SNAT --to-source 10.M.N.178 |
conntrack -F | conntrack -F | ||
Line 94: | Line 94: | ||
iface eth0 inet static | iface eth0 inet static | ||
pre-up iptables-restore < /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 195: | Line 195: | ||
openvas.isp A 172.16.1.252 | openvas.isp A 172.16.1.252 | ||
+ | $GENERATE 1-9 router$.isp A 172.16.1.19$ | ||
- | ;for un2, bsd2, un3, asterisk2 | + | ;for lin2, lin3, lin5, asterisk2 |
;$GENERATE 1-26 ns$ A 172.16.1.$ | ;$GENERATE 1-26 ns$ A 172.16.1.$ | ||
;$GENERATE 1-26 ns$ A 192.168.$.10 | ;$GENERATE 1-26 ns$ A 192.168.$.10 | ||
;$GENERATE 1-26 corp$ NS ns$ | ;$GENERATE 1-26 corp$ NS ns$ | ||
- | ; for uncom, un1, bsd1 | + | ;for lin1 |
;$GENERATE 27-37 server.corp$ A 172.16.1.$ | ;$GENERATE 27-37 server.corp$ A 172.16.1.$ | ||
Line 246: | Line 247: | ||
;$GENERATE 1-9 comp$ A 172.16.1.20$ | ;$GENERATE 1-9 comp$ A 172.16.1.20$ | ||
- | ;for msc, un4, unbez | + | ;for lin7, lin3 |
$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 38-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 38-55 router.corp$ A 192.168.$.1 | ||
+ | $GENERATE 38-55 switch.corp$ A 192.168.$.3 | ||
+ | $GENERATE 38-55 switch1.corp$ A 192.168.$.3 | ||
+ | $GENERATE 38-55 switch2.corp$ A 192.168.$.4 | ||
+ | $GENERATE 38-55 switch3.corp$ A 192.168.$.5 | ||
;$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 | ||
Line 271: | Line 276: | ||
$GENERATE 40-55 20.$ PTR mgmt.corp$.un. | $GENERATE 40-55 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 317: | ||
===== 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 330: | Line 339: | ||
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 |