Monday, January 4, 2021

on setting up a vlan manually and sniffing packets under the vlan

I initialized vlan test interface over default enp7s0, using ip link add link enp7s0 name test type vlan id 2. As I have very limited experience with the configs of networking, I left things like broadcast, mtu etc unassigned(default). I then assigned a dummy ipv4 address under the interface test, namely 1.12.1.1. I am able to ping the address now.

As of everything above, the config for test looks like

```

3: test@enp7s0: <BROADCAST,MULTICAST,UP,LOWER\_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000

link/ether 4c:ed:fb:6b:db:e8 brd ff:ff:ff:ff:ff:ff

inet 1.12.1.1/32 scope global test

valid_lft forever preferred_lft forever

inet6 fe80::4eed:fbff:fe6b:dbe8/64 scope link

valid_lft forever preferred_lft forever

```

Now, I want to experiment by sending packets to test, namely the addr 1.12.1.1 and inspecting it. How do I do so?

I have used tcpdump -i test and 1) pinging the addr, 2) sending msg hi using echo hi | nc 1.12.1.1 80 but on the window where I'm running the packet sniffer, tcpdump, nothing seem to pop up.

Also, I can't seem to connect to any other interfaces as ping -I test localhost doesn't work.

Any advice on setting up the VLAN properly would be much appreciated.



No comments:

Post a Comment