Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
2.8 kB
3
Indexable
Never
PS D:\code> ssh root@65.20.87.158
Last login: Wed Feb 21 10:12:11 2024 from 146.0.36.77
[root@vultr ~]#
[root@vultr ~]#
[root@vultr ~]# iptables -F
[root@vultr ~]# iptables -X
[root@vultr ~]# iptables -t nat -F
[root@vultr ~]# iptables -t nat -X
[root@vultr ~]# iptables -t mangle -F
[root@vultr ~]#
[root@vultr ~]# iptables -t mangle -X
[root@vultr ~]# iptables -P INPUT ACCEPT
[root@vultr ~]# iptables -P FORWARD ACCEPT
[root@vultr ~]# iptables -P OUTPUT ACCEPT
[root@vultr ~]# sh -c "iptables-save > /etc/iptables/rules.v4"
[root@vultr ~]# iptables -t nat -A POSTROUTING -o vpns0 -j MASQUERADE
[root@vultr ~]# iptables -t nat -A POSTROUTING -o enp1s0 -j MASQUERADE
[root@vultr ~]# client_loop: send disconnect: Connection reset

[root@vultr ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute
       valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq state UP group default qlen 1000
    link/ether 56:00:04:c5:b5:f4 brd ff:ff:ff:ff:ff:ff
    inet 65.20.87.158/23 brd 65.20.87.255 scope global dynamic noprefixroute enp1s0
       valid_lft 73823sec preferred_lft 73823sec
    inet6 2401:c080:2400:171f:5400:4ff:fec5:b5f4/64 scope global dynamic noprefixroute
       valid_lft 2591650sec preferred_lft 604450sec
    inet6 fe80::5400:4ff:fec5:b5f4/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
19: vpns0: <POINTOPOINT,UP,LOWER_UP> mtu 1399 qdisc fq state UNKNOWN group default qlen 500
    link/none
    inet6 fe80::54aa:bcf4:1535:4f74/64 scope link stable-privacy proto kernel_ll
       valid_lft forever preferred_lft forever
[root@vultr ~]#
[root@vultr ~]#
[root@vultr ~]# sysctl -a | grep forwarding | grep ipv4
net.ipv4.conf.all.bc_forwarding = 0
net.ipv4.conf.all.forwarding = 1
net.ipv4.conf.all.mc_forwarding = 0
net.ipv4.conf.default.bc_forwarding = 0
net.ipv4.conf.default.forwarding = 1
net.ipv4.conf.default.mc_forwarding = 0
net.ipv4.conf.enp1s0.bc_forwarding = 0
net.ipv4.conf.enp1s0.forwarding = 1
net.ipv4.conf.enp1s0.mc_forwarding = 0
net.ipv4.conf.lo.bc_forwarding = 0
net.ipv4.conf.lo.forwarding = 1
net.ipv4.conf.lo.mc_forwarding = 0
net.ipv4.conf.vpns0.bc_forwarding = 0
net.ipv4.conf.vpns0.forwarding = 1
net.ipv4.conf.vpns0.mc_forwarding = 0
[root@vultr ~]#
[root@vultr ~]# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=117 time=1.09 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=117 time=1.16 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.092/1.127/1.163/0.035 ms
[root@vultr ~]#

Leave a Comment