Code: Alles auswählen
root@xyz-05c298:/var/www/html/vlanadm# php vlanadm.php
VLAN löschen:
-> Der Befehl 'ip addr flush dev testvlan1' wurde ausgeführt.
-> Der Befehl 'ifconfig testvlan1 down' wurde ausgeführt.
-> Der Befehl 'ip link delete dev testvlan1' wurde ausgeführt.
Das VLAN wurde, falls existierend, gelöscht.
VLAN hinzufügen:
- ip link add link enxb827eb05c298 address ca:fe:ba:be:12:34 testvlan1 type macvlan
- ifconfig testvlan1 192.168.80.254 netmask 255.255.255.0 up
- route add -net 192.168.80.0 netmask 255.255.255.0 gw 192.168.80.1 dev testvlan1
Das VLAN wurde hinzugefügt und konfiguriert.
ifconfig zeigt mit das an:
Code: Alles auswählen
root@xyz-05c298:/var/www/html/vlanadm# ifconfig
enxb827eb05c298: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.80.188 netmask 255.255.255.0 broadcast 192.168.80.255
ether b8:27:eb:05:c2:98 txqueuelen 1000 (Ethernet)
RX packets 7694 bytes 2176570 (2.0 MiB)
RX errors 0 dropped 5 overruns 0 frame 0
TX packets 7070 bytes 801854 (783.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Lokale Schleife)
RX packets 10 bytes 632 (632.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10 bytes 632 (632.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
testvlan1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.80.254 netmask 255.255.255.0 broadcast 192.168.80.255
ether ca:fe:ba:be:12:34 txqueuelen 1000 (Ethernet)
RX packets 1393 bytes 455206 (444.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 80 bytes 10512 (10.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
...passt also, alles in allem, nicht wirklich zusammen. Weiss jemand, woran das Problem liegen könnte?
Vielen Dank für die Feedbacks.