So I'm having what I believe is a common issue with Cisco AnyConnect and Vagrant/VirtualBox, i'm using host-only networking so that I can stand up a virtual server at an ip such as 10.10.10.11 and then I can map this in my /etc/hosts to :
# IP to hostname mapping
10.10.10.10 vagrant.dev
And then I can pull a webpage from curl vagrant.dev for example. Real standard stuff.
Things go awry when I connect to my work VPN which makes this nice little dev box kind of useless as I can no longer hit it by hostname or ip any longer. I can still do a vagrant ssh to the box but there is no other way to hit it.
I tried taking a look at the routing table and it appears that my pre-vbox route entry (netstat -rn):
Internet:
Destination Gateway Flags Refs Use Netif Expire
PreVPN
10.10.10/24 link#11 UCS 1 0 vboxnet
10.10.10.11 8:0:27:96:91:84 UHLWIi 1 70 vboxnet 1197
PostVPN
10.10.10/24 link#19 UCS 1 0 utun1
10.10.10.11 link#19 UHW3I 0 4 utun1 62
Route Flag Description
|PRE|POST| Flag Description |
|---|----|-----------------------------------------------|
| U | U | Route usable |
| H | H | Host entry (net otherwise) |
| L | | Valid protocol to link address translation |
| W | W | Route was generated as a result of cloning |
| | 3 | Protocol specified route flag #3 |
| I | I | Route is assocaited with an interface scope |
| i | | Route is a holding reference to the interface |
Question
Is it possible to restore the routes changed by VPN in order to make my vagrant connections work again? And if-so how?
Other Data
Full Route Table (PRE) (IP4 only)
Internet:
Destination Gateway Flags Refs Use Netif Expire
default 192.168.2.1 UGSc 23 1 en0
10.10.10/24 link#11 UCS 1 0 vboxnet
10.10.10.11 8:0:27:96:91:84 UHLWIi 1 70 vboxnet 1197
127 127.0.0.1 UCS 0 7 lo0
127.0.0.1 127.0.0.1 UH 11 128344 lo0
169.254 link#4 UCS 0 0 en0
192.168.2 link#4 UCS 0 0 en0
192.168.2.1 68:7f:74:81:8b:b0 UHLSr 27 126 en0
192.168.2.106/32 link#4 UCS 0 0 en0
Full Route Table (POST) (IP4 only)
Internet:
Destination Gateway Flags Refs Use Netif Expire
default link#19 UCS 9 0 utun1
default 192.168.2.1 UGScI 3 0 en0
10.10.10/24 link#19 UCS 1 0 utun1
10.10.10.11 link#19 UHW3I 0 4 utun1 62
17.158.10.25 link#19 UHW3I 0 1 utun1 62
17.158.10.42 link#19 UHW3I 0 20 utun1 62
17.158.10.46 link#19 UHW3I 0 1 utun1 62
127 127.0.0.1 UCS 0 7 lo0
127.0.0.1 127.0.0.1 UH 15 128507 lo0
128.29.154.114 link#19 UHWIi 31 117 utun1
129.83.20.9 link#19 UHW3I 0 20 utun1 61
129.83.26.209 link#19 UHWIi 2 2 utun1
129.83.100.38 link#19 UHW3I 0 46 utun1 62
169.254 link#19 UCS 0 0 utun1
172.31.160/19 link#19 UCS 0 0 utun1
172.31.163.172/32 127.0.0.1 UGSc 3 67 lo0
192.80.55.9/32 192.168.2.1 UGSc 1 0 en0
192.168.2 link#19 UCS 0 0 utun1
192.168.2.1 68:7f:74:81:8b:b0 UHLSr 7 8 en0
192.168.2.1/32 link#19 UCS 0 0 utun1
192.168.2.106/32 link#4 UCS 0 0 en0
216.58.217.132 link#19 UHW3I 0 2 utun1 59
239.255.255.250 link#19 UHmW3I 0 17 utun1 62
Components
OSX
Cisco Any Connect
VirtualBox 5.0.8
Unfortunately there is no fix for the issue, only work-around/help I could think of is after disconnecting the VPN, you could use "route -n add" to establish the connectivity back - at least by this way u could save whole reboot of machines.
Ex:
sudo route -n add -net 192.168.56.0/24 -interface vboxnet0
(Try this after disconnecting from VPN - This method wont work when VPN is on)
In your case, something like, "sudo route -n add -net 10.10.10.0/24 -interface vboxnet0" - depends on your subnet obviously !
Also please see Ticket #14293
When facing this exact same problem what worked for us is to change the address of the Vagrant box to 11.0.0.100
Related
I want to cut string into two string using an string
CH 7 ][ Elapsed: 0 s ][ 2021-11-27 12:55
BSSID PWR Beacons #Data, #/s CH MB ENC CIPHER AUTH ESSID
EE:EE:EE:EE:EE:EE -82 3 0 0 6 130 WPA2 CCMP PSK Tenda
FF:FF:FF:FF:FF:FF -90 4 0 0 1 130 WPA2 CCMP PSK Wifi
BSSID STATION PWR Rate Lost Frames Notes Probes
EE:EE:EE:EE:EE:EE AA:AA:AA:AA:AA:AA -63 0 - 1e 0 3
EE:EE:EE:EE:EE:EE BB:BB:BB:BB:BB:BB -74 0 - 1 0 1
I want to cut my text using this delimiter BSSID STATION PWR Rate Lost Frames Notes Probes I try with awk -F 'BSSID' '{print $1}' file but it cut all occurrence, I want to cut only last occurrence.
desired output :
CH 7 ][ Elapsed: 0 s ][ 2021-11-27 12:55
BSSID PWR Beacons #Data, #/s CH MB ENC CIPHER AUTH ESSID
EE:EE:EE:EE:EE:EE -82 3 0 0 6 130 WPA2 CCMP PSK Tenda
FF:FF:FF:FF:FF:FF -90 4 0 0 1 130 WPA2 CCMP PSK Wifi
awk '/BSSID STATION PWR Rate Lost Frames Notes Probes/{exit} 1' file
I would like to capture the first 8 lines of the following file, then capture all fields where NPU # is equal to 7 or 3, and NPU core is equal to 1.
RP/0/RP0/CPU0:xxxxx#show controllers npu voq-usage interface all instance all location 0/0/CPU0
33144 Tue Jun 4 xxxx
33145 -------------------------------------------------------------------
33146 Node ID: 0/0/CPU0
33147 Intf Intf NPU NPU PP Sys VOQ Flow VOQ Port
33148 name handle # core Port Port base base port speed
33149 (hex) type
33150 ----------------------------------------------------------------------
33151 Hu0/0/2/1 210 0 1 21 21 1024 4152 local 100G
33152 Hu0/0/2/47 218 7 0 1 701 1032 4152 local 100G
33153 Hu0/0/2/46 220 7 0 5 705 1040 4216 local 100G
33154 Hu0/0/2/45 228 7 0 9 709 1048 4280 local 100G
33155 Hu0/0/2/44 230 3 1 17 717 1056 4152 local 100G
I'm able to do this with the following disparate awk commands:
awk 'NR<9' filename.txt
awk '($4==7||$4==3) && $5==1' filename.txt
Can I get some advice on how I might join these awk statement together? Or maybe even a bash-ism that would be more elegant to achieve this?
Thanks,
I suggest using a || operator and group the second condition:
awk 'NR<9 || (($4==7||$4==3) && $5==1)' filename.txt > newfilename.txt
See the online demo:
s="RP/0/RP0/CPU0:xxxxx#show controllers npu voq-usage interface all instance all location 0/0/CPU0
33144 Tue Jun 4 xxxx
33145 -------------------------------------------------------------------
33146 Node ID: 0/0/CPU0
33147 Intf Intf NPU NPU PP Sys VOQ Flow VOQ Port
33148 name handle # core Port Port base base port speed
33149 (hex) type
33150 ----------------------------------------------------------------------
33151 Hu0/0/2/1 210 0 1 21 21 1024 4152 local 100G
33152 Hu0/0/2/47 218 7 0 1 701 1032 4152 local 100G
33153 Hu0/0/2/46 220 7 0 5 705 1040 4216 local 100G
33154 Hu0/0/2/45 228 7 0 9 709 1048 4280 local 100G
33155 Hu0/0/2/44 230 3 1 17 717 1056 4152 local 100G"
awk 'NR<9 || (($4==7||$4==3) && $5==1)' <<< "$s"
Output:
RP/0/RP0/CPU0:xxxxx#show controllers npu voq-usage interface all instance all location 0/0/CPU0
33144 Tue Jun 4 xxxx
33145 -------------------------------------------------------------------
33146 Node ID: 0/0/CPU0
33147 Intf Intf NPU NPU PP Sys VOQ Flow VOQ Port
33148 name handle # core Port Port base base port speed
33149 (hex) type
33150 ----------------------------------------------------------------------
33155 Hu0/0/2/44 230 3 1 17 717 1056 4152 local 100G
awk '(NR<9) || (($4~/^[73]$/) && ($5==1))' filename.txt
Could you please try 1 more way.
awk 'NR<=9{print;next} ($4==7||$4==3) && $5==1' Input_file
This might work for you (GNU sed):
sed -E '1,8b;/^(\S+\s+){3}[37]\s+1\s/!d' file
Print lines 1 to 8 and any lines where the 4th field is either 3 or 7 and 5th field is 1.
I am trying to configure ntp server on centos 7 instead of ip address its showing INIT while executing ntpq -p command.
my ntp server configuration file.
/etc/ntp.conf
driftfile /var/lib/ntp/drift
restrict default nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1
# Hosts on local network are less restricted.
Allow 10.0.3.0/24 network clients to syncronize time with this server
restrict 10.0.3.0 mask 255.255.255.0 nomodify notrap
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 2.in.pool.ntp.org
server 1.asia.pool.ntp.org
server 3.asia.pool.ntp.org
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
disable monitor
I have have following outputs while executing ntpq -q command
[centos#ip-10-0-3-53 etc]$ ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
ntp.your.org .INIT. 16 u - 128 0 0.000 0.000 0.000
ns3.weiszhostin .INIT. 16 u - 128 0 0.000 0.000 0.000
resolver2.skyfi .INIT. 16 u - 128 0 0.000 0.000 0.000
ntp2.wiktel.com .INIT. 16 u - 128 0 0.000 0.000 0.000
[spryiq#ip-10-0-3-53 etc]$
Port 123 is listening correctly
[centos#ip-10-0-3-53 etc]$ netstat -plnu | grep 123
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
udp 0 0 10.0.3.53:123 0.0.0.0:* -
udp 0 0 127.0.0.1:123 0.0.0.0:* -
udp 0 0 0.0.0.0:123 0.0.0.0:* -
udp6 0 0 fe80::10c9:ecff:fe9:123 :::* -
udp6 0 0 ::1:123 :::* -
udp6 0 0 :::123 :::* -
[centos#ip-10-0-3-53 etc]$ ntpstat
timeout
[centos#ip-10-0-3-53 etc]$ ntpq
ntpq> as
ind assid status conf reach auth condition last_event cnt
===========================================================
1 1255 8011 yes no none reject mobilize 1
2 1256 8011 yes no none reject mobilize 1
3 1257 8011 yes no none reject mobilize 1
4 1258 8011 yes no none reject mobilize 1
I have configured iptables correctly.instead of INIT it should display ip addresses How can i troubleshoot this problem??
So, I had just started out with Elasticsearch on my local machine.
I have started 5 instances of Elasticsearch nodes. (simple ./bin/elasticsearch)
curl -s 'localhost:9200/_cat/nodes?v' gives:
host ip heap.percent ram.percent load node.role master name
127.0.0.1 127.0.0.1 5 99 3.13 d m Shirow Ishihara
127.0.0.1 127.0.0.1 7 100 3.13 d m Madame Web
127.0.0.1 127.0.0.1 5 100 3.13 d m Anthropomorpho
127.0.0.1 127.0.0.1 5 100 3.13 d m Paste-Pot Pete
127.0.0.1 127.0.0.1 2 100 3.13 d * Mephisto
My index has 2 primary shards and 5 replicas (total 10 replicas).
I had read that ES automatically scales horizontally and assigns/moves shards to new nodes. However, still all the 10 replicas are unassigned and both the 2 primary shards are in the same node.
curl -s 'localhost:9200/_cat/allocation?v' gives:
shards disk.indices disk.used disk.avail disk.total disk.percent host ip node
0 0b 105.5gb 6.2gb 111.8gb 94 127.0.0.1 127.0.0.1 Shirow Ishihara
0 0b 105.5gb 6.2gb 111.8gb 94 127.0.0.1 127.0.0.1 Paste-Pot Pete
2 318b 105.5gb 6.2gb 111.8gb 94 127.0.0.1 127.0.0.1 Mephisto
0 0b 105.5gb 6.2gb 111.8gb 94 127.0.0.1 127.0.0.1 Anthropomorpho
0 0b 105.5gb 6.2gb 111.8gb 94 127.0.0.1 127.0.0.1 Madame Web
10 UNASSIGNED
You have too few available disk space an ES is actually trying to move away some shards. But all your nodes are on the same machine so there is nowhere else where to move them and they stay unassigned. The used disk space is more than 90% of the total disk size and ES is hitting the the high watermark.
Read here more about this.
hrStorageIndex and ifIndex may changed after reboot sometimes.
How to identify a specific disk and network interface in SNMP, both under Linux and windows?
There are columns for hrStorageDescr and hrStorageType in the HOST-RESOURCES-MIB::hrStorageTable table.
Here is an example ...
snmptable -M +. -m +ALL -v 2c -Ci -c public -Pu myhost HOST-RESOURCES-MIB::hrStorageTable
SNMP table: HOST-RESOURCES-MIB::hrStorageTable
index hrStorageIndex hrStorageType hrStorageDescr hrStorageAllocationUnits hrStorageSize hrStorageUsed hrStorageAllocationFailures
1 1 HOST-RESOURCES-TYPES::hrStorageRam Physical memory 1024 Bytes 8057980 7268792 ?
3 3 HOST-RESOURCES-TYPES::hrStorageVirtualMemory Virtual memory 1024 Bytes 18347124 7687064 ?
6 6 HOST-RESOURCES-TYPES::hrStorageOther Memory buffers 1024 Bytes 8057980 124288 ?
7 7 HOST-RESOURCES-TYPES::hrStorageOther Cached memory 1024 Bytes 2366160 2366160 ?
10 10 HOST-RESOURCES-TYPES::hrStorageVirtualMemory Swap space 1024 Bytes 10289144 418272 ?
31 31 HOST-RESOURCES-TYPES::hrStorageFixedDisk / 4096 Bytes 12901535 11461911 ?
35 35 HOST-RESOURCES-TYPES::hrStorageFixedDisk /dev/shm 4096 Bytes 1007247 0 ?
36 36 HOST-RESOURCES-TYPES::hrStorageFixedDisk /boot 1024 Bytes 495844 100151 ?
37 37 HOST-RESOURCES-TYPES::hrStorageFixedDisk /home 4096 Bytes 44531330 5981531 ?
Same principle for IF-MIB::ifTable which has a ifDescr column ...
snmptable -M +. -m +ALL -v 2c -Ci -c public -Pu myhost IF-MIB::ifTable
SNMP table: IF-MIB::ifTable
index ifIndex ifDescr ifType ifMtu ifSpeed ifPhysAddress ifAdminStatus ifOperStatus ifLastChange ifInOctets ifInUcastPkts ifInNUcastPkts ifInDiscards ifInErrors ifInUnknownProtos ifOutOctets ifOutUcastPkts ifOutNUcastPkts ifOutDiscards ifOutErrors ifOutQLen ifSpecific
1 1 lo softwareLoopback 16436 10000000 up up 0:0:00:00.00 723382401 729363414 0 0 0 0 723382401 729363414 0 0 0 0 SNMPv2-SMI::zeroDotZero
2 2 eth0 ethernetCsmacd 1500 1000000000 0:21:5e:4d:15:b7 up up 0:0:00:00.00 1030103587 37542077 3449194 0 0 0 1570760541 32130390 0 0 0 0 SNMPv2-SMI::zeroDotZero
3 3 eth1 ethernetCsmacd 1500 0 0:21:5e:4d:15:b8 down down 0:0:00:00.00 0 0 0 0 0 0 0 0 0 0 0 0 SNMPv2-SMI::zeroDotZero