Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iptables neues interface mit gleichen regeln
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
stream
Guru
Guru


Joined: 04 Jan 2003
Posts: 401

PostPosted: Fri Dec 26, 2008 11:23 pm    Post subject: iptables neues interface mit gleichen regeln Reply with quote

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
View user's profile Send private message
Polynomial-C
Retired Dev
Retired Dev


Joined: 01 Jun 2003
Posts: 1432
Location: Germany

PostPosted: Fri Dec 26, 2008 11:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
stream
Guru
Guru


Joined: 04 Jan 2003
Posts: 401

PostPosted: Sat Dec 27, 2008 12:05 am    Post subject: Reply with quote

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
View user's profile Send private message
Polynomial-C
Retired Dev
Retired Dev


Joined: 01 Jun 2003
Posts: 1432
Location: Germany

PostPosted: Sat Dec 27, 2008 12:31 am    Post subject: Reply with quote

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
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Sat Dec 27, 2008 1:24 am    Post subject: Reply with quote

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
View user's profile Send private message
stream
Guru
Guru


Joined: 04 Jan 2003
Posts: 401

PostPosted: Sat Dec 27, 2008 12:24 pm    Post subject: Reply with quote

danke für eure vorschläge ... ich werde mir mal überlegen die ich das am besten mache
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum