LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-26-2016, 12:31 AM   #1
Thiefy
LQ Newbie
 
Registered: Jul 2016
Posts: 24

Rep: Reputation: Disabled
Unhappy I'm lost , eth0 , iptables.


Hi Everyone ,

So when i do the command iptables -L -n -v | grep eth0 , i get one ipaddress , but the bad part is i can't find where it is described (the eth0) and what ip address it has , i can't seem to find it anywhere in my server. Tried it to look up in /etc/network/interfaces but its not there even though there is wifi , wlan , wan ect. Any ideas how to find it where it is?

Thanks in advance, Thiefy.

Last edited by Thiefy; 07-26-2016 at 12:59 AM.
 
Old 07-26-2016, 01:02 AM   #2
netguy2000
Member
 
Registered: Oct 2003
Location: Karachi, PAKISTAN
Distribution: Redhat, Fedora, Open BSD, FreeBSD, SlackWare
Posts: 115

Rep: Reputation: 15
what I understand you try to find your eth0 interface IP? if correct then use ifconfig command.
if not then kindly share your distro name and version, and try to specific your question.
waiting.
 
Old 07-26-2016, 01:09 AM   #3
Thiefy
LQ Newbie
 
Registered: Jul 2016
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by netguy2000 View Post
what I understand you try to find your eth0 interface IP? if correct then use ifconfig command.
if not then kindly share your distro name and version, and try to specific your question.
waiting.
Ifconfig command still dosen't show the eth0 , yes i want to find where the eth0 is hidden and what the ip address it has. if i type ifconfig i only see bond0 , bond0:0 , int0 , int1 ,lo , wan , wifi. Theres no eth0 :/

lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 6.0.10 (squeeze)
Release: 6.0.10
Codename: squeeze

Last edited by Thiefy; 07-26-2016 at 01:12 AM.
 
Old 07-26-2016, 08:15 AM   #4
gda
Member
 
Registered: Oct 2015
Posts: 130

Rep: Reputation: 27
Actually ifconfig shows only the interfaces that are set as up.

Try to run ifconfig -a to display all the interfaces available (even if down). If eth0 shows up in this case it means that eth0 is not configured properly and you need to do it (giving it an IP address, netmask, gateway...). Only after that (hopefully!) it will shows up with a corresponding IP address...

Moreover I see you have bond0 interface which may contain eth0 as slave interface. In that case bond0 is the interface you should consider not eth0. To see which interface are bounded under bond0 just type something like:

Code:
cat /proc/net/bonding/bond0

Last edited by gda; 07-26-2016 at 08:25 AM.
 
Old 07-26-2016, 09:30 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
Not all distros use the eth0, wlan0, etc. nomenclature. A number of major distros use this: https://www.freedesktop.org/wiki/Sof...nterfaceNames/

I think it's a SystemD thing.

If you are seeing interfaces with names like en0, follow that link.

iptables is the firewall capability built into the Linux kernel. Linux "firewall" programs are normally frontends for iptables. The one I would recommend for a GUI frontend is gufw.

Last edited by frankbell; 07-26-2016 at 09:33 PM.
 
Old 07-27-2016, 12:23 AM   #6
Thiefy
LQ Newbie
 
Registered: Jul 2016
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gda View Post
Actually ifconfig shows only the interfaces that are set as up.

Try to run ifconfig -a to display all the interfaces available (even if down). If eth0 shows up in this case it means that eth0 is not configured properly and you need to do it (giving it an IP address, netmask, gateway...). Only after that (hopefully!) it will shows up with a corresponding IP address...

Moreover I see you have bond0 interface which may contain eth0 as slave interface. In that case bond0 is the interface you should consider not eth0. To see which interface are bounded under bond0 just type something like:

Code:
cat /proc/net/bonding/bond0

ifconfig -a if i do this it dosen't show the eth0 and if i go cat /proc/net/bonding/bond0 the slave interfaces are int0 and int1 , still no eth0.
if i do:
Code:
iptables -L -v -n | grep eth0
    0     0 ACCEPT     tcp  --  eth0   *       0.0.0.0/0            0.0.0.0/0           tcp dpt:3389
