Здравейте!
Имам убунту, което е настроено да рутира по следния начин
eth0 = 192.168.0.1 = secured / internal network
eth1 = 192.168.1.1 = unsecured / external network
iptables :
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables -A FORWARD -s 192.168.0.0/24 -j ACCEPT
iptables -A FORWARD -d 192.168.0.0/24 -j ACCEPT
iptables -A FORWARD -s ! 192.168.0.0/24 -j DROP
Има и DHCP server (не е важно). Отвътре на вън се достига всичко, но имам сървър, разположен в локалната мрежа (зад убунту рутера), който от локалната мрежа не е достъпен през външното IP.
пояснявам :
1. локалното IP на сървъра е да речем 192.168.50.100.
2. външното IP на рутера е 99,99,99,99.
От вън ip адреса 99,99,99,99 е достъпен, но от мрежата 192,168,50,0 не е! пренасочил съм портове отвън към сървъра вътре.
моля за насока?!
P.S. Не обръщайте внимание, че не съвпадат ИП-тата... интересува ме идеята, останалото съм го напаснал. Само да допълня, че вътрешната лан карта на убунту рутер-а е с две IP-та
$ cat /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.5.1
netmask 255.255.255.0
auto eth1
iface eth1 inet static
address 94.26.УУ.УУУ
netmask 255.255.255.224
gateway 94.26.УУ.УУУ
auto eth0:1
iface eth0:1 inet static
address 94.26.ХХ.ХХХ
netmask 255.255.255.248
network 94.26.ХХ.ХХХ
broadcast 94.26.ХХ.ХХХ
# iptables -vL
Chain INPUT (policy ACCEPT 520K packets, 41M bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 8660 packets, 502K bytes)
pkts bytes target prot opt in out source destination
2690K 1203M ACCEPT all -- eth1 eth0 anywhere anywhere state RELATED,ESTABLISHED
4220K 1548M ACCEPT all -- eth0 eth1 anywhere anywhere
0 0 ACCEPT gre -- eth0 eth1 anywhere anywhere
0 0 ACCEPT gre -- eth1 eth0 anywhere anywhere
8660 502K LOG all -- any any anywhere anywhere LOG level warning
0 0 ACCEPT all -- eth0 eth1 anywhere anywhere
0 0 ACCEPT all -- eth0 eth0:1 anywhere anywhere state RELATED,ESTABLISHED
0 0 ACCEPT all -- eth0 eth0:1 anywhere anywhere state RELATED,ESTABLISHED
0 0 ACCEPT all -- eth0 eth1 anywhere anywhere
0 0 ACCEPT all -- eth0 eth0:1 anywhere anywhere
Chain OUTPUT (policy ACCEPT 495K packets, 41M bytes)
pkts bytes target prot opt in out source destination
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
94.26.xx.xxx 0.0.0.0 255.255.255.248 U 0 0 0 eth0
94.26.yy.yyy 0.0.0.0 255.255.255.224 U 0 0 0 eth1
192.168.5.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 94.26.xx.xxx 0.0.0.0 UG 100 0 0 eth1
Надявам се някой все пак да разбере нещо от потресаващото ми обяснение...