summaryrefslogtreecommitdiffstats
path: root/core/modules/printergui/data/opt/openslx/iptables/rules.d/50-lpd-redirect-and-fw
blob: 8e73536c79c46942aefb2a715ed3669d345e0b65 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/ash

# Redirect from VM to lpd - outside should not get routed anyways, so checking destination should
# be enough
iptables -t nat -A PREROUTING -d 192.168.101.1 -p tcp --dport 515 -j REDIRECT --to-port 5515
iptables -t nat -A PREROUTING -d 192.169.101.1 -p tcp --dport 515 -j REDIRECT --to-port 5515
iptables -t nat -A PREROUTING -d 100.100.100.100 -p tcp --dport 515 -j REDIRECT --to-port 5515
# Close from outside
iptables -A INPUT -s 192.168.101.0/24 -p tcp --dport 5515 -j ACCEPT
iptables -A INPUT -p tcp --dport 5515 -j ACCEPT
iptables -A INPUT -p tcp --dport 515 -j DROP
exit 0