Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

First, I love Fedora 20. :) I'm newcomers from Debian/Ubuntu/Suse, but I real like this clean distro.

But I found some problems, and can't move forward with this little things.

I have 2 PC in home network, both under Fedora (Gnome and LXDE edition).

On "main" PC, who's role is gate to external network, I need run command for sync MTU between interfaces/networks:

iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

I can't found modern replace for this old-school command. All other commands for network like masquerading and change active zone I save by

firewall-cmd bla-bla-bla --permanent

So, one command who's must run at startup system is above "iptables ..". Ok.

For this I create new file:

$ cat /usr/lib/systemd/system/setup-mtu.service
[Unit]
Description=Настройка MTU на шлюзе для нормальной работы инета в домашней сети

[Service]
Type=forking
ExecStart=/usr/sbin/iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
KillMode=process

[Install]
WantedBy=multi-user.target

Enable this service. And have good status after reboot:

$ sudo systemctl status setup-mtu.service
setup-mtu.service - Настройка MTU на шлюзе для нормальной работы инета в домашней сети
   Loaded: loaded (/usr/lib/systemd/system/setup-mtu.service; enabled)
   Active: inactive (dead) since Пн 2014-01-27 16:18:06 MSK; 7h ago
  Process: 22933 ExecStart=/usr/sbin/iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu (code=exited, status=0/SUCCESS)

янв 27 16:18:06 localhost.localdomain systemd[1]: Started Настройка MTU на шлюзе д...и.
Hint: Some lines were ellipsized, use -l to show in full.

But in real, I need manual run this command every time after reboot PC. The same problem was happens with other network commands. So I passed this problem with firewall-cmd ... --permanent command. Until MTU sync. :((

I need your help!

Why network setting don't real apply at startup scripts with service?

share|improve this question
    
Why are you making your own service for iptables when fedora already has one? –  jordanm Jan 28 at 4:41
    
Please, give me more information what you meanings! –  user42104 Jan 28 at 6:19

1 Answer 1

Problem is SOLVED.

I found new-style command for MTU sync:

sudo firewall-cmd --permanent --direct --add-passthrough ipv4 -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

Also problem was in too early running of service. After that was running firewalld and flush all rules.

Now, with permanent one-run command above all work perfectly!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.