LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-14-2018, 05:29 AM   #1
richard-g8jvm2
LQ Newbie
 
Registered: Aug 2018
Posts: 8

Rep: Reputation: Disabled
iptables neither systemctl or service starts it


Hi
sorry this is silly ,but
Ubuntu16.04.5 fresh install on a odroid c1
this was working and has stopped.
the rules are
Code:
# Generated by iptables-save v1.6.1 on Wed Sep 12 18:42:10 2018
*nat
:PREROUTING ACCEPT [18:4517]
:INPUT ACCEPT [18:4517]
:OUTPUT ACCEPT [52:3494]
-A PREROUTING -p tcp -m tcp --dport 8083 -j DNAT --to-destination 192.168.1.70:8083
-A PREROUTING -p tcp -m tcp --dport 8081 -j DNAT --to-destination 192.168.1.71:7776
-A PREROUTING -p tcp -m tcp --dport 8085 -j DNAT --to-destination 192.168.1.72:7777
#-A POSTROUTING -p tcp --sport 8083 -j MASQUERADE
-A POSTROUTING -d 192.168.1.70 -p tcp --dport 8083 -j MASQUERADE
#-A POSTROUTING -d 192.168.1.71 -p tcp --dport 7776 -j MASQUERADE
#-A POSTROUTING -d 192.168.1.72 -p tcp --dport 7777 -j MASQUERADE
:POSTROUTING ACCEPT [0:0]
COMMIT
iptables -t nat -vL verifies this

ps ax|grep iptables shows no process running

Code:
root@odroid:/# systemctl enable iptables
Failed to execute operation: No such file or directory
root@odroid:/# systemctl start iptables
Failed to start iptables.service: Unit iptables.service not found.
root@odroid:/# service iptables start
Failed to start iptables.service: Unit iptables.service not found.
root@odroid:/# service iptables enable
iptables: unrecognized service
iptables and iptables-persistent are installed
this is something stupid, but I cant find the solution
ideas ????
 
Old 09-14-2018, 08:12 AM   #2
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora
Posts: 1,868

Rep: Reputation: 395Reputation: 395Reputation: 395Reputation: 395
My idea is that there is nothing wrong. What process do you expect to run? iptables is a command to manage netfilter rules in the kernel, not a background process.

Is anything not working on your Odroid?
 
Old 09-14-2018, 09:24 AM   #3
richard-g8jvm2
LQ Newbie
 
Registered: Aug 2018
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks.
The only thing the odroid should be doing is forwarding
I went to flash the sd card and noticed it was slow,so I went and got a new sandisk ultra 16G card
flashed Ubuntu 18.04 on it, did a apt update and upgrade
SFTP'd a copy of the iptables rules to it, and then did a iptables-restore < /etc/iptables.rules

Code:
root@odroid:~# iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination         
DNAT       tcp  --  anywhere             anywhere             tcp dpt:8083 to:192.168.1.70:8083
DNAT       tcp  --  anywhere             anywhere             tcp dpt:tproxy to:192.168.1.71:7776
DNAT       tcp  --  anywhere             anywhere             tcp dpt:8085 to:192.168.1.72:7777

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         
MASQUERADE  tcp  --  anywhere             odroid.lan           tcp dpt:8083
so thats all there is on the odroid

from a browser on another machine http://192.168.1.80:8083
and nothing , not getting forwarded
from the same browser 192.168.1.70:8083 and straight to the port
I wondered if it was because the source port and desination port are the same, but the same happens on ports 8081 and 8085
which redirect to 7776 and 7777 ( ip cameras )
8083 is masqueraded because that machine has a VPN running so the reply gets sent to New York.

It was working, or did it work by accident with a rule I wasn't aware of ???
I'm begining to suspect the latter as three virgin images all do the same .
very difficult to spot your own mistakes, especially when I make so many
TIA
 
Old 09-14-2018, 10:09 AM   #4
richard-g8jvm2
LQ Newbie
 
Registered: Aug 2018
Posts: 8

Original Poster
Rep: Reputation: Disabled
Hi
I feel like a total idiot, ip forwarding had been disabled
but , even after editing /ect/sysctl.conf and setting to 1
its still booting up with them disabled, until switched on.... very strange
 
Old 09-14-2018, 04:24 PM   #5
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora
Posts: 1,868

Rep: Reputation: 395Reputation: 395Reputation: 395Reputation: 395
Quote:
Originally Posted by richard-g8jvm2 View Post
its still booting up with them disabled, until switched on.... very strange
What is disabled? What do you switch on to enable it?
 
Old 09-14-2018, 05:00 PM   #6
richard-g8jvm2
LQ Newbie
 
Registered: Aug 2018
Posts: 8

Original Poster
Rep: Reputation: Disabled
still my fault :?(

it was ip-forwarding disabled , by my bad editing, all sorted now
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
systemctl start myapp.service Richi Red Hat 3 02-02-2018 03:36 AM
Problem with MySQL install on virt CentOS,no /var/lib/mysql/mysql.sock , systemctl start mysqld.service dont run the service Positive1 CentOS 1 08-13-2016 03:33 AM
Job for vncserver@:1.service failed. See 'systemctl status vncserver@:1.service' and anis123 Linux - Server 0 09-16-2015 08:44 AM
[SOLVED] What is the purpose of systemctl start named.service? Echopurrs Linux - Newbie 1 07-07-2014 12:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:36 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration