Clear "no switchport" command from cisco device interface - cisco

How can clear "no switchport" command from cisco devices interface?

Just go into interface mode and write "switchport".
Example:
conf t
interface Gi1/0/15
switchport
end
wr

Related

Port with VLAN not working on Cisco switch [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I'm having issues with a cisco SG550X-24 switch.
The switch is showing 100U as an administrative VLAN but not an operation VLAN. I'm unsure why this is, and plugging into this port doesn't work. The switch functions normally and other ports work fine.
Screenshot of config page attached:
cisco vlan config
1 and 19 are configured exactly and same, port 19 works fine with 100U but port 1 doesn't.
Any ideas? Is there a setting I'm missing that disables the port or VLAN?
Thanks
config-file-header
CB-BR-Radon233
v2.5.5.47 / RTESLA2.5.5_930_364_286
CLI v1.0
file SSD indicator encrypted
#
ssd-control-start
ssd config
ssd file passphrase control unrestricted
no ssd file integrity control
ssd-control-end cb0a3fdb1f3a1af4e4430033719968c0
!
!
unit-type-control-start
unit-type unit 1 network gi uplink te
unit-type unit 2 network gi uplink te
unit-type unit 3 network gi uplink te
unit-type unit 4 network gi uplink te
unit-type unit 5 network gi uplink te
unit-type unit 6 network gi uplink te
unit-type unit 7 network gi uplink te
unit-type unit 8 network gi uplink te
unit-type-control-end
!
port jumbo-frame
vlan database
vlan 2,69,100,201
exit
voice vlan oui-table add 0001e3 Siemens_AG_phone________
voice vlan oui-table add 00036b Cisco_phone_____________
voice vlan oui-table add 00096e Avaya___________________
voice vlan oui-table add 000fe2 H3C_Aolynk______________
voice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone
voice vlan oui-table add 00d01e Pingtel_phone___________
voice vlan oui-table add 00e075 Polycom/Veritel_phone___
voice vlan oui-table add 00e0bb 3Com_phone______________
link-flap prevention disable
no boot host auto-config
no boot host auto-update
bonjour interface range vlan 1
hostname IMS-CB-BR-Radon233
no passwords complexity enable
username root password encrypted 777f99c04f34de13899c397960ac60d7548cfeb4 privilege 15
username cisco password encrypted ffd1c8e37222f7a9f61aec3e1179e951695fdeba privilege 15
ip ssh server
snmp-server location CB-BR-Radon233
snmp-server contact
clock timezone J 0 minutes 0
!
interface vlan 1
ip address 192.168.1.233 255.255.255.0
no ip address dhcp
!
interface vlan 2
name Phone
!
interface vlan 69
name Dirty
!
interface vlan 100
name Admin
ip address 192.168.100.233 255.255.255.0
!
interface vlan 201
name Mocap
!
interface GigabitEthernet1/0/1
no switchport
switchport access vlan 100
switchport trunk native vlan 100
!
interface GigabitEthernet1/0/3
storm-control broadcast level 10
storm-control multicast level 10
port security max 10
port security mode max-addresses
port security discard trap 60
spanning-tree portfast
spanning-tree bpduguard enable
switchport mode trunk
switchport trunk allowed vlan 1
macro description ip_phone_desktop
!next command is internal.
macro auto smartport dynamic_type ip_phone_desktop
!
interface GigabitEthernet1/0/4
storm-control broadcast level 10
storm-control multicast level 10
port security max 10
port security mode max-addresses
port security discard trap 60
spanning-tree portfast
spanning-tree bpduguard enable
switchport mode trunk
switchport access vlan 2
switchport trunk allowed vlan 1
macro description ip_phone_desktop
!next command is internal.
macro auto smartport dynamic_type ip_phone_desktop
!
interface GigabitEthernet1/0/7
storm-control broadcast level 10
storm-control multicast level 10
port security max 10
port security mode max-addresses
port security discard trap 60
spanning-tree portfast
spanning-tree bpduguard enable
switchport mode trunk
switchport trunk allowed vlan 1
macro description ip_phone_desktop
!next command is internal.
macro auto smartport dynamic_type ip_phone_desktop
!
interface GigabitEthernet1/0/11
storm-control broadcast level 10
storm-control multicast level 10
port security max 10
port security mode max-addresses
port security discard trap 60
spanning-tree portfast
spanning-tree bpduguard enable
switchport mode trunk
switchport access vlan 2
switchport trunk allowed vlan 1
macro description ip_phone_desktop
!next command is internal.
macro auto smartport dynamic_type ip_phone_desktop
!
interface GigabitEthernet1/0/12
channel-group 1 mode auto
!
interface GigabitEthernet1/0/13
switchport mode trunk
switchport access vlan 100
switchport trunk allowed vlan none
!
interface GigabitEthernet1/0/19
switchport access vlan 100
switchport trunk native vlan 100
!
interface GigabitEthernet1/0/24
channel-group 1 mode auto
!
interface TenGigabitEthernet1/0/1
channel-group 2 mode auto
!
interface TenGigabitEthernet1/0/2
channel-group 2 mode auto
!
interface TenGigabitEthernet1/0/3
spanning-tree link-type point-to-point
switchport mode trunk
switchport trunk allowed vlan 1-2,69,100,201
macro description switch
!next command is internal.
macro auto smartport dynamic_type switch
!
interface Port-Channel1
description EthTrunk
spanning-tree link-type point-to-point
switchport mode trunk
switchport general allowed vlan add 2,69,100,201 tagged
switchport general allowed vlan add 1 untagged
macro description switch
!next command is internal.
macro auto smartport dynamic_type switch
!
interface Port-Channel2
description X1Trunk
switchport mode trunk
!
exit
assuming you're using the same device and the same ethernet-cable when connecting to port 1 and port 19, correct?
would you mind to SSH into the switch and collect a "show run" for port 1 and 19?
...ok, with the config provided:
this is weird, port 1 is configured as routed port but the vlan-settings are still there.
my first try would be:
(in the ssh shell)
conf t
interface GigabitEthernet1/0/1
switchport
end
that should fix the vlan-membership.
a good practice for end-user-facing interfaces would be to add:
conf t
interface GigabitEthernet1/0/1
spanning-tree portfast
spanning-tree bpduguard enable
end

Device and network interface

I have wifi and ethernet card in my computer.
Under linux is there a way to know which device is using which network interface?
Generally, you can run command "ip a" and check all the network interfaces connected: from the name of the interface you can see which kind of connection it's related to the interface, i.e.:
eth0
Some kind of cabled connection
wlp1
Some kind of wireless connection
This applies to default names, since you can always change the interface name.

Bluetooth in Terminal

I want to see the Bluetooth adapter details in terminal without using Bluetooth GUI. Initially Bluetooth is turned off both in terminal and GUI.
My commands for different functions in Terminal
View status of Bluetooth (it will show active/inactive and status in some cases, and just active/inactive in some other cases)
sudo /etc/init.d/bluetooth status
Turn on Bluetooth
sudo /etc/init.d/bluetooth start
Turn off Bluetooth
sudo /etc/init.d/bluetooth stop
View the Bluetooth adapter details
hciconfig
I can see the adapter details with the help of Bluetooth GUI in Settings GUI.
I researched the status of Bluetooth in different cases by doing following steps in order:
1. Turn on Bluetooth via terminal
Status = "Running"
Active = "active (running)"
Bluetooth adapter details: Doesn't display anything
2. Turn off Bluetooth via terminal
Status = Not shown
Active = "inactive (dead)"
Bluetooth adapter details: Doesn't display anything
3. Turn on Bluetooth via GUI
Status = "Running"
Active = "active (running)"
Bluetooth adapter details: Shows the adapter details
4. Turn off Bluetooth via terminal, but doesn't change in GUI
Status = "Quitting"
Active = "inactive (dead)"
Bluetooth adapter details: Shows the adapter details
5. Turn on Bluetooth via terminal
Status = "Running"
Active = "active (running)"
Bluetooth adapter details: Shows the adapter details
6. Turn off Bluetooth via terminal, but doesn't change in GUI
Status = "Quitting"
Active = "inactive (dead)"
Bluetooth adapter details: Shows the adapter details
7. Turn off Bluetooth in GUI
Status = Not shown
Active = "inactive (dead)"
Bluetooth adapter details: Doesn't display anything
Can someone please help me what's wrong in my commands? Also, why it works fine along with GUI? What does GUI actually do?
Give this tool a try:
bluetoothctl
Here is the installation guide:
(https://wiki.archlinux.org/index.php/bluetooth#Installation)
it gives you a lot of posibilities:
Menu main:
Available commands:
-------------------
advertise Advertise Options Submenu
scan Scan Options Submenu
gatt Generic Attribute Submenu
list List available controllers
show [ctrl] Controller information
select <ctrl> Select default controller
devices List available devices
paired-devices List paired devices
system-alias <name> Set controller alias
reset-alias Reset controller alias
power <on/off> Set controller power
pairable <on/off> Set controller pairable mode
discoverable <on/off> Set controller discoverable mode
agent <on/off/capability> Enable/disable agent with given capability
default-agent Set agent as the default one
advertise <on/off/type> Enable/disable advertising with given type
set-alias <alias> Set device alias
scan <on/off> Scan for devices
info [dev] Device information
pair [dev] Pair with device
trust [dev] Trust device
untrust [dev] Untrust device
block [dev] Block device
unblock [dev] Unblock device
remove <dev> Remove device
connect <dev> Connect device
disconnect [dev] Disconnect device
menu <name> Select submenu
version Display version
quit Quit program
exit Quit program
help Display help about this program
you can even drill down into the advertise policies and more:
# menu advertise
Menu advertise:
Available commands:
-------------------
uuids [uuid1 uuid2 ...] Set/Get advertise uuids
service [uuid] [data=xx xx ...] Set/Get advertise service data
manufacturer [id] [data=xx xx ...] Set/Get advertise manufacturer data
tx-power [on/off] Show/Enable/Disable TX power to be advertised
name [on/off/name] Configure local name to be advertised
appearance [on/off/value] Configure custom appearance to be advertised
duration [seconds] Set/Get advertise duration
timeout [seconds] Set/Get advertise timeout
clear [uuids/service/manufacturer/config-name...] Clear advertise config
back Return to main menu
version Display version
quit Quit program
exit Quit program
help Display help about this program
That is a lot of information you can pull (and set) directly.

PPPd over SOCAT using INTERFACE option

My objective is to use pppd over socat. I have two Ubuntu boxes with eth0 connected (physically) to each other. I can ping both the IP addresses. I do the below on each Ubuntu box.
Create a pseudo serial device and link it to my network interface "eth0".socat PTY,link=/dev/ttyp10 INTERFACE:eth0
Use pppd on this pseudo serial device.
Device A:
pppd noauth /dev/ttyp10 10.10.10.10:20.20.20.20
Device B:
pppd noauth /dev/ttyp10 20.20.20.20:10.10.10.10
I see that my ppp0 interface gets created for a short time but I cannot ping both the IP addresses (10.10.10.10 or 20.20.20.20). I know my solution is not complete as I need to specify how my pppd packets must be routed from my eth0 interface but not sure how to do it (I used tcpdump on eth0 interface and found some data).
I tried the same experiment by binding socat to a TCP server/client and it worked.
Device A:
1. socat pty,link=/dev/ttyp10,raw,echo=0 TCP4-LISTEN:7001,reuseaddr &
2. pppd noauth /dev/ttyp10 10.10.10.10:20.20.20.20
Device B:
1. socat pty,link=/dev/ttyp10,raw,echo=0,waitslave TCP4:20.1.1.2:7001 &
2. pppd noauth /dev/ttyp10 20.20.20.20:10.10.10.10
Note: 20.1.1.2 is the "eth0" IP address of Device A. With this my ppp0 interface is up and I can ping both IP addresses (10.10.10.10 and 20.20.20.20).
Why I need to use the pseudo serial device when I have a working eth0 interface is a different question and lets not discuss that.
You probably want to adapt this example taken from the socat man page:
socat PTY,link=/var/run/ppp,rawer INTERFACE:hdlc0
circumvents the problem that pppd requires a serial device
and thus might not be able to work on a synchronous line
that is represented by a network device. socat creates a PTY
to make pppd happy, binds to the network interface hdlc0,
and can transfer data between both devices.
Use pppd on device /var/run/ppp then.
In this example, the interface is an synchronous line (seen by the OS as a HDLC interface). pppd uses (by default) a HLDC-like framing so it makes sense to pipe the raw data from pppd to the HDLC device.
In your case, you are using an Ethernet device and this does not make much sense to do the same thing.
In your second example, you managed to transport your PPP session over TCP which is a quite simple and viable option. Another solution in your case would be to use PPPoE which is designed for transporting PPP over Ethernet.

If lan is connected?

I want to write a script and put it in /etc/rc.local so that
if lan is connected then
rfkill block all
else
nmcli con up id 'Network id' --nowait
How should I write the if part and how should I check for "lan is connected" ?
You can check : How to detect the physical connected state of a network cable/connector?
I think at least one of the answer should work for you !

Resources