How To Find Out What Subnet My Eth Belongs To

Hi all

I got this interesting problem:

I have a server that has two ethernet connections, cabled up to the switch.

The server has a clonezilla liveboot cd in it which I am currently booting from. The clonezilla is a debian OS.

So from the cmd line I can see I have two eth interfaces that is connected, eth0 and 2.

Now I need to configure one of these two interfaces to do let clonezilla do its job.

The problem is that each of these two interfaces are going to different subnets. I got the two subnets, which we will just call them A and B. And I can't recall whether A belongs on eth0 or B belongs there.

Now I know there is a simple solution to this: config one and try it out. I could do that, in fact I will do that just to save time. But I was wondering, cause when I did ifconfig I can see from the packet counters that these two interfaces are live, if there is some other way to monitor these two interfaces, and by looking at the packets that is being sent to these interfaces, I can determine which interface goes with which subnet?

Or phrased another way: you just installed a new computer, and have plugged in the internet cable, but you forgot to put an IP address on it and really don't want to wait for your IT guy to come in on monday to tell you what your IP is and dhcp is not an option. What do you do?

Thanks
Feel free to ask questions if anything is not clear.


Similar Content



Access A Host From A Different Subnet In Linux

Hi all,

I have a host#1 with ip=192.168.3.100 and a host#2 with ip=192.168.2.100. Both hosts are connected to some linux device with 2 interfaces : eth0 with ip=192.168.2.1 and eth1 with ip=192.168.3.1.

So host#1 is connected to eth1 and host#2 to eth0. I would like to ping host#2 from host#1 and vice versa. How can I do that ?

I tried :
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

but it didn't work

PS
This is my first post here, so please don't be very strict to me
Looking forward to hearing from anybody as I'm out of ideas...

BR,
Dmitry

Direct Connection Via Ethernet

Hi I am not a complete Linux newbie, but I have a challenge that is new to me.

I am wanting to be able to connect to a linux box (Raspberry Pi running Debian) via ssh directly from a single computer. I want to be able to plug in a ethernet cable from a laptop to the Raspberry Pi so that I can configure it via ssh or a webpage.

I have had a few pieces of hardware, routers, printers etc that allow this sort of connection for configuration, I just would like to know how it is done.

My question is how do I set up the /etc/interfaces file to allow the Raspberry Pi to be found by the laptop.

Once configured I would want the Raspberry Pi to obtain its IP address via DHCP when connected to a network.

Any suggestions, ideas would be appreciated.

Linux Not Accepting Udp And Tcp Ethernet Packets

I am trying to build a socket to retrieve the ethernet packets from ecu. When i run my code on windows there is no problem and the code runs correctly. But when i run my code on Linux it gets stuck at s.recv(65565). I have already set static ip in /etc/network/interfaces as follows: iface eth0 inet static address 160.48.199.91 netmask 255.255.255.0 gateway 160.48.199.254

I tried a simple code of socket on raspberry pi. but it still gets stuck at s.recv(65565). I also tried to implement the program using multicast. but the problem is that when i create a socket for icmp protocols then I could see the data from the ECU after using command "ping -I echo 239.192.255.251" in another terminal. (where 239.192.255.251 is the multicast address) But when I change the socket protocol type to udp, tcp or raw then it again gets stuck at s.recv().

Imp: When i run the "netstat -s" command in terminal then i could see that there are 0 messages received for udp and tcp. But in Wireshark i could see the udp messages from ECU. Is linux killing all the udp and tcp packets ? How should i solve this ?
(complete setup is connected as: ECU ---> Media converter ---> Raspberry Pi. There is no LAN, no firewall, no internet)

Could anyone please help me with this problem ?

Kali Linux Didn't Recognize Wireless Networks

Hi,
i'm new in kali linux.
i have an issue with the wifi connections.
installing the newwst version of kali from the official website on virtual box.
plug the USB wireless adapter (TP-LINK).
also, i noticed wlan0 on #ifconfig command.
on the network setting configure NAT (also tried with NAT bridged)

my problem is that - i cannot see any wireless networks.
i followed few guides from youtube and here but with no luck.
it show me that i'm wired connected.
i attached screenshot bellow.
please kindly assist me.


additional information:
#airmon-ng start wlan0
when i type #ifconfig, i saw that wlan0 changed to wlan0mon
and with#airodump-ng command on wlan0mon i didn't see any wireless network as well


iwconfig
Quote:
root@kali:~# iwconfig
eth0 no wireless extensions.

wlan0 IEEE 802.11bgn ESSIDff/any
Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm
Retry short limit:7 RTS thrff Fragment thrff
Encryption keyff
Power Managementff

lo no wireless extensions.
lsmod
Quote:
root@kali:~# lsmod | grep rt
rt2800usb 26222 0
rt2x00usb 17642 1 rt2800usb
rt2800lib 81543 1 rt2800usb
rt2x00lib 46315 3 rt2x00usb,rt2800lib,rt2800usb
mac80211 511777 3 rt2x00lib,rt2x00usb,rt2800lib
cfg80211 425751 2 mac80211,rt2x00lib
crc_ccitt 12347 1 rt2800lib
parport_pc 26287 0
parport 35699 1 parport_pc
usbcore 199549 7 rt2x00usb,ohci_hcd,ohci_pci,rt2800usb,ehci_hcd,ehci_pci,usbhid
lsusb
Quote:
root@kali:~# lsusb
Bus 001 Device 003: ID 148f:3070 Ralink Technology, Corp. RT2870/RT3070 Wireless Adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 003: ID 80ee:0021 VirtualBox USB Tablet
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
ifconfig

Quote:
root@kali:~# ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:dc:d0:01
inet addr:192.168.1.22 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fedc:d001/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:68 errors:0 dropped:0 overruns:0 frame:0
TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7485 (7.3 KiB) TX bytes:4163 (4.0 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:20 errors:0 dropped:0 overruns:0 frame:0
TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1200 (1.1 KiB) TX bytes:1200 (1.1 KiB)

wlan0 Link encap:Ethernet HWaddr 90:f6:52:10:0f:d2
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)
iw wlan0 info
Quote:
root@kali:~# iw wlan0 info
Interface wlan0
ifindex 4
type managed
wiphy 1
iwlist scan
Quote:
root@kali:~# iwlist scan
eth0 Interface doesn't support scanning.

wlan0 No scan results

lo Interface doesn't support scanning.
uname -a
Quote:
root@kali:~# uname -a
Linux kali 3.18.0-kali3-amd64 #1 SMP Debian 3.18.6-1~kali2 (2015-03-02) x86_64 GNU/Linux
cat /etc/network/interfaces
Quote:
root@kali:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
thanks

Static Ip - Ech0 Won't Start At Boot

I am trying to set up Samba4 using the Sernet appliance. It is a Debian core.

I edited /etc/network/interfaces to set a static address for eth0. I used http://www.cyberciti.biz/faq/linux-c...ress-tutorial/ as a guide.

Now eth0 will not start on boot. Why?

Thanks!

Bad Subnet/netmask , DHCP Installation

Hi,

I'm on WMware workstation with debian Wheezy.
I have a problem when a restart the Dchp.
It said Bad subnet number/mask combination.

This is logs:

