Forward all the traffic.
Code:
sysctl -w net.ipv4.tcp_ecn=1
sysctl -w net.ipv4.conf.all.forwarding=1
sysctl -w net.ipv4.conf.default.forwarding=1
sysctl -w net.ipv4.conf.lo.forwarding=0
sysctl -w net.ipv4.ip_forward=1
sysctl -w net.ipv6.conf.all.forwarding=2
Put those in /etc/sysctl.conf (and make sure it gets called in startup).
Write a dhcpd.conf that will assign IP address. Two seperate NICs would be two different subnets, and two different dhcpd.conf snippets. Or, bridge them and assign one. That's what I do. A snippet is like so:
Code:
# Ethernet (wired) network subnet
subnet 192.168.10.0 netmask 255.255.255.0 {
option routers 192.168.10.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.10.255;
pool {
range 192.168.10.10 192.168.10.254;
allow unknown-clients;
}
Fill out and start radvd with ip6 prefix:
Code:
## Radvd.conf
##
## Configuration file for the radvd daemon.
##
## To check config syntax: radvd -c
## To start and write to default logfile
## under /var/log: radvd -m logfile
##
## See manpages 'radvd' and 'radvd.conf' for
## further details.
##
## ----------------------------------------
## The interfaces to serve Router Advertisements on.
# Bridge used with TUN/TAP devices and SIMH for guest operating systems.
interface br0 {
# This bridge is used with SIMH simulated operating systems and
# as such the interface might not exist. Do not error out on such
# a situation.
IgnoreIfMissing on;
AdvSendAdvert on;
# DNS servers to use.
# Google's
#RDNSS 2001:4860:4860::8888 2001:4860:4860::8844 {
# OpenDNS's
RDNSS 2620:0:ccc::2 2620:0:ccd::2 {
};
# radvd complains without these - seems TWC isp uses them.
AdvManagedFlag on;
AdvOtherConfigFlag on;
# The prefix you're serving.
# This prefix is gotten from 'dhclient -6 -v -P $EXT_INTERFACE'
prefix 2603:x:x:x::/64 {
AdvOnLink on;
AdvAutonomous on;
};
route 2603:x:x:x::/64 {
AdvRoutePreference high;
};
};
## EOF
Sometimes I have to set an ip6 default route for that. Use 'ip -c -6 route add default whatever'. Masquerade all rfc1918 traffic. The FORWARD table is likely ACCEPT by default anyway, so no need to explicitly allow it (iptables -P FORWARD ACCEPT).
Code:
# Masquerade all rfc1918 LAN ipv4 addresses
iptables -t nat -A POSTROUTING -m comment --comment "Masquerading LAN rfc1918 addresses" -s $INTERNAL_NETWORK -j MASQUERADE
Quote:
share a directory on one of these computers and open it on the other computer
|
That would likely be with Samba and Windows networking. It's easier to get Linux speaking SMB/CIFS than it is to get Windows speaking NFS. I use the bridge version of this with a wireless interface inserted and everything can reach eachother. Anything that can speak ip6 will be accessible from the outside internet so take note of that security-wise.