Routing between two subnets at same interface

a1ik

New Member
Feb 18, 2023
1
0
1
Hello everyone!

I have GPON SFP ONU Stick with telnet at his board.
SFP module connecting me to GPON internet.

Now, i can configurate my SFP module by telnet inside
Proxmox virtual mashine (Win10) connecting to (192.168.1.1)
Win10 have vlan linket to vmbr1 with static IP (192.168.1.4/24)

I need use GPON as default internet and if link down,
i want to use script to reboot SFP module by telnet.
How connect to SFP module direct from (debian/proxmox) CLI?

My setup (Debian/Proxmox) at this moment:
1. vmbr0 geting LAN DHCP IP (192.168.20.20/24) with internet i am using now
2. vmbr1 geting GPON DHCP IP (xxx.xxx.xxx.xxx/20) from provider with internet


# cat /etc/network/interfaces
Bash:
auto lo
iface lo inet loopback

iface enp7s0 inet manual
# The LAN network interface

iface enp3s0f0 inet manual
# The SFP network interface

auto vmbr0
iface vmbr0 inet dhcp
  bridge-ports enp7s0
  bridge-stp off
  bridge-fd 0
# External LAN

auto vmbr1
iface vmbr1 inet dhcp
  bridge-ports enp3s0f0
  bridge-stp off
  bridge-fd 0
# External SFP

# ip a
Bash:
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
2: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master vmbr0 state UP group default qlen 1000
    link/ether ma:c1:ad:dr:es:s1 brd ff:ff:ff:ff:ff:ff
3: enp3s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master vmbr1 state UP group default qlen 1000
    link/ether ma:c2:ad:dr:es:s2 brd ff:ff:ff:ff:ff:ff
4: vmbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether ma:c3:ad:dr:es:s3 brd ff:ff:ff:ff:ff:ff
    inet 192.168.20.20/24 brd 192.168.20.255 scope global vmbr0
       valid_lft forever preferred_lft forever
5: vmbr1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether ma:c4:ad:dr:es:s4 brd ff:ff:ff:ff:ff:ff
    inet XX.XX.XX.XX/20 brd YY.YY.YY.YY scope global dynamic vmbr1
    valid_lft 271sec preferred_lft 271sec
6: tap100i0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master vmbr1 state UNKNOWN group default qlen 1000
    link/ether ma:c5:ad:dr:es:s5 brd ff:ff:ff:ff:ff:ff

# ip r
Bash:
default via 192.168.20.1 dev vmbr0
XX.XX.XX.0/20 dev vmbr1 proto kernel scope link src YY.YY.YY.YY
192.168.20.0/24 dev vmbr0 proto kernel scope link src 192.168.20.20

# tcpdump -i vmbr1 host 192.168.1.1 -n
Bash:
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on vmbr1, link-type EN10MB (Ethernet), snapshot length 262144 bytes
23:33:06.713705 IP 192.168.1.4.49669 > 192.168.1.1.23: Flags [S], seq 3119061087, win 64240, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
23:33:06.714501 IP 192.168.1.1.23 > 192.168.1.4.49669: Flags [S.], seq 3041700009, ack 3119061088, win 5840, options [mss 1460,nop,nop,sackOK,nop,wscale 2], length 0
23:33:06.714557 IP 192.168.1.4.49669 > 192.168.1.1.23: Flags [.], ack 1, win 1026, length 0
23:33:06.744040 IP 192.168.1.1.23 > 192.168.1.4.49669: Flags [P.], seq 1:16, ack 1, win 1460, length 15 [telnet DO ECHO, DO NAWS, DO LFLOW, WILL ECHO, WILL SUPPRESS GO AHEAD]
23:33:06.744309 IP 192.168.1.4.49669 > 192.168.1.1.23: Flags [P.], seq 1:4, ack 16, win 1026, length 3 [telnet WILL ECHO]
23:33:06.745319 IP 192.168.1.1.23 > 192.168.1.4.49669: Flags [.], ack 4, win 1460, length 0
23:33:06.745435 IP 192.168.1.4.49669 > 192.168.1.1.23: Flags [P.], seq 4:25, ack 16, win 1026, length 21 [telnet WILL NAWS, SB NAWS IS 0x78 0 0x2d SE, WONT LFLOW, DO ECHO, DO SUPPRESS GO AHEAD]
23:33:06.746306 IP 192.168.1.1.23 > 192.168.1.4.49669: Flags [.], ack 25, win 1460, length 0
23:33:06.756548 IP 192.168.1.1.23 > 192.168.1.4.49669: Flags [P.], seq 16:23, ack 25, win 1460, length 7
23:33:06.811750 IP 192.168.1.4.49669 > 192.168.1.1.23: Flags [.], ack 23, win 1026, length 0
^C
10 packets captured
10 packets received by filter
0 packets dropped by kernel

I was trying already with:
1. iptables -A POSTROUTING -s '192.168.1.1' -o vmbr1 -j MASQUERADE no sucess
2. ip route add 192.168.1.1/32 dev vmbr1 no sucess
3. ip route add 192.168.1.1/32 dev enp3s0f0 no sucess
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!