View previous topic :: View next topic |
Author |
Message |
snIP3r l33t
Joined: 21 May 2004 Posts: 853 Location: germany
|
Posted: Mon Jun 25, 2018 11:37 am Post subject: network routing help wanted [solved] |
|
|
hi all!
i want to enable lan routing capability to my gentoo backup test server. therefor i added 2 network cars to the box: enp3s0 and enp4s0
enp4s0 gets address through dhcp server in my dsl router and enp3s0 should be a dhcp server for the other network.
enp4s0 is in a 192.168.0.x network and enp3s0 should be a dhcp server for a 192.168.1.x network. this works so far, but i cannot add a route so that every traffic from 192.168.1.x is routed through the enp4s0 card and can go the way to internet.
Code: |
/etc/conf.d/net:
config_enp4s0="dhcp"
config_enp3s0="192.168.1.1 netmask 255.255.255.0"
|
Code: |
/etc/conf.d/dhcpd:
DHCPD_IFACE="enp3s0"
|
Code: |
/etc/dhcp/dhcpd.conf:
authoritative;
ddns-update-style interim;
subnet 192.168.1.0 netmask 255.255.255.0 {
pool {
range 192.168.1.100 192.168.1.250;
default-lease-time 259200;
max-lease-time 518400;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
option domain-name-servers 192.168.1.1;
}
}
|
any help would be appreciated!
thx in advance
snIP3r _________________ Intel i3-4130T on ASUS P9D-X
Kernel 5.15.88-gentoo SMP
-----------------------------------------------
if your problem is fixed please add something like [solved] to the topic!
Last edited by snIP3r on Mon Jun 25, 2018 1:13 pm; edited 1 time in total |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
snIP3r l33t
Joined: 21 May 2004 Posts: 853 Location: germany
|
Posted: Mon Jun 25, 2018 1:13 pm Post subject: |
|
|
OMG!!! i completely mixed this up....
iptables -t nat -A POSTROUTING --source 192.168.1.0/24 --out-interface enp4s0 -j MASQUERADE
did the job... _________________ Intel i3-4130T on ASUS P9D-X
Kernel 5.15.88-gentoo SMP
-----------------------------------------------
if your problem is fixed please add something like [solved] to the topic! |
|
Back to top |
|
|
|