How to relay DHCP over LAN? (for Vigor3900/Vigor2960)
- DrayOS 4, imported, dhcp_relay, lan2, lan_setup, vigor3900, vigor2960, lan1
Assume Vigor2960 has two LAN networks, and Network Administrator wants clients on LAN2 to use the internal DHCP server on LAN1. The problem is that, by default, DHCP packet cannot pass between LAN1 and LAN2 because the two LAN networks are separated. However, the example below will show you how to use the DHCP Relay feature to achieve this purpose.
1. Go to LAN >> LAN General Setup, make sure there are two LAN networks on Vigor2960.
2. Disable DHCP server for LAN2: Edit lan2 profile, select "Disable" for DHCP Server.
3. Configure DHCP Relay profile for LAN 2: Go to LAN >> General Setup >> DHCP Relay, then click Edit on LAN2 profile,
- Check Enable
- Select "lan1" for DHCP Server Location
- Input DHCP Server IP (It should be an IP on LAN 1 network)
- Leave DHCP Relay Agent IP empty (By default, DHCP Relay Agent IP would be the IP of this DHCP Relay profile. In this example, it will be the IP of lan2, which is 192.168.195.1)
4. Connect a DHCP client to LAN 2 and use command ipconfig to check if it can obtain an IP192.168.195.x from the internal DHCP server on lan1.
- Details
How to block or pass traffic between Vigor3900/2960's different LAN networks?
- DrayOS 4, imported, access_control, ip_filter, lan_networks, traffic_control, inter_lan_route
Assuming Vigor3900/Vigor2960 is connected with 4 LAN networks. The examples below will show you how to block or pass traffics between different LAN networks.
Pass traffic among the 4 LAN networks
Go to LAN >> General Setup >> Inter-LAN Route page, Enable Routing between internal LANs, and apply the settings.
Pass traffic from LAN4 to the other but deny traffic among LAN1/LAN2/LAN3.
1. Un-check Enable Routing Between Internal LANs option via LAN >> General Setup >> Inter-LAN Route.
2. Add 4 IP Object profiles for each LAN networks via Object Setting >> IP Object.
3. Add a Group in IP Filter
4. In that Group, add IP Filter Rule 1 to pass the packets from LAN4 to other LAN networks by configuring the rule as follows:
a. Input Profile Name
b. Enable this rule
c. Select Accept for Action
d. Select lan4 for Input Interface
e. Select ALL LANS for Output Interface
f. In Source IP, select Profile lan4 for Source IP Object.
g. In Destination IP, select Profile lan1, lan2 and lan3 for Destination IP Objects.
5. Add IP Filter Rule 2 to pass the packets from LAN1, LAN2 and LAN3 to LAN4.
a. Input Profile Name
b. Enable this rule
c. Select Action as Accept
d. Select Input Interface as ALL LANS
e. Select Output Interface as lan4.
f. In Source IP, select Profile lan1, lan2 and lan3 for Source IP Object.
g. In Destination IP, select Profile lan4 for Destination IP Object.
6. After completing the above configurations, hosts in LAN4 will be able to access hosts in other LAN networks, and vise versa. But hosts in LAN1, LAN2 or LAN3 will not be able to access each other.
Block traffic from LAN4 to other LANs but pass traffic among LAN1, LAN2 and LAN3
1. Enable Routing Between Internal LANs option via LAN >> General Setup >> Inter-LAN Route.
2. Add a Group in IP Filter
3. In that Group, Add IP Filter Rule 1 to block the packets from LAN4 to other LAN networks:
a. Input Profile Name
b. Enable this rule
c. Select Action as Block
d. Select Input Interface as lan4
e. Select Output Interface as ALL LANS
f. In Source IP, select Profile lan4 for Source IP Object
g. In Destination IP, select Profile lan1, lan2 and lan3 for Destination IP Objects.
After completing the above configurations, hosts belong to LAN1, LAN2 and LAN3 can access each other and LAN4, but hosts belong to LAN4 cannot access LAN1, LAN2 or LAN3.
- Details
How to have more subnets in one LAN profile (for Vigor3900/2960)
- DrayOS 4, imported, firewall_rules, ip_filter, lan_setup, dhcp_config, subnet_management
Vigor3900 and Vigor 2960 supports multiple subnets within one VLAN profile, to let Network Administrator separate the LAN hosts into different IP subnets without setting up either tag-based or port-based VLAN. This article demonstrates how to configure this feature. However, traffic between these subnets will pass by default. It's needed to set up firewall rules if the traffic is forbidden.
1. Go to LAN >> General Setup, and click Edit to configure LAN profile.
2. Click Add in More Subnet field
- Specify the router's IP in this subnet at IP
- Select Mask of the subnet in Subnet Mask
- Select 'NAT' for Mode
- Disable DHCP if there is another DHCP server in the LAN profile
- You may modify the DHCP start IP and End IP if DHCP is enabled
- Click Apply to save
Now, hosts can decide which subnet to belong to by using DHCP and obtain IP in 192.168.1.0/24 subnet or manually configuring static IP in 192.168.3.0/24 subnet.
Block the host from accessing each other
Assume there are two LAN hosts, and their IP are 192.168.1.10 and 192.168.3.3. They can access each other by default, which can be verified by ping command.
To block the traffic between them, we will need to configure firewall rules. To set up a firewall rule:
1. Go to Objects Setting >> IP Object, and add two IP objects, one for the 192.168.1.0/24 subnet, and the other for the 192.168.3.0/24 subnet.
- Give a profile name
- Select "Subnet" for Address Type
- Type Network IP in Start IP Address
- Specify Subnet Mask
- Click Apply to save
2. Go to Firewall >> Filter Setup >> IP Filter, click Add to create a group, then click Add in Group tab to create two firewall rules:
- Give profile name and enable it
- Select 'Block' for Action
- Select the first subnet in Source IP Object and the second subnet for Destination IP Object, For the second rule, the Source IP Object should be the second subnet, and Destination IP Object should be the first subnet.
- Click Apply to save
After finishing the configuration, the firewall setting should be as follows.
Now, we can use ping to verify the Firewall configuration.
- Details
Local Network Setup and Management
- vlan, DrayOS 4, imported, dhcp_relay, dhcp, lan_configuration, inter_lan_routing, dhcp_reservation, tcp_ip, multiple_subnet
This article introduces the LAN configuration of Vigor Router, including the basic TCP/IP settings, the DHCP options, and the VLAN configuration.
Contents
- Router's LAN Interface
- TCP/IP Settings
- DHCP Server Options
- Bind-IP-to-MAC (DHCP Reservation)
- DHCP Relay
- Virtual LAN & Multiple Subnet
- VLAN Configuration
- Inter-LAN Routing
Router's LAN Interface
A router usually has two types of interface, the WAN (Wide Area Network) interface, and LAN (Local Area Network) interface. While WAN is the interface for connecting to the ISP and the Internet, LAN is the interface for communicating with the private network. Vigor Router usually has more than one LAN port, but keep in mind that all of the LAN ports are sharing the same MAC address, so you should regard them as a single interface. Without the VLAN (Virtual LAN) settings, there is no difference between the LAN ports.
TCP/IP Settings
On LAN >> General Setup >> LAN 1 Details page, you can change the IP settings. Network Administrators may use any IP subnet that is preferred, as long as it does not conflict with the WAN IP settings. By default, Vigor Router uses the subnet 192.168.1.0/255.255.255.0 for the LAN interface, and 192.168.1.1 for itself. With such configuration, to access the router from its LAN, the network interface of the PC should be configured with an IP address also in the 192.168.1.0/255.255.255.0 subnet.
DHCP Server Options
The IP configuration on the LAN hosts can be done by DHCP (Dynamic Host Configuration Protocol). DHCP is a very common protocol which allows a DHCP server on the network to distribute the necessary configuration to the DHCP clients automatically, thus reducing the need for configuring the settings on LAN hosts individually.
Vigor Router is by default a DHCP Server, so if a PC has its network interface configured as “Obtain an IP address automatically,” it will get an IP address from the router when it connects to the router's LAN. On Diagnostics >> DHCP Table page, Network Administrator may check the IP addresses assigned and the MAC address of the device which is using the IP address.
On the router, the DHCP Server Configuration can be customized at LAN >> General Setup >> LAN 1 Details page. The network administrator may specify the range of IP address to be allocated by configuring “Start IP Address” and “IP Pool Counts.” You can also set other common DHCP server options, such as the Gateway IP, Lease Time, and DNS Server on the same page. For advanced options, go to LAN >> General Setup >> DHCP Server Option (Advanced) Page to identify the option number, data type, and the value. (Visit DHCP Server Option for Vigor Router for some examples.)
Router assign DNS server of DHCP by the following order:
1. DNS server setting in LAN profile.
2. DNS server setting in force-specified LAN profile(LAN>General Setup).
3. DNS server on primary WAN interface.
4. DNS server setting in LAN1 profile.
5. Router LAN IP.
Note: Router default DNS servers are 8.8.8.8 & 8.8.4.4
Bind-IP-to-MAC (DHCP Reservation)
The IP address obtained by DHCP is dynamic. The DHCP lease has an expiration time, and the IP address will be reclaimed by the DHCP server and may be allocated to other devices when the lease expires. However, Vigor Router supports “Bind-IP-to-MAC” which allows Network Administrator to reserve an IP address for certain MAC address and exclude the IP address from the IP pool; on the other hand, the device of certain MAC address will always obtain the reserved IP address., therefore can get a fixed IP address through DHCP. Bind IP to MAC is useful when there are service-critical devices on the network, such as a printer, which may need a fixed IP address but does not have the interface for manual configuration. To set up Bind-IP-to-MAC, go to LAN >> Bind IP to MAC, select “Enable” and add entries into the “IP Bind List.” (For more details, visit Introduction to Bind IP to MAC)
DHCP Relay
On LAN >> General Setup >> LAN 1 Details page, Network Administrator may turn off the router's DHCP Server function by selecting “Disable Server.” If DHCP Server is disabled, the hosts will need to configure an IP address manually to join the LAN network; sometimes this can add a layer of security to your private network. You can also configure the Vigor Router to be a DHCP Relay Agent. When “Enable Relay Agent” is enabled, the router will not reply the DHCP requests but forward them to the DHCP Server specified at “DHCP Server IP Address” instead.
Virtual LAN & Multiple Subnet
Virtual LAN (VLAN) is commonly implemented to partition the local network and divide the broadcast domain. By adding a VLAN tag to the packets and indicate the VLAN ID, traffic from or to specific VLAN can be differentiated; therefore we can logically separate the LAN clients who physically are on the same network. VLAN allows the network administrator to control the access to a particular part of the network. For example, we may create a VLAN for the staff and another for the guests, then we can allow both the staff and guests to be connected to the same router but ensures that the guests will not have access to the staff-only resources. Another benefit of setting up VLAN is to partition the broadcast domain. VLAN will reduce the nodes that the broadcast packets can reach and thus prevent too much broadcast traffic among the network.
Vigor Router is compatible with 802.1Q VLAN; moreover, it supports multiple subnets, which means the router can use different TCP/IP and DHCP settings to communicate with clients from different VLANs. With multiple subnets, we not only can separate the LAN clients into different groups but also use different IP subnet for each group; this helps Network Administrator to apply group-based policies efficiently, since many of the router's applications (e.g., Firewall, QoS, Policy-based Routing) can be configured base on the IP subnet.
VLAN Configuration
On Vigor Router, we may divide the router's LAN ports into different VLANs. For the cases that a LAN port will be connecting to only one VLAN, we simply specify which VLAN does the LAN port belong to, then the router can differentiate the traffic by which port it receives them. It is also known as “port-based VLAN.”
However, if there is a VLAN-supported device on the network, for example, a managed switch, the router may accept more than one VLAN through a single LAN port, then that LAN port should be members of multiple VLANs. In this case, the network administrator will need to specify the VLAN tag of each VLAN (one of them can be untagged) and make sure the traffic received by the router still keep the VLAN tag so that the router can differentiate the traffic by the VLAN ID on their VLAN tag. It is also known as “tag-based VLAN”.
To create VLAN on Vigor Router, go to LAN >> VLAN,
- Check “Enable” to enable VLAN configuration on the router.
- Choose an available VLAN, select the physical port member (and SSID members for Wi-Fi models) of this VLAN.
- Select a LAN Subnet to determine which IP network settings should the router use on this VLAN.
- Enable VLAN Tag and enter a number as VLAN ID (VID) if necessary. It is required if one of the port members is also a member of another VLAN.
- Click “OK” to save the settings.
- If you use a Subnet other than LAN1, go to LAN >> General Setup to enable that LAN Subnet. You may also configure its TCP/IP and DHCP configurations in “Details Page.” (Visit Use Multiple LAN Subnets with Port-Based VLAN and Use Multiple LAN Subnets with Tag-Based VLAN for some configuration examples.)
Inter-LAN Routing
Note that the clients belong to different VLAN are not able to access each other by default. However, to allow traffic across VLAN, we can enable “Inter-LAN Routing” on the bottom of LAN >> General Setup, this is an option when the VLAN was created to separates the IP range but not to block the LAN clients from each other.
Summary
In summary, on LAN >> General Setup >> Details page, we can configure the TCP/IP settings as well as the DHCP server options. Vigor Router is a DHCP server by default, and it can be turned off or be a DCHP relay agent to forward the DHCP request to another DHCP server. Vigor Router is compatible with 802.1Q VLAN, we can have either port-based VLAN or tag-based VLAN setup on the router, and the router provides multiple subnet which allows us to have different TCP/IP settings and DHCP server configuration for each VLAN.
- Details
Change the VLAN ID range reserved by Vigor Router itself
- telnet, DrayOS 4, imported, sys_reboot, reserved_range, vlan_id, wan_internet
Some ISP providers require a VLAN tag for Internet connection. However, we would find that Internet connection could not work when setting a specified VLAN tag value on WAN Interface. That may be due to the VLAN ID having been reserved by Vigor Router. In this case, we need to change the range of the VLAN ID reserved for the system to make the Internet connection work.
Vigor Router reserve some VLAN IDs for its system by default. To check the range of the VLAN IDs reserved for the system, we can use the telnet command "vlan sysvid show".
Take Vigor2927 for example, the VLAN ID reserved for the system is in the range 3900 ~ 4015.
Suppose an ISP provider requires a VLAN ID 4001 on WAN Interface, VLAN ID 4001 is reserved for the system, and a conflict will occur. We can use the telnet command "vlan sysvid [VLAN ID]" to change the range of the VLAN ID reserved for the system.
Since the reserved VLAN ID is different on each model, we could check the command example first by commanding "vlan sysvid ?" before we change it.
After commanding "vlan sysvid 3800", we can see the VLAN ID range reserved for the system has been changed to 3800~3915. Please reboot the router by “sys reboot” to make sure the new VLAN setting is applied.
- Details
