Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
network routing help wanted [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
snIP3r
l33t
l33t


Joined: 21 May 2004
Posts: 853
Location: germany

PostPosted: Mon Jun 25, 2018 11:37 am    Post subject: network routing help wanted [solved] Reply with quote

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
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Mon Jun 25, 2018 12:46 pm    Post subject: Reply with quote

You cannot route private addresses to the internet, this is what NAT was invented for.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
snIP3r
l33t
l33t


Joined: 21 May 2004
Posts: 853
Location: germany

PostPosted: Mon Jun 25, 2018 1:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum