Hot answers tagged

32

Setting up a dummy interface If you want to create network interfaces, but lack a physical NIC to back it, you can use the dummy link type. You can read more about them here: iproute2 Wikipedia page. Creating eth10 To make this interface you'd first need to make sure that you have the dummy kernel module loaded. You can do this like so: $ sudo lsmod | ...


13

This is one of those things that surprises people because it goes against what they've been taught. 2 machines with the same hardware mac address on the same broadcast domain can talk to each other just fine as long as they have different IP addresses (and the switching gear plays nice). Lets start with a test setup: VM1 $ ip addr show dev enp0s8 3: ...


12

The articles you found are somewhat outdated. There is now an easy method to assign names to network interfaces, through Udev. On Debian and derivatives (including Ubuntu), look out for a file called /etc/udev/rules.d/70-persistent-net.rules. This file is created by /lib/udev/rules.d/75-persistent-net-generator.rules with the help of the script ...


11

Yes. By putting network interfaces into promiscuous mode, tcpdump is able to see exactly what is going out (and in) the network interface. tcpdump operates at layer2 +. it can be used to look at Ethernet, FDDI, PPP & SLIP, Token Ring, and any other protocol supported by libpcap, which does all of tcpdump's heavy lifting. Have a look at the ...


11

ifconfig will output information about your interfaces, including the MAC address: $ ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:11:22:33:44:55 inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.0.0.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:289748093 errors:0 dropped:0 overruns:0 frame:0 ...


11

Those are network interfaces, not IP addresses. A network interface can have packets from any protocol exchanged on them, including IPv4 or IPv6, in which case they can be given one or more IP addresses. virbr are bridge interfaces. They are virtual in that there's no network interface card associated to them. Their role is to act like a real bridge or ...


10

It's not clear exactly what you want. If you want to use your existing Ethernet port, that won't be an option for many reasons; the most fundamental being that Ethernet requires precise termination and voltage levels, the hardware on the interface (the PHY) is made to deal with that. Ethernet uses strictly +/- 0.85V and 50ohm termination impedance; RS-232 ...


10

That's a change in how now udevd assigns names to ethernet devices. Now your devices use the "Predictable Interface Names", which are based on (and quoting the sources): Names incorporating Firmware/BIOS provided index numbers for on-board devices (example: eno1) Names incorporating Firmware/BIOS provided PCI Express hotplug slot index numbers ...


10

There is a Linux-feature which makes your machine reply for every IP address assigned, on every interface, when they share the same IP subnet, regardless of the particular IP-interface assignments. This may or may not be desirable for you. This feature is switched on by default, and you can configure it through sysctl. For the output traffic, your machine ...


9

The 2 methods I've seen used predominately are to use ethtool or to manually parse the contents of /sys. ethtool For example if your interface is eth0 you can query it using ethtool and then parse for the line, "Link detected". Example $ sudo ethtool eth0 Settings for eth0: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full ...


9

Do NOT use mii-tool. It was last updated years ago and does not support anything over fast ethernet. There are few ways you can determine ethernet speed. The most recommended one is cat /sys/class/net/<interface>/speed The output will be 10, 100, 1000, ...etc. In fact you can get almost all data you need about your network card from ...


9

cat /sys/class/net/eth0/carrier is by far the easiest method.


8

How about ifplugd? ifplugd is a Linux daemon which will automatically configure your ethernet device when a cable is plugged in and automatically unconfigure it if the cable is pulled. This is useful on laptops with onboard network adapters, since it will only configure the interface when a cable is really connected. (There is also netplugd, but it was ...


8

It's pretty easy. You need to connect PC to notebook. Configure eth0 on PC (set for example ip = 192.168.2.3 and default gateway 192.168.2.2 and dns server to 8.8.8.8). That's all you need to do on PC. On notebook you need to set up the internet connection as usual and configure eth0 with the following way: set ip address to 192.168.2.2, enable net ...


8

Yes, you can do this, and it's not even that hard. I have a laptop with a wireless card, and an ethernet port. I plugged a RapberryPi running Arch Linux into it, via a "crossover" ethernet cable. That's one special thing you might need - not all ethernet cards can do a machine-to-machine direct connection. The other tricky part is IP addressing. It's best ...


7

Check udev config files. A file like this: /etc/udev/rules.d/70-persistent-net.rules ties the NAME (ethX) to the Mac address. You probably have the old cards MAC tied to eth0. Remove its line and change the new card to eth0.


7

you want tcpdump not nc, and the syntax would be tcpdump -i eth0 netcat is only for basic TCP/IP testing. tcpdump utilizes the libpcap library which allows for lowlevel interactions with packets and the likes


7

Each network adapter on linux has a sysctl boolean parameter accept_local (/proc/sys/net/ipv4/conf/eth0/accept_local). Try setting it to 0 for all adapters involved (additionally, you may need to modify your routing table to suit your test setup). Also, make sure that rp_filter (/proc/sys/net/ipv4/conf/eth0/rp_filter) is enabled (not 0). Reference: ...


6

Please do not get discouraged by the overwhelming amount of information in setting up of samba. It's pretty simple as discussed here. If you do not believe, these are the steps I did in my machine and it took me just couple of minutes to access the mount point of my RHEL machine on the Windows machine. I assume the RHEL and Windows machine are available in ...


6

Some ideas, assuming interfaces are eth0 and eth1: Sniff on both interfaces at the same time for non unicast traffic. You should see all packets twice ( tcpdump -nni eth0 -c 10 broadcast or multicast & tcpdump -nni eth1 -c 10 broadcast or multicast & ) | sort Probe with an IP-less protocol. For example with this tool to generate DHCP requests: ...


6

You can create virtual interfaces using the iproute2 toolkit. ip link add veth0 type veth peer name veth1 This will create 2 interfaces, veth0 and veth1. Think of them as 2 ends of a pipe. Any traffic sent into veth0 will come out veth1 and vice versa. If you want the traffic to be routed, you can do: sysctl -w net.ipv4.conf.veth0.forwarding=1 This ...


6

In my situation, I changed the network adapter configuration of my hypervisor after the installation of CentOS. What happened in this case is that the old interface eth0 no longer existed but a new one called eth1 did. ls /sys/class/net eth1 lo I changed the network config /etc/sysconfig/network-scripts/ifcfg-eth0 to use DEVICE=eth1 and it worked again.


6

Just remove the IPv4 and IPv6 addresses with ip addr flush dev eth1 and ip -6 addr flush dev eth1.


5

On Solaris 11: dladm show-phys On older releases: kstat -c net ":::link*"


5

I have read a similar story from GeNUA. Their workaround was to restart the network driver (OpenBSD). On Linux this would translate to: ifdown eth3 && rmmod bnx2 && modprobe bnx2 && ifup eth3. The core problem was an internal coding problem with pointers on a PAE system in conjunction with the broadcom-driver.


5

If you want that information and more in handy little commands: mii-tool eth0 ethtool eth0 might do the job.


5

Many devices use nonstandard connectors for serial ports. RJ-45 is probably the most common connector used for RS-232 serial after DB-9, but unlike with DB-9, there aren't even de facto standards for the pinout. I'm aware of 4 different RJ-45 RS-232 pinouts, and there are probably others I haven't seen yet. None of this means that people are somehow ...


5

Here's a modern Linux method: ip -o link show dev eth0 | grep -Po 'ether \K[^ ]*' It's modern in that ifconfig has long been deprecated in favour of ip from the iproute2 package, and that grep has the -P option for perl regular expressions for the zero-width positive look-behind assertion. grep -o is nice for text extraction. sed is traditionally used ...


5

This is as simple as it could be. You do not need any bridging. Just MASQUERADE your local network on RPi: iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE Enable forwarding of traffic: echo 1 > /proc/sys/net/ipv4/ip_forward RPi will not work as invisible bump-on-the-wire but will need a network setup between it and your private router – which ...


5

The effects of a duplicate MAC address can be subtle in some cases. Switches distribute traffic to hosts based on "seen MAC" addresses. When you turn on your computer and it sends its first packet out on the network, your switch will log in its MAC table that "MAC address X came from port Y". Conversely then, in the future when it sees a unicast packet ...



Only top voted, non community-wiki answers of a minimum length are eligible