and then,

 iptables -L -v -n | grep :3389
    0     0 ACCEPT     tcp  --  *      *       xx.xxx.xx.xxx        0.0.0.0/0           tcp dpt:3389
    0     0 ACCEPT     tcp  --  eth0   *       0.0.0.0/0            0.0.0.0/0           tcp dpt:3389
the first line is in INPUT section of iptables and the second line is in the FORWARD section of the iptables. I need to find where the eth0 is to know where the firewall sends the user who logins from that port.
 
Old 07-27-2016, 03:25 AM   #7
gda
Member
 
Registered: Oct 2015
Posts: 130

Rep: Reputation: 27
I suppose this probably means that as mentioned by frankbell in your case the interfaces are called int0, int1,.. instead of eth0, eth1,...

Anyway how many physical interfaces are connected to your machine?

Moreover if bond0 has been set up using as slave int0 and int1 usually the iptable rules should be done on the interface bond0 and not on the separately on each slave interface...

It could be simply that the iptable rules involving eth0 have been set up wrongly...

Finally is the bond0 interface configured and working properly? Why exactly you are trying to find an interface called eth0 on your system?
 
1 members found this post helpful.
Old 07-27-2016, 03:44 AM   #8
Thiefy
LQ Newbie
 
Registered: Jul 2016
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gda View Post
I suppose this probably means that as mentioned by frankbell in your case the interfaces are called int0, int1,.. instead of eth0, eth1,...

Anyway how many physical interfaces are connected to your machine?

Moreover if bond0 has been set up using as slave int0 and int1 usually the iptable rules should be done on the interface bond0 and not on the separately on each slave interface...

It could be simply that the iptable rules involving eth0 have been set up wrongly...

Finally is the bond0 interface configured and working properly? Why exactly you are trying to find an interface called eth0 on your system?
There are alot like really alot it's a schools serve. I need it for my work i need to learn which port leads where so i can then tell other administrator so he can set up a mikrotik . Like in iptabbles i know every each where it leads etc. but his specific one i can't find what the ip address eth0 has , and the bad part is it's not me who setted up the firewall it's few other administrators and we took the job from them.
 
Old 07-27-2016, 04:13 AM   #9
gda
Member
 
Registered: Oct 2015
Posts: 130

Rep: Reputation: 27
I'm not sure I understood clearly your set-up and what you would like to achieve.

Could you please post the output of the command ifconfig -a?

Moreover could you also describe which firewall rules you would like to have implemented in iptables (for example which ports need to be open on which interface)?

In doing that be sure to not show information you don't want to show like IPs...
 
Old 07-27-2016, 05:42 AM   #10
Thiefy
LQ Newbie
 
Registered: Jul 2016
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gda View Post
I'm not sure I understood clearly your set-up and what you would like to achieve.

Could you please post the output of the command ifconfig -a?

Moreover could you also describe which firewall rules you would like to have implemented in iptables (for example which ports need to be open on which interface)?

In doing that be sure to not show information you don't want to show like IPs...
i don't really want to change anything in firewall i just want to understand why there is an eth0 even though it's nowhere to be seen to be described, i just want to understand where the eth0 sends the user who logs in through the port 3389 to what ip address he is sent.

Code:
bond0     Link encap:Ethernet  HWaddr xxx.xx.x.xxx
          inet addr:xxx.xx.x.xxx  Bcast:xxx.xx.x.xxx Mask:xxx.xx.x.xxx
          inet6 addr: fexxx.xx.x.xxx Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:50757724 errors:0 dropped:20 overruns:0 frame:0
          TX packets:81644300 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:7207176381 (6.7 GiB)  TX bytes:81851474699 (76.2 GiB)

bond0:0   Link encap:Ethernet  HWaddr xxx.xx.x.xxx
          inet addr:xxx.xx.x.xxx  Bcast:xxx.xx.x.xxx  Mask:xxx.xx.x.xxx
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1

int0      Link encap:Ethernet  HWaddr xxx.xx.x.xxx
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:25740422 errors:0 dropped:2 overruns:0 frame:0
          TX packets:15054436 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3165553660 (2.9 GiB)  TX bytes:3690975394 (3.4 GiB)
          Memory:feae0000-feb00000