root@debian-main:/# /etc/init.d/isc-dhcp-server restart
dhcpd self-test failed. Please fix /etc/dhcp/dhcpd.conf.
The error was:
Internet Systems Consortium DHCP Server 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Config file: /etc/dhcp/dhcpd.conf
Database file: /var/lib/dhcp/dhcpd.leases
PID file: /var/run/dhcpd.pid
/etc/dhcp/dhcpd.conf line 50: subnet 192.168.10.1 netmask 255.255.255.0: bad subnet number/mask combination.
subnet 192.168.10.1 netmask 255.255.255.0{
^
Configuration file errors encountered -- exiting

If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug. These pages explain the proper
process and the information we find helpful for debugging..

exiting.

And this my file dhcpd.conf:

# A slightly different configuration for an internal subnet.
subnet 192.168.10.1 netmask 255.255.255.0{
range 192.168.10.1 192.168.10.15;
# option domain-name-servers ns1.internal.example.org;
# option domain-name "internal.example.org";
option routers 192.168.10.254;
option broadcast-address 192.168.10.255;
default-lease-time 600;
max-lease-time 7200;
}

For me it's the good subnet number/mask combination.

Can you help me please?

Thanks you,

Pierrick

Dhcpd On Opensuse 12.1 Does Not Hand Out Addresses

Hi all

I am trying out this dhcp server setup on opensuse 12.1 but it does not seem to be working.

I have eth0 configured to be 192.168.10.1 in a /24 network.

I want to hand out the rest of the address in the same subnet as dhcp addresses. (So everything from 10.2 to 10.255). The default gw is defined as 192.168.10.1, and routing table looks correct. and I only have eth0.


When I start the dhcp, and connect it to the client machine, I see nothing on the wireshark trace. no DHCP discovery or ack messages. And the client machine just keeps trying boot from the network via the network interface. I know I got the right interface (there were blinky options in the bios that lets you identify the correct interface) and the cable is not a problem. (If the cable were a problem the client boot message would say "media fault ... please check media...") instead.

Here is my dhcpd.conf file. I went through man dhcpd already, and cleaned out everything that I apparently don't need. (The original file was copied from a more complicated setup that had multiple subnets and dhcp relays.)

Code:
###################simplfied 
linux-kzy1:/var/lib/dhcp/db # cat /etc/dhcpd.conf
authoritative;

ddns-update-style none;
ddns-updates off;

#Information about the host
subnet 192.168.10.0 netmask 255.255.255.0 {
  max-lease-time 600;
  default-lease-time 600;
  range 192.168.10.2 192.168.10.255;
}

group esx_gep{
  filename "pxelinux.0";
  next-server 192.168.10.1; 
  host testserver1 {hardware ethernet a0:d3:c1:f7:f2:64;}
}

this is what /var/log/message and /var/log/rc.dhcpd.log says:
Code:
**************var log message
Mar 19 18:42:17 linux-kzy1 dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Mar 19 18:42:17 linux-kzy1 dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 group decls to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 deleted host decls to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 new dynamic host decls to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 leases to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Listening on LPF/eth0/84:8f:69:cf:7c:41/192.168.10.0/24
Mar 19 18:42:17 linux-kzy1 dhcpd: Sending on   LPF/eth0/84:8f:69:cf:7c:41/192.168.10.0/24
Mar 19 18:42:17 linux-kzy1 dhcpd: Sending on   Socket/fallback/fallback-net
Mar 19 18:42:17 linux-kzy1 dhcpd[12233]: Starting ISC DHCPv4 4.x Server [chroot]..done
linux-kzy1:/home/test/Documents #


*****************var log rc.dhcpd.log
Mar 19 18:42:17 linux-kzy1 dhcpd: Internet Systems Consortium DHCP Server 4.2.2
Mar 19 18:42:17 linux-kzy1 dhcpd: Copyright 2004-2011 Internet Systems Consortium.
Mar 19 18:42:17 linux-kzy1 dhcpd: All rights reserved.
Mar 19 18:42:17 linux-kzy1 dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Mar 19 18:42:17 linux-kzy1 dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 group decls to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 deleted host decls to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 new dynamic host decls to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Wrote 0 leases to leases file.
Mar 19 18:42:17 linux-kzy1 dhcpd: Listening on LPF/eth0/84:8f:69:cf:7c:41/192.168.10.0/24
Mar 19 18:42:17 linux-kzy1 dhcpd: Sending on   LPF/eth0/84:8f:69:cf:7c:41/192.168.10.0/24
Mar 19 18:42:17 linux-kzy1 dhcpd: Sending on   Socket/fallback/fallback-net
Mar 19 18:42:17 linux-kzy1 dhcpd[12233]: Starting ISC DHCPv4 4.x Server [chroot]..done
linux-kzy1:/home/test/Documents #

not very interesting stuff or useful, but I found some other messages that is very interesting:

Code:
**********
#no free lease

linux-kzy1:/home/test/Documents # cat /var/log/messages | grep "free lease"
Mar 19 15:53:59 linux-kzy1 dhcpd: DHCPDISCOVER from a0:d3:c1:f7:f2:64 via eth0: network 192.168.10.0/24: no free leases
Mar 19 15:54:03 linux-kzy1 dhcpd: DHCPDISCOVER from a0:d3:c1:f7:f2:64 via eth0: network 192.168.10.0/24: no free leases
Mar 19 15:54:11 linux-kzy1 dhcpd: DHCPDISCOVER from a0:d3:c1:f7:f2:64 via eth0: network 192.168.10.0/24: no free leases
......
Mar 19 17:01:06 linux-kzy1 dhcpd: DHCPDISCOVER from a0:d3:c1:f7:f2:64 via eth0: network 192.168.10.0/24: no free leases
Mar 19 17:01:38 linux-kzy1 dhcpd: DHCPDISCOVER from a0:d3:c1:f7:f2:64 via eth0: network 192.168.10.0/24: no free leases
linux-kzy1:/home/test/Documents #

Which ties into my first question: dhcp no free lease: I googled a bit, I found a post from a guy on ubuntu who has the same error message and the suggested course of action is to change ownership of the lease file to dhcpd and give it 777 for permission. Which I thought is weird, because the lease file is automatically created by the dhcpd itself, so it really shouldn't be a permission issue shouldn't it? (Anyway, tried that didn't do a thing.) right now it is owned by root/root and has this permission: -rw-r--r--.

2nd question: once the client gets a reply from my dhcp server saying no free lease, does it remember this dhcp server as no free lease and does it persist throughout reboots? Because I tried rebooting the client a number of times and I don't see anything on the wireshark at all. You will notice the time stamp on the last "no free lease" message is not as late as the other messages from the var/log/messages or rc.dhcpd.log and I rebooted the client and the dhcp plenty of times since 17:01:38.



Thanks for all your help in advance everyone.

Failed To Bring Up Eth1 - Debian Wheezy

Hi,

I tried to configure my ethernet interface on a Debian Wheezy VM, but I've a problem. When I try to restart /etc/init.d/networking, I've no error message.
But my eth1 interface isn't up and when I try to up it with : ifup eth1, it return me :

Code:
root@debian-main:/# ifup eth1
RTNETLINK answers: File exists
Failed to bring up eth1

My /etc/network/interface file is :

Code:
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp


iface eth1 inet static
        address 192.168.10.1
        netmask 255.255.255.0
        gateway 192.168.10.254

Eth0 is my internet interface and eth1 is a local interface. I want to install a DNS and a DHCP server on eth1 to be able to connect client with this VM and give them an ip adress.

Thanks guys

Upgrade From Squeeze To Wheezy Network Issue

I recently decided to upgrade from Debian Squeeze to Wheezy. Update seemed to go fine with the exception of the following warning concerning my Broadcom bmc5704 gigabit ethernet cards

Quote:
W: Possible missing firmware /lib/firmware/tigon/tg3_tso5.bin for module tg3
W: Possible missing firmware /lib/firmware/tigon/tg3_tso.bin for module tg3
W: Possible missing firmware /lib/firmware/tigon/tg3.bin for module tg3
No problem I will simply install the missing .bin files after the upgrade. Get the .bin files from the Debian repository and install them using the command "dpkg -i file_name.deb" then ran "apt-get install -f" for good measure. Still nothing, I have downloaded the following files and running that same command for each hoping that this would solve my compatibility issue with no such luck.

Quote:
firmware-bnx2_0.36+wheezy.1_all.deb
firmware-bnx2x_0.36+wheezy.1_all.deb
firmware-linux-nonfree_0.36+wheezy.1_all.deb
firmware-linux-nonfree_0.36+wheezy.1~bpo60+1_all.deb
When I attempt to go into System Preferences > Network I get the message "The system network services are not compatible with this version."

I showed the hardware using the lshw command and here is the entry concerning the ethernet interface

Quote:
#output from lshw command

*-network:0
description: Ethernet interface
product: NetXtreme BCM5704 Gigabit Ethernet
vendor: Broadcom Corporation
physical id: 2
bus info: pci@0000:02:02.0
logical name: eth0
version: 10
serial: 00:13:21:b2:cf:46
size: 100Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 66MHz
capabilities: pcix pm vpd msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=tg3 driverversion=3.116 duplex=full firmware=5704-v3.41, ASFIPMIc v2.36 ip=XX.XX.XX.154 latency=64 link=no mingnt=64 multicast=yes port=twisted pair speed=100Mbit/s
resources: irq:25 memory:fdf70000-fdf7ffff
Network file configuration.

Quote:
# Network file

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address XX.XX.XX.XX
netmask 255.255.255.0
network XX.XX.XX.0
broadcast XX.XX.XX.255
gateway XX.XX.XX.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers XX.XX.XX.XX 8.8.8.8
dns-search XXXXXXX.net
Server is an older HP ProLiant and I am attempting to put Wheezy on it from a direct upgrade from squeeze.

At this point I am stumped. Not sure exactly what to do but it seems like a fairly simple fix. If anyone has any suggestions I would sure appreciate the help. Let me know if you need anything.

Clonezilla

I am interested in developing a Clonezilla server. Can anyone push me in the right direction for beginners for me. I am a little familiar with Mint and Ubuntu, however, I would like to create a stable server where I can restore multiple types of images within a VM environment.