Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
postup() in /etc/conf.d/net gets called - sometimes
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
hefe
n00b
n00b


Joined: 18 Aug 2004
Posts: 58
Location: Germany

PostPosted: Sat Oct 20, 2012 3:57 pm    Post subject: postup() in /etc/conf.d/net gets called - sometimes Reply with quote

Hello,

i am having a problem with my wireless setup. I use the postup()-function from /etc/conf.d/net to set up a minimalistic firewall. The postup()-function will use the dhcp-aquired-ip.

When i use rc-service net.wlan0 start everything is fine and the firewall will be configured.
However, when the laptop is hibernated and i resume at a different site with different ap, i get a new ip but the postup()-function is not called. I can tell this, because the firewall stays at its old configuration.

Question 1) Under which circumstances _exactly_ will postup()-function be called?
Question 2) Where do i put ip-dependend configurations in, if not at postup() in /etc/conf.d/net?

Thank you for any helping comments...
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sat Oct 20, 2012 4:35 pm    Post subject: Re: postup() in /etc/conf.d/net gets called - sometimes Reply with quote

hefe wrote:
When i use rc-service net.wlan0 start everything is fine and the firewall will be configured. However, when the laptop is hibernated and i resume at a different site with different ap, i get a new ip but the postup()-function is not called. I can tell this, because the firewall stays at its old configuration.

hefe ... this sounds quite normal, after hibernate net.${IFACE} isn't restarted so no postup() is called, but as dhcp is running a new IP is aquired.

hefe wrote:
Question 1) Under which circumstances _exactly_ will postup()-function be called?

each and every time net.${IFACE} is (re)started.

hefe wrote:
Question 2) Where do i put ip-dependend configurations in, if not at postup() in /etc/conf.d/net?

Generally something like a iptables should be run prior to network connectivity and an IP is aquired, this is why /etc/init.d/iptables and other firewall scripts, have 'before net', but that isn't the problem, the problem is that your expecting for "ip-dependent" configuration to be consistant across hibernation and the network having changed. The only thing I can suggest is for some script to be called prior and subsequent to hibernate.

best ... khay
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13855

PostPosted: Sat Oct 20, 2012 4:44 pm    Post subject: Reply with quote

Some DHCP clients support running programs in response to specific DHCP events. You may want to have preup configure a generic default-deny firewall, then use the DHCP hook script to configure the settings that you are currently doing in postup.
Back to top
View user's profile Send private message
hefe
n00b
n00b


Joined: 18 Aug 2004
Posts: 58
Location: Germany

PostPosted: Wed Oct 24, 2012 9:58 pm    Post subject: Reply with quote

Thank you khayyam, and thank you Hu,

i decided to add a hook-script into /lib/dhcpcd/dhcpcd-hooks/ which is more or less like my previous postup()-function.

Cheers
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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