View previous topic :: View next topic |
Author |
Message |
stream Guru
Joined: 04 Jan 2003 Posts: 401
|
Posted: Fri Dec 26, 2008 11:23 pm Post subject: iptables neues interface mit gleichen regeln |
|
|
hi,
ich möchte mein bestehendes iptables script erweitern, da ich ein neues netzwerkinterface (eth4) habe.
im script nutze ich einige rules mit mit der option "-i eth0"
alle diese rules möchte ich auch für eth4 verwenden...
leider ist es aber nicht möglich mehrere inferfaces (-i eth0, eth4) zu definieren (oder liege ich da falsch?)
welche möglichkeiten gibt es mein problem zu lösen? |
|
Back to top |
|
|
Polynomial-C Retired Dev
Joined: 01 Jun 2003 Posts: 1432 Location: Germany
|
Posted: Fri Dec 26, 2008 11:28 pm Post subject: |
|
|
Du könntest alle betreffenden Regeln in eine for-Schleife packen: Code: | for iface in eth0 eth4 ; do
iptables [blah] -i ${iface}
iptables [nochmehrblah] -i ${iface}
done |
_________________ The manual said "Requires Windows10 or better" so I installed GNU/Linux...
my portage overlay
Need a stage1 tarball? (Unofficial builds) |
|
Back to top |
|
|
stream Guru
Joined: 04 Jan 2003 Posts: 401
|
Posted: Sat Dec 27, 2008 12:05 am Post subject: |
|
|
danke für deine antwort
ich sehe schon, dass ich nicht drum herum komme mein script stark zu verändern....
warum gibt es eigentlich nicht die möglichkeit mit -i mehrere interfaces zu definieren? |
|
Back to top |
|
|
Polynomial-C Retired Dev
Joined: 01 Jun 2003 Posts: 1432 Location: Germany
|
Posted: Sat Dec 27, 2008 12:31 am Post subject: |
|
|
Reine Vermutung, aber ich denke das hat damit zu tun, daß iptables interface-orientiert konzipiert wurde.
Mit absoluter Sicherheit wird dir das allerdings nur einer der iptables-Programmierer sagen können. _________________ The manual said "Requires Windows10 or better" so I installed GNU/Linux...
my portage overlay
Need a stage1 tarball? (Unofficial builds) |
|
Back to top |
|
|
think4urs11 Bodhisattva
Joined: 25 Jun 2003 Posts: 6659 Location: above the cloud
|
Posted: Sat Dec 27, 2008 1:24 am Post subject: |
|
|
Einen 'dirty trick' gäbe es schon.
Benenne deine Interfaces nicht eth* sondern via udev z.B. wie folgt:
LAN-1 (ehemals eth0)
LAN-2 (ehemals eth4)
WAN-DSL (ehemals eth1)
DMZ (ehemals eth2)
WAN-UMTS (ehemals eth3)
...
Dann kannst du eine Regel bauen wie z.B. iptables -A FORWARD -i LAN+ -o WAN-DSL -j ACCEPT
Das '+' deckt hier alle Interfaces ab die LAN* heißen. _________________ Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself |
|
Back to top |
|
|
stream Guru
Joined: 04 Jan 2003 Posts: 401
|
Posted: Sat Dec 27, 2008 12:24 pm Post subject: |
|
|
danke für eure vorschläge ... ich werde mir mal überlegen die ich das am besten mache |
|
Back to top |
|
|
|