How to Use Cli Shell Command to Set None IPv4 type?

Started by forum111, January 25, 2024, 12:04:37 PM

Previous topic - Next topic
January 25, 2024, 12:04:37 PM Last Edit: January 25, 2024, 12:12:11 PM by forum111
I need command how to set vmx0 (LAN) interface from static to  NONE and to act as switch?
The cli ssh command to assign LAN0 into bridge0?
How to allow firewall bridge0 to enter into router ip 192.168.10.1?
I need commands for save and apply also.

This is my initial state:

------------------------------------------------------------------------------------------------
interfaces        | IP4 type                                |      IP                           |   DHCP server      |                |           
----------------------------------------------------------------------------------------------------
em0 - WAN       | DHCP                                    |     200.20.20.20           |                           |                |           
vmx0 - LAN0     | Static IP                                |     192.168.1.1             |  ACTIVE for lease
vmx1- OPT1      | NONE (act as switch only)      |
vmx2- OPT2      | NONE (act as switch only)      |
vmx3- OPT3      | NONE (act as switch only)      |
vmx4- OPT4      | NONE (act as switch only)      |
bridge0 (OPT1,OPT2,OPT3,OPT4) | Static IP       |     192.168.10.1          |   ACTIVE for lease |                |   



I try this steps and failed gracefully.


# Set LAN0 interface to NONE
ifconfig vmx0 none


# Add LAN0 interface to the bridge
ifconfig bridge0 addm vmx0

# Save the configuration (may vary based on your system)
# For OPNsense:
config save
# For FreeBSD:
service config save

# Apply the changes (may vary based on your system)
# For OPNsense:
config apply
# For FreeBSD:
service config restart

# Assuming you have the pfctl command available
# Replace "em0" with your WAN interface if it's different
pfctl -e
pfctl -f /etc/pf.conf

# Add a rule to allow traffic from bridge0 to the router's IP
echo 'pass in on bridge0 from any to 192.168.10.1' >> /etc/pf.conf

# Reload the pf configuration
pfctl -f /etc/pf.conf

Quote from: forum111 on January 25, 2024, 12:04:37 PM
I need command how to set vmx0 (LAN) interface from static to  NONE and to act as switch?
The cli ssh command to assign LAN0 into bridge0?
How to allow firewall bridge0 to enter into router ip 192.168.10.1?

I need commands for save and apply also.

This is my initial state:

------------------------------------------------------------------------------------------------
interfaces        | IP4 type                                |      IP                           |   DHCP server      |                |           
----------------------------------------------------------------------------------------------------
em0 - WAN       | DHCP                                    |     200.20.20.20           |                           |                |           
vmx0 - LAN0     | Static IP                                |     192.168.1.1             |  ACTIVE for lease
vmx1- OPT1      | NONE (act as switch only)      |
vmx2- OPT2      | NONE (act as switch only)      |
vmx3- OPT3      | NONE (act as switch only)      |
vmx4- OPT4      | NONE (act as switch only)      |
bridge0 (OPT1,OPT2,OPT3,OPT4) | Static IP       |     192.168.10.1          |   ACTIVE for lease |                |   



I try this steps and failed gracefully.


# Set LAN0 interface to NONE
ifconfig vmx0 none


# Add LAN0 interface to the bridge
ifconfig bridge0 addm vmx0

# Save the configuration (may vary based on your system)
# For OPNsense:
config save
# For FreeBSD:
service config save

# Apply the changes (may vary based on your system)
# For OPNsense:
config apply
# For FreeBSD:
service config restart