int1      Link encap:Ethernet  HWaddr xxx.xx.x.xxx
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:25017302 errors:0 dropped:6 overruns:0 frame:0
          TX packets:66589864 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4041622721 (3.7 GiB)  TX bytes:78160499305 (72.7 GiB)
          Memory:fea60000-fea80000

lo        Link encap:Local Loopback
          inet addr:xxx.xx.x.xxx Mask:xxx.xx.x.xxx
          inet6 addr:xxx.xx.x.xxx Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:198673171 errors:0 dropped:0 overruns:0 frame:0
          TX packets:198673171 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:13812311248 (12.8 GiB)  TX bytes:13812311248 (12.8 GiB)

wan       Link encap:Ethernet  HWaddr xxx.xx.x.xxx
          inet addr:xxx.xx.x.xxx  Bcast:xxx.xx.x.xxx  Mask:xxx.xx.x.xxx
          inet6 addr: fexxx.xx.x.xxx Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:73931061 errors:0 dropped:0 overruns:0 frame:0
          TX packets:65194541 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:80237491798 (74.7 GiB)  TX bytes:40264496501 (37.4 GiB)
          Memory:feb60000-feb80000

wan:0     Link encap:Ethernet  HWaddr xxx.xx.x.xxx
          inet addr:xxx.xx.x.xxx  Bcast:xxx.xx.x.xxx  Mask:xxx.xx.x.xxx
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Memory:feb60000-feb80000

wifi      Link encap:Ethernet  HWaddr xxx.xx.x.xxx
          inet addr:xxx.xx.x.xxx  Bcast:xxx.xx.x.xxx  Mask:xxx.xx.x.xxx
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Memory:febe0000-fec00000

Last edited by Thiefy; 07-27-2016 at 05:46 AM.
 
Old 07-27-2016, 07:52 AM   #11
gda
Member
 
Registered: Oct 2015
Posts: 130

Rep: Reputation: 27
OK. It seems you have two (one real + one virtual) non-wireless interfaces active: bond0, bond0:0 (at least both of them show an IP). The interface named "eth0" does not appear there so it means that actually you don't have any nic with that name on your system. As already mentioned the fact that iptable has defined some rules involving the interface "eth0" does NOT assure an interface named "eth0" is actually installed on your system. I guess in your case all the iptable rules involving "eth0" are wrong (or maybe they refer to a previous configuration of the same server when "eth0" was present) and should be removed.

The relevant non-wireless firewall rules should be listed by the command:
Code:
iptables -L -v -n | grep bond0

Last edited by gda; 07-27-2016 at 08:10 AM. Reason: typo
 
1 members found this post helpful.
Old 07-27-2016, 08:23 AM   #12
Thiefy
LQ Newbie
 
Registered: Jul 2016
Posts: 24

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gda View Post
OK. It seems you have two (one real + one virtual) non-wireless interfaces active: bond0, bond0:0 (at least both of them show an IP). The interface named "eth0" does not appear there so it means that actually you don't have any nic with that name on your system. As already mentioned the fact that iptable has defined some rules involving the interface "eth0" does NOT assure an interface named "eth0" is actually installed on your system. I guess in your case all the iptable rules involving "eth0" are wrong (or maybe they refer to a previous configuration of the same server when "eth0" was present) and should be removed.

The relevant non-wireless firewall rules should be listed by the command:
Code:
iptables -L -v -n | grep bond0
Wow mate , thanks i seem to understand a bit what are you saying ant it makes sense because there were like few system administrators before me and it's make senses that can be the situation here with eth0 . Thanks alot!!
 
Old 07-27-2016, 03:58 PM   #13
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
Knowing the distro and version would help but I think that frankbell is correct that the naming scheme is the newer BSD style made to be more verbose in the identification of devices.
 
1 members found this post helpful.
  


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
Lost communication with Internet from eth0 Sanford Stein Linux - Networking 4 10-08-2013 12:17 PM
Lost connection, cannot activate eth0 ufmale Linux - Newbie 2 06-18-2010 01:30 AM
Was found but now lost? eth0 kj6loh Fedora 2 08-12-2004 06:26 AM
Lost eth0 FXRS Fedora 5 12-06-2003 12:01 PM
eth0 got lost again! Stingreen Linux - General 6 12-09-2001 10:30 AM

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

All times are GMT -5. The time now is 11:24 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