Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- set -u
- # script gen debug info for edge router X
- # any interface it ought to be helpful
- # sudo ./erx.sh interface
- # sudo ./erx.sh enp2s0
- IFACE="${1:-enp2s0}"
- LOG="erx_diag_$(date +%Y%m%d_%H%M%S).log"
- say() { echo -e "\n=== $* ===" | tee -a "$LOG"; }
- run() { echo "\$ $*" | tee -a "$LOG"; "$@" 2>&1 | tee -a "$LOG"; }
- need_root() {
- if [[ "$EUID" -ne 0 ]]; then
- echo "Run as root: sudo $0 [$IFACE]"
- exit 1
- fi
- }
- check_cmd() {
- command -v "$1" >/dev/null 2>&1
- }
- need_root
- say "EdgeRouter X client-side diagnostic"
- echo "Interface: $IFACE" | tee -a "$LOG"
- echo "Log: $LOG" | tee -a "$LOG"
- say "1. Link state"
- run ip link show "$IFACE"
- if ! ip link show "$IFACE" | grep -q "LOWER_UP"; then
- echo "RESULT: No physical link. Check cable, port, router power, or wrong interface." | tee -a "$LOG"
- exit 1
- fi
- echo "RESULT: Physical Ethernet link is up." | tee -a "$LOG"
- say "2. Current IP addresses"
- run ip addr show "$IFACE"
- if ip -4 addr show "$IFACE" | grep -q "inet "; then
- echo "RESULT: You already have an IPv4 address." | tee -a "$LOG"
- else
- echo "RESULT: No IPv4 address currently assigned." | tee -a "$LOG"
- fi
- say "3. Routes"
- run ip route
- say "4. NetworkManager status, if available"
- if check_cmd nmcli; then
- run nmcli dev status
- run nmcli dev show "$IFACE"
- else
- echo "nmcli not installed/skipped." | tee -a "$LOG"
- fi
- say "5. DHCP attempt"
- if check_cmd dhclient; then
- run dhclient -r "$IFACE"
- timeout 20 dhclient -v "$IFACE" 2>&1 | tee -a "$LOG"
- DHCP_RC=${PIPESTATUS[0]}
- elif check_cmd udhcpc; then
- timeout 20 udhcpc -i "$IFACE" -n -q 2>&1 | tee -a "$LOG"
- DHCP_RC=${PIPESTATUS[0]}
- else
- echo "No dhclient or udhcpc found. Cannot actively test DHCP." | tee -a "$LOG"
- DHCP_RC=99
- fi
- say "6. IP after DHCP"
- run ip addr show "$IFACE"
- run ip route
- if ip -4 addr show "$IFACE" | grep -q "inet "; then
- IP=$(ip -4 addr show "$IFACE" | awk '/inet / {print $2; exit}')
- GW=$(ip route | awk '/default/ {print $3; exit}')
- echo "RESULT: DHCP or addressing succeeded. IP: $IP Gateway: ${GW:-none}" | tee -a "$LOG"
- if [[ -n "${GW:-}" ]]; then
- say "7. Gateway ping"
- run ping -c 3 -W 2 "$GW"
- fi
- exit 0
- fi
- say "7. Passive DHCP packet sniff"
- if check_cmd tcpdump; then
- echo "Listening briefly for DHCP traffic. Unplug/replug the Ethernet cable now if you want." | tee -a "$LOG"
- timeout 15 tcpdump -ni "$IFACE" -vvv 'port 67 or port 68' 2>&1 | tee -a "$LOG"
- else
- echo "tcpdump not installed/skipped." | tee -a "$LOG"
- fi
- say "Diagnosis"
- echo "Physical link: OK" | tee -a "$LOG"
- echo "IPv4 address: MISSING" | tee -a "$LOG"
- cat <<EOF | tee -a "$LOG"
- Most likely causes:
- 1. The EdgeRouter port you are plugged into is not configured as LAN.
- On many EdgeRouter X configs, eth1-eth4 need to be members of switch0.
- 2. DHCP server is not configured or not running on that LAN interface.
- 3. The router may be factory-reset or configured with a static LAN address only.
- Try setting your computer manually to:
- IP: 192.168.1.10
- Netmask: 255.255.255.0
- Then try:
- ping 192.168.1.1
- open http://192.168.1.1/
- 4. If this is not a default config, the LAN may be on another subnet/VLAN.
- Useful router-side commands, if you can console/SSH into it:
- show interfaces
- show interfaces switch
- show service dhcp-server
- show configuration commands | match "eth1|switch0|dhcp-server"
- Saved full diagnostic log to:
- $LOG
- EOF
- # post scan debug
- #sudo nmcli radio wifi off
- #sudo ip addr flush dev enp2s0
- #sudo ip addr add 192.168.1.10/24 dev enp2s0
- #sudo ip link set enp2s0 up
- #ping -c 3 192.168.1.1
Advertisement
Comments
-
- ⭐ Changelly Profit Exploit Documentation ⭐
- https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=sxwyxwqzdx
- This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
- The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
- Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment