1 |
On Sun, Jun 08, 2014 at 11:25:53AM +0100, Mick wrote: |
2 |
> On Sunday 08 Jun 2014 10:25:40 Matti Nykyri wrote: |
3 |
> > Hi |
4 |
> > |
5 |
> > I also have other problems in my life. One of them is on one of my gentoo |
6 |
> > server. This server has two network cards one serves intranet and the |
7 |
> > other internet. The on that is on the internet is attached to a cable |
8 |
> > modem. The modem is buggy and some times reboots it self losing the link |
9 |
> > so I have ifplugd there get new address via dhcp immediately. Intranet |
10 |
> > card is configured not to use ifplugd. I'm using OpenRC. |
11 |
> |
12 |
> Are you sure of this? How have you configured your intranet card to not be |
13 |
> acted upon by ifplugd? From what I see, ifplugd will pick up any interface in |
14 |
> /etc/init.d: |
15 |
> |
16 |
> EXEC="/etc/init.d/net.$1" |
17 |
|
18 |
Actually it's not ifplugd's fault. It is just the one that restarts services... |
19 |
The restarting is the thing that breaks stuff: |
20 |
|
21 |
-------------------------------------------- |
22 |
|
23 |
server% [13:44] /var/log$ sudo iptables -v -L -t nat |
24 |
Chain POSTROUTING (policy ACCEPT 10142 packets, 743K bytes) |
25 |
pkts bytes target prot opt in out source destination |
26 |
8307 616K MASQUERADE all -- any enp0s10 anywhere anywhere |
27 |
server% [13:45] /var/log$ sudo /etc/init.d/net.enp0s10 stop |
28 |
* Stopping NIS Server ... [ ok ] |
29 |
* samba -> stop: smbd ... [ ok ] |
30 |
* samba -> stop: nmbd ... |
31 |
* start-stop-daemon: 2 process(es) refused to stop [ !! ] |
32 |
* Unmounting network filesystems ... [ ok ] |
33 |
* Stopping chrooted named ... |
34 |
* Umounting chroot dirs ... |
35 |
* umounting /chroot/dns/usr/share/GeoIP ... [ ok ] |
36 |
* umounting /chroot/dns/etc/bind ... [ ok ] |
37 |
* umounting /chroot/dns/var/log/named ... [ ok ] |
38 |
* umounting /chroot/dns/var/bind ... [ ok ] |
39 |
* Stopping dhcpd ... [ ok ] |
40 |
* Bringing down interface enp0s10 |
41 |
* Stopping dhclient on enp0s10 ... [ ok ] |
42 |
* Stopping ifplugd on enp0s10 ... [ ok ] |
43 |
server% [13:45] /var/log$ sudo iptables -v -L -t nat |
44 |
Chain POSTROUTING (policy ACCEPT 10147 packets, 743K bytes) |
45 |
pkts bytes target prot opt in out source destination |
46 |
8309 617K MASQUERADE all -- any enp0s10 anywhere anywhere |
47 |
server% [13:45] /var/log$ sudo /etc/init.d/net.enp0s10 start |
48 |
* Bringing up interface enp0s10 |
49 |
* Changing MAC address of enp0s10 ... [ ok ] |
50 |
* changed to 00:80:23:7A:8A:A4 |
51 |
* Starting ifplugd on enp0s10 ... [ ok ] |
52 |
* Backgrounding ... |
53 |
* WARNING: net.enp0s10 has started, but is inactive |
54 |
server% [13:45] /var/log$ sudo iptables -v -L -t nat |
55 |
Chain POSTROUTING (policy ACCEPT 10147 packets, 743K bytes) |
56 |
pkts bytes target prot opt in out source destination |
57 |
8309 617K MASQUERADE all -- any enp0s10 anywhere anywhere |
58 |
|
59 |
-------------------------------------------- |
60 |
It takes around 40 seconds for dhclient to address from ISP (net-misc/dhcp-4.2.5_p1) |
61 |
After it gets the address iptables is changed: |
62 |
-------------------------------------------- |
63 |
|
64 |
server% [13:45] /var/log$ sudo iptables -v -L -t nat |
65 |
Chain POSTROUTING (policy ACCEPT 2 packets, 152 bytes) |
66 |
pkts bytes target prot opt in out source destination |
67 |
0 0 MASQUERADE all -- any eth1 anywhere anywhere |
68 |
server% [13:48] /var/log$ ps aux | grep dhclient |
69 |
root 22011 0.0 0.2 16200 7108 ? Ss 13:46 0:00 /sbin/dhclient -e PEER_NTP=no -e IF_METRIC=3 -q -1 -pf /var/run/dhclient-enp0s10.pid enp0s10 |
70 |
server% [13:48] /var/log$ ls /etc/init.d/net* |
71 |
lrwxrwxrwx 1 root root 6 Oct 4 2011 /etc/init.d/net.enp0s10 -> net.lo* |
72 |
lrwxrwxrwx 1 root root 6 Oct 4 2011 /etc/init.d/net.enp5s12 -> net.lo* |
73 |
-rwxr-xr-x 1 root root 17412 Jan 2 23:42 /etc/init.d/net.lo* |
74 |
|
75 |
-------------------------------------------- |
76 |
|
77 |
> > The problems are related to iptables and samba. |
78 |
> > |
79 |
> > Samba: when ifplugd runs down the internet card samba is killed. This |
80 |
> > shouldn't happen. Samba is configured only to use intranet card. Samba |
81 |
> > always fails to start when ifplugd starts the internet card. Manual |
82 |
> > starting is required. |
83 |
> > |
84 |
> > Iptables: the system uses new nic names (enp7s0 etc). Iptables has them |
85 |
> > correctly in the rules and in rules save. However when ifplugd cycles the |
86 |
> > internet nic all the nic names in the in-kernel rules change to eth0 an |
87 |
> > eth1. I need to zap iptables and then start it to reset the rules. |
88 |
> |
89 |
> This does not happen here. When ifplugd restarts a NIC it always comes back |
90 |
> with the new consistent naming. Do you have some udev rules defined which are |
91 |
> picked up on the second time that the ifplugd brings up the card, but not the |
92 |
> first? |
93 |
|
94 |
No I don't. And as stated when dhclient sets the address that is the point |
95 |
when the names change. |
96 |
|
97 |
> > Any suggestions where to start? Or just disable ifplugd? |
98 |
> |
99 |
> Have you tried configuring static IP addresses, broadcast and gateways for |
100 |
> each card using the /etc/cong.d/net file? You can still set dhcp as a fall |
101 |
> back if you want, although I am not sure it is necessary for a server in a |
102 |
> static LAN. |
103 |
|
104 |
lol. Yeap... I had an old rules set file that was set to run in |
105 |
postup()-function. Quite embarrassing :/ I don't know how I missed this... |
106 |
|
107 |
modules_enp5s12="!plug" |
108 |
modules_enp0s10="dhclient" |
109 |
|
110 |
So enp5s12 is static and enp0s10 is dynamic with plug and dhcp. |
111 |
|
112 |
> The file /usr/share/doc/netifrc-0.2.2/net.example.bz2 provides suggestions for |
113 |
> different set ups. |
114 |
|
115 |
In the past there was option in the rc.conf to say that eth1 is sufficient for |
116 |
net. I don't wan't any services shutdown if anything drives down the enp0s10 |
117 |
NIC. Is there a way to do that with OpenRC? As you see when I stop enp0s10 all |
118 |
the services that serve intranet are driven down... |
119 |
|
120 |
-- |
121 |
-Matti |