LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-10-2009, 05:32 AM   #1
hdinn
LQ Newbie
 
Registered: Jul 2009
Posts: 24

Rep: Reputation: 15
Exclamation how can my pc load my iptables rules on boot????!!!!!


Hello everybody

i've created a bridge with certain iptables rules,but when i reboot the pc the bridge is gone,How can i make the pc boot with and take my bridge configuration on consideration.

thank you
 
Old 08-10-2009, 05:41 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Which distribution?
You can put a script in /etc/rc.local
 
Old 08-10-2009, 06:00 AM   #3
hdinn
LQ Newbie
 
Registered: Jul 2009
Posts: 24

Original Poster
Rep: Reputation: 15
i'm using Ubuntu 9.04
please can you describe more clearer me how to do it????!!!!
thank you
 
Old 08-10-2009, 06:02 AM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
How do you start the firewall rules?
 
Old 08-10-2009, 07:41 AM   #5
hdinn
LQ Newbie
 
Registered: Jul 2009
Posts: 24

Original Poster
Rep: Reputation: 15
this is the shell code that i want to start on system startup.

Code:
ifconfig eth0 0.0.0.0 
      ifconfig eth0 0.0.0.0
 
Old 08-10-2009, 07:44 AM   #6
hdinn
LQ Newbie
 
Registered: Jul 2009
Posts: 24

Original Poster
Rep: Reputation: 15
Exclamation

this is the shell code that i want to start on system startup.

Code:
ifconfig eth0 0.0.0.0 
      ifconfig eth1 0.0.0.0
      brctl addbr br0
      brctl addif br0 eth0
      brctl addif br1 eth1
      ifconfig br0 up
      iptables -F
      iptables -Z
      iptables -A FORWARD -p udp -m limit --limit-burst 10 -j DROP
that's it
 
Old 08-10-2009, 09:38 AM   #7
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Make script and call it bridgeconf

Code:
#! /bin/bash
ifconfig eth0 0.0.0.0 
ifconfig eth1 0.0.0.0
brctl addbr br0
brctl addif br0 eth0
brctl addif br1 eth1
ifconfig br0 up
iptables -F
iptables -Z
iptables -A FORWARD -p udp -m limit --limit-burst 10 -j DROP
make it executable
Quote:
# chmod +x bridgeconf
copy the script to /usr/local/bin
Code:
# cp bridgeconf /usr/local/bin
Add he following line to /etc/resolv.conf
Code:
/usr/local/bin/bridgeconf
Execute /etc/rc.local to see if it works
Code:
# /etc/rc.local
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables-save, but rules don't load on boot-up kpachopoulos Debian 2 11-18-2006 10:36 PM
how can i load iptables rules at startup synaptical Debian 6 07-15-2005 11:28 AM
RH8 - how to automatically run iptables rules shell script at boot time nu-B Linux - General 1 10-29-2003 08:38 PM
how to get iptables to load rules on startup ? qwijibow Linux - Security 5 09-02-2003 09:48 AM
I can't load iptables rules Kinstonian Linux - General 15 04-13-2003 07:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration