tcpdump expression that capture port on one interface and another port on another interface? [closed] - tcpdump

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I need to capture port 9090 on eth0 and port 8080 on lo (localhost or loopback). Can somebody shows me the tcpdump expression that can do that? I am current using
tcpdump -n -i any port 8080 or port 9090
Thanks,

tcpdump -n -i any '(host ip of eth0 and 9090) or (host 127.0.0.1 and 8080)'

Related

Opening port 80 on Oracle Cloud Infrastructure Compute node [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 2 years ago.
The community reviewed whether to reopen this question 11 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
This is an elementary question however one I cannot seem to resolve by perusing the Oracle Cloud Infrastructure documentation. I've created an Ubuntu-based compute node, and it's attached to a subnet. In that subnet I've created a stateful rule with source 0.0.0.0/0, IP protocol: TCP, Source Port Range: All, Destination Port Range: 80.
There is no firewall configured on the server.
Despite this configuration I can't access the compute node's public IP. Any ideas?
I figured it out. The connectivity issue was due to Oracle's default use of iptables on all Oracle-provided images. Literally the very first thing I did when spinning up this instance was check ufw, presuming there were a few firewall restrictions in place. The ufw status was inactive, so I concluded the firewall was locally wide open. Because to my understanding both ufw and iptables look at the netfilter kernel firewall, and because ufw is the de facto (standard?) firewall solution on Ubuntu, I've no idea why they concluded it made sense to use iptables in this fashion. Maybe just to standardize across all images?
I learned about the rules by running:
$ sudo iptables -L
Then I saved the rules to a file so I could add the relevant ones back later:
$ sudo iptables-save > ~/iptables-rules
Then I ran these rules to effectively disable iptables by allowing all traffic through:
$ iptables -P INPUT ACCEPT
$ iptables -P OUTPUT ACCEPT
$ iptables -P FORWARD ACCEPT
$ iptables -F
To clear all iptables rules at once, run this command:
$ iptables --flush
Anyway, hope this helps somebody else out because documentation on the matter is non-existent.
When deploying compute instances at Oracle Cloud Infrastructure you need to take into account few things:
Create Internet Gateway (IGW).
Define routes to point to IGW.
Allow port 80 in the Security List associated with the IGW. By default you only have access to SSH and ICMP 3,4 type.
Allow connectivity on Compute's instance firewall (which is enabled by default).
In your example if you are using a OEL shape:
$ sudo firewall-cmd --zone=public --permanent --add-port=80/tcp
$ sudo firewall-cmd --reload
Always refer to the official guide: https://docs.cloud.oracle.com/en-us/iaas/developer-tutorials/tutorials/apache-on-ubuntu/01oci-ubuntu-apache-summary.htm
$ sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 80 -j ACCEPT
$ sudo netfilter-persistent save
$ sudo systemctl restart apache2
credited to https://medium.com/#fathi.ria/oracle-database-cloud-open-ports-on-oci-1af24f4eb9f2
Coumputer Instance(Such as Ubuntu) -> Virtual Cloud Network -> Security List -> Ingress Rules -> Please add a rule to allow access to port 80 from anywhere
Pre-Requisite
VM instance should have been created and running
Access to Public and Private keys used during the creation of VM instance
Log into the VM using SSH and run the following command
$ sudo iptables --list --line-numbers
It will show the details about Chain INPUT (policy ACCEPT). From the list
required to Delete REJECT all rule in the IPTABLES.
$ sudo iptables -D INPUT <Reject Line number>
e.g.
$ sudo iptables -D INPUT 6
Check if the REJECT rule is deleted
sudo iptables --list --line-numbers
Access the Default Security List and Edit Ingress Rules to Allow Internet Traffic on Port
Edit the INGRES Rule Add CIDR 0.0.0.0/0 TCP Destination 9999
(N): Networking >Virtual Cloud Networks> Virtual Cloud Network Details>Security Lists> Security List Details
Access your application via web browser
Type http://<public IP address of the VM>:port
I guess if you add the rule below to your iptables it should work; otherwise you'll be disturbing other rules which are related to block volume attachment that comes preconfigured on those Oracle images.
iptables -I INPUT 5 -i ens3 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
If you have not created Internet Gateway yet, that might be the reason. In order to connect the VCN with the public internet you need to have an Internet Gateway and a route table to direct the traffic through the gateway.

does anyone knows how to install mysql on ubuntu ec2 instance [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
i tried it several times but there are always an error can anyone give me the codes which I can run and try based on apt-get tool
Install MySQL
sudo apt-get update
sudo apt-get install mysql-server
During the installation you will be prompt for a root password.
Configure MySQL
sudo mysql_secure_installation
Test your MySQL installation
mysqladmin -p -u root version
Or you can use an image that has MySQL pre installed and configured for you.
MySQL powered by Bitnami

Mysql server failing to start [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 8 years ago.
Improve this question
I'm newbie in MySQL and I have installed MySQL5.5 Server and Client in my Debian Wheezy. All I did was enter "aptitude install myqsl-server". Now, I have no idea what to do to create my first table of data, I tried to enter with the following command as root(have no idea why I have to do this as root):
/etc/init.d/mysql start
The output was:
[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . .
. . failed!
I tried to see what is in the system log in /var/log/ and there is nothing there!
First, I tried to access /var/log/mysql, and this folder is empty, then I tried to read it vim /var/log/mysql.err and /var/log/mysql.log, both are empty too!
So, what is wrong? What is the next steps to create my first table of data?
Check the ownership on the /var/log/mysql and /var/mysqld directories.
ls -ld /var/log/mysql
ls -ld /var/mysqld
According to this thread you may have to change ownership to mysql:
chown mysql:mysql /var/log/mysql
chown mysql:mysql /var/mysqld

Can't use "which mysql" in zsh, but in bash work [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
After Upgrade to Ubuntu 12.04 LTS, and install mysql server 5.5, I Can't use "which mysql" in zsh, but in bash work!!
Here is my echos:
ZSH:
$ whereis mysql
mysql: /usr/bin/mysql /etc/mysql /usr/lib/mysql /usr/bin/X11/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.g
$ which mysql
mysql: aliased to nocorrect mysql
$ alias
...
...
mysql='nocorrect mysql'
...
...
BASH:
$ whereis mysql
mysql: /usr/bin/mysql /etc/mysql /usr/lib/mysql /usr/bin/X11/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.g
$ which mysql
/usr/bin/mysql

Uninstall MySQL completely from Ubuntu [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have trouble uninstalling MySQL from Ubuntu. I used the following commands, it doesn't seem to help as I still find the MySQL folder in /etc directory
aptitude remove mysql-client
aptitude remove mysql-server
aptitude remove mysql-common
Please suggest a good way to uninstall it completely and any command to check if the uninstallation was successful. Thank you!
sudo apt-get remove --purge mysql-client mysql